mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Driveable vehicle Update: Externalized vehicle seats (by anv)
- externalised vehicle seats (TableData\Vehicles.xml) influence position of passenger, field of view, ability to shoot and being hidden, - seat can chosen by using ctrl+RMB on vehicle (ctrl + LMB just takes the first visible seat) - seats can be changed or swapped while inside vehicle, - remade JSD files for cars, - vehicles aren't transparent anymore, - vehicles are louder than people, depending how fast they move. see: http://www.bears-pit.com/board/ubbthreads.php/topics/332790/5.html git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7212 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
#ifndef _VEHICLE_MENU_
|
||||
#define _VEHICLE_MENU_
|
||||
|
||||
#include "popup_class.h"
|
||||
#include "Soldier Profile.h"
|
||||
|
||||
class VehicleMenuItem
|
||||
{
|
||||
public:
|
||||
VehicleMenuItem() :
|
||||
fInitialized(FALSE), usPosX(0), gPopup(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Cancel()
|
||||
{
|
||||
// Hide the Filter Menu pop-up.
|
||||
if (gPopup != NULL && fInitialized )
|
||||
{
|
||||
gPopup->hide();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Destroy()
|
||||
{
|
||||
// If we already have a popup, destroy it first. This ensures we get a fresh menu each time.
|
||||
if ( fInitialized )
|
||||
{
|
||||
delete(gPopup);
|
||||
gPopup = NULL;
|
||||
fInitialized = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
UINT16 GetMaxPosX()
|
||||
{
|
||||
if ( gPopup )
|
||||
return (usPosX + gPopup->getBoxDimensions().iRight);
|
||||
|
||||
return usPosX;
|
||||
}
|
||||
|
||||
virtual void SetPos(UINT16 usX, UINT16 usY)
|
||||
{
|
||||
// same y, different x
|
||||
usPosX = usX;
|
||||
gPopup->setPosition( usPosX, usY );
|
||||
|
||||
fInitialized = TRUE;
|
||||
gPopup->show();
|
||||
}
|
||||
|
||||
void SetupPopup(CHAR* name);
|
||||
|
||||
POPUP* GetPopup()
|
||||
{
|
||||
return gPopup;
|
||||
}
|
||||
|
||||
virtual void Setup( UINT32 aVal ) {}
|
||||
virtual void Functions( UINT32 aVal ) {}
|
||||
|
||||
private:
|
||||
BOOLEAN fInitialized;
|
||||
UINT16 usPosX;
|
||||
POPUP* gPopup;
|
||||
};
|
||||
|
||||
// select a vehicle seat (and possibly other options)
|
||||
class VehicleSelection : public VehicleMenuItem
|
||||
{
|
||||
public:
|
||||
VehicleSelection() : usSector(0) {}
|
||||
|
||||
void Setup( UINT32 aVal );
|
||||
void Functions( UINT32 aVal );
|
||||
|
||||
private:
|
||||
UINT32 usSector;
|
||||
};
|
||||
|
||||
|
||||
void VehicleMenu( INT32 usMapPos, SOLDIERTYPE *pSoldier, SOLDIERTYPE *pVehicle );
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user