mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Added missing #includes Added LUA scripting and console Changed the way tracers are visualized, so they work more like real tracers instead of a light fountain Fixed signedness of many grid variables used in GetMouseMapPos calls Fixed enemy weapon choosing: Sometimes a mortar is chosen but later rejected, but the grenade class was not reset. Caused assertion failure Added checks so enemies don't try to chuck RPG grenades with their hands Now possible to shoot a someone in the head if he's in water Fixed InitSightArrays to also clear soldier interrupt duel points. This was causing an assertion failure elsewhere in the code because the interrupt list still had soldiers on it sometimes when this function was called. Soldiers are much less willing to forfeit their turn over an attempt to use more APs than they have Removed early setting of muzzle flash. This would allow enemies to get an interrupt before you even fired. Fixed item dropping by AI. If AI tried to drop something while standing it would cause deadlock Change to greatly speed up closing the sector inventory window in an unloaded sector Added conditional compile flag to always give robot weapon ready advantage, even for 360 degree sighting Check builddefines.h for the conditional flags. Of greatest interest might be LUA_CONSOLE. This will cause the game to bring up a command console when run. However this console is severely lacking in many areas. If anybody knows of an open-source terminal/console that could be used instead, it would be appreciated. The existing console does bad things when you try to close it, and since it counts as a separate app, it pauses the game while it has focus. LUA scripting is very limited, basically just proof of concept. There is one global variable, the Soldiers array. An array index gives you the soldier in that slot in the currently loaded sector. The soldier has a few things that can be accessed: name (short name); fullname (long name); grid (current grid #, can be changed); walkto(grid) (function to walk to another grid); runto(grid) (function to run to another grid) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
108 lines
4.3 KiB
C
108 lines
4.3 KiB
C
#ifndef _MSGBOX_H
|
|
#define _MSGBOX_H
|
|
|
|
#include "mousesystem.h"
|
|
|
|
// Message box flags
|
|
#define MSG_BOX_FLAG_USE_CENTERING_RECT 0x0001 // Pass in a rect to center in
|
|
#define MSG_BOX_FLAG_OK 0x0002 // Displays OK button
|
|
#define MSG_BOX_FLAG_YESNO 0x0004 // Displays YES NO buttons
|
|
#define MSG_BOX_FLAG_CANCEL 0x0008 // Displays YES NO buttons
|
|
#define MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS 0x0010 // Displays four numbered buttons, 1-4
|
|
#define MSG_BOX_FLAG_YESNOCONTRACT 0x0020 // yes no and contract buttons
|
|
#define MSG_BOX_FLAG_OKCONTRACT 0x0040 // ok and contract buttons
|
|
#define MSG_BOX_FLAG_YESNOLIE 0x0080 // ok and contract buttons
|
|
#define MSG_BOX_FLAG_CONTINUESTOP 0x0100 // continue stop box
|
|
#define MSG_BOX_FLAG_OKSKIP 0x0200 // Displays ok or skip (meanwhile) buttons
|
|
#define MSG_BOX_FLAG_GENERICCONTRACT 0x0400 // displays contract buttoin + 2 user-defined text buttons
|
|
#define MSG_BOX_FLAG_GENERIC 0x0800 // 2 user-defined text buttons
|
|
|
|
// message box return codes
|
|
#define MSG_BOX_RETURN_OK 1 // ENTER or on OK button
|
|
#define MSG_BOX_RETURN_YES 2 // ENTER or YES button
|
|
#define MSG_BOX_RETURN_NO 3 // ESC, Right Click or NO button
|
|
#define MSG_BOX_RETURN_CONTRACT 4 // contract button
|
|
#define MSG_BOX_RETURN_LIE 5 // LIE BUTTON
|
|
|
|
// message box style flags
|
|
enum
|
|
{
|
|
MSG_BOX_BASIC_STYLE = 0, // We'll have other styles, like in laptop, etc
|
|
// Graphics are all that are required here...
|
|
MSG_BOX_RED_ON_WHITE,
|
|
MSG_BOX_BLUE_ON_GREY,
|
|
MSG_BOX_BASIC_SMALL_BUTTONS,
|
|
MSG_BOX_IMP_STYLE,
|
|
MSG_BOX_LAPTOP_DEFAULT,
|
|
};
|
|
|
|
|
|
typedef void (*MSGBOX_CALLBACK)( UINT8 bExitValue );
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
UINT16 usFlags;
|
|
UINT32 uiExitScreen;
|
|
MSGBOX_CALLBACK ExitCallback;
|
|
INT16 sX;
|
|
INT16 sY;
|
|
UINT32 uiSaveBuffer;
|
|
MOUSE_REGION BackRegion;
|
|
UINT16 usWidth;
|
|
UINT16 usHeight;
|
|
INT32 iButtonImages;
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
UINT32 uiOKButton;
|
|
UINT32 uiYESButton;
|
|
UINT32 uiNOButton;
|
|
UINT32 uiUnusedButton;
|
|
};
|
|
struct
|
|
{
|
|
UINT32 uiButton[4];
|
|
};
|
|
};
|
|
BOOLEAN fRenderBox;
|
|
INT8 bHandled;
|
|
INT32 iBoxId;
|
|
|
|
} MESSAGE_BOX_STRUCT;
|
|
|
|
|
|
|
|
|
|
extern MESSAGE_BOX_STRUCT gMsgBox;
|
|
extern BOOLEAN fRestoreBackgroundForMessageBox;
|
|
|
|
//this variable can be unset if ur in a non gamescreen and DONT want the msg box to use the save buffer
|
|
extern BOOLEAN gfDontOverRideSaveBuffer;
|
|
|
|
////////////////////////////////
|
|
// ubStyle: Determines the look of graphics including buttons
|
|
// zString: 16-bit string
|
|
// uiExitScreen The screen to exit to
|
|
// ubFlags Some flags for button style
|
|
// ReturnCallback Callback for return. Can be NULL. Returns any above return value
|
|
// pCenteringRect Rect to send if MSG_BOX_FLAG_USE_CENTERING_RECT set. Can be NULL
|
|
////////////////////////////////
|
|
|
|
INT32 DoMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
|
void DoScreenIndependantMessageBox( const STR16 zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback );
|
|
void DoUpperScreenIndependantMessageBox( const STR16 zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback );
|
|
|
|
void DoLowerScreenIndependantMessageBox( const STR16 zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback );
|
|
void DoScreenIndependantMessageBoxWithRect( const STR16 zString, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
|
|
|
//wrappers for other screens
|
|
BOOLEAN DoLapTopSystemMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
|
INT32 DoMapMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
|
BOOLEAN DoOptionsMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
|
BOOLEAN DoSaveLoadMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback, SGPRect *pCenteringRect );
|
|
|
|
|
|
#endif |