mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-09-13 01:17:06 +00:00
feat: add T4 menu dumping and loading (#986)
* feat: add T4 menu dumping * chore: align with latest changes * feat: add T4 menu loading Load T4 menulists and menu files through the shared menu parser. Preserve T4-specific menu and listbox fields and cover loading, dumping, linking, and round-trip behaviour. * chore: make flag fields unsigned * chore: rename `expOperationEnum` -> `operationEnum` * chore: use default enum numeration for T4 operationEnum * chore: remove unused members of operationEnum * chore: remove redundant op from operationEnum * refactor: align T4 expression operand names with IW3 * chore: small adjustment to iw3,t4 types --------- Co-authored-by: Jan Laupetin <[email protected]>
This commit is contained in:
+137
-10
@@ -2781,6 +2781,26 @@ namespace T4
|
||||
int vertAlign;
|
||||
};
|
||||
|
||||
enum WindowDefStaticFlag : unsigned int
|
||||
{
|
||||
WINDOW_FLAG_DECORATION = 0x100000,
|
||||
WINDOW_FLAG_HORIZONTAL_SCROLL = 0x200000,
|
||||
WINDOW_FLAG_AUTO_WRAPPED = 0x800000,
|
||||
WINDOW_FLAG_POPUP = 0x1000000,
|
||||
WINDOW_FLAG_OUT_OF_BOUNDS_CLICK = 0x2000000,
|
||||
WINDOW_FLAG_LEGACY_SPLIT_SCREEN_SCALE = 0x4000000,
|
||||
WINDOW_FLAG_HIDDEN_DURING_FLASH_BANG = 0x10000000,
|
||||
WINDOW_FLAG_HIDDEN_DURING_SCOPE = 0x20000000,
|
||||
WINDOW_FLAG_HIDDEN_DURING_UI = 0x40000000,
|
||||
};
|
||||
|
||||
enum WindowDefDynamicFlag : unsigned int
|
||||
{
|
||||
WINDOW_FLAG_VISIBLE = 0x4,
|
||||
WINDOW_FLAG_NON_DEFAULT_BACKCOLOR = 0x8000,
|
||||
WINDOW_FLAG_NON_DEFAULT_FORECOLOR = 0x10000,
|
||||
};
|
||||
|
||||
struct windowDef_t
|
||||
{
|
||||
const char* name;
|
||||
@@ -2792,8 +2812,8 @@ namespace T4
|
||||
int ownerDraw;
|
||||
int ownerDrawFlags;
|
||||
float borderSize;
|
||||
int staticFlags;
|
||||
int dynamicFlags[1];
|
||||
unsigned int staticFlags;
|
||||
unsigned int dynamicFlags[1];
|
||||
int nextTime;
|
||||
float foreColor[4];
|
||||
float backColor[4];
|
||||
@@ -2813,7 +2833,7 @@ namespace T4
|
||||
{
|
||||
int intVal;
|
||||
float floatVal;
|
||||
const char* string;
|
||||
const char* stringVal;
|
||||
};
|
||||
|
||||
enum expDataType
|
||||
@@ -2823,11 +2843,109 @@ namespace T4
|
||||
VAL_STRING = 0x2,
|
||||
};
|
||||
|
||||
enum expOperationEnum
|
||||
enum operationEnum : int
|
||||
{
|
||||
OP_NEGATE = 0x7,
|
||||
NUM_EXPRESSION_OPERATORS = 0x18,
|
||||
MAX_OPERATOR_VALUE = 0x4000,
|
||||
OP_NOOP,
|
||||
OP_RIGHTPAREN,
|
||||
OP_MULTIPLY,
|
||||
OP_DIVIDE,
|
||||
OP_MODULUS,
|
||||
OP_ADD,
|
||||
OP_SUBTRACT,
|
||||
OP_NOT,
|
||||
OP_LESSTHAN,
|
||||
OP_LESSTHANEQUALTO,
|
||||
OP_GREATERTHAN,
|
||||
OP_GREATERTHANEQUALTO,
|
||||
OP_EQUALS,
|
||||
OP_NOTEQUAL,
|
||||
OP_AND,
|
||||
OP_OR,
|
||||
OP_LEFTPAREN,
|
||||
OP_COMMA,
|
||||
OP_BITWISEAND,
|
||||
OP_BITWISEOR,
|
||||
OP_BITWISENOT,
|
||||
OP_BITSHIFTLEFT,
|
||||
OP_BITSHIFTRIGHT,
|
||||
|
||||
OP_FIRSTFUNCTIONCALL,
|
||||
OP_SIN = OP_FIRSTFUNCTIONCALL,
|
||||
OP_COS,
|
||||
OP_MIN,
|
||||
OP_MAX,
|
||||
OP_MILLISECONDS,
|
||||
OP_DVARINT,
|
||||
OP_DVARBOOL,
|
||||
OP_DVARFLOAT,
|
||||
OP_DVARSTRING,
|
||||
OP_STAT,
|
||||
OP_UIACTIVE,
|
||||
OP_FLASHBANGED,
|
||||
OP_SCOPED,
|
||||
OP_SCOREBOARDVISIBLE,
|
||||
OP_INKILLCAM,
|
||||
OP_PLAYERFIELD,
|
||||
OP_SELECTINGLOCATION,
|
||||
OP_TEAMFIELD,
|
||||
OP_OTHERTEAMFIELD,
|
||||
OP_MARINESFIELD,
|
||||
OP_OPFORFIELD,
|
||||
OP_MENUISOPEN,
|
||||
OP_WRITINGDATA,
|
||||
OP_INLOBBY,
|
||||
OP_INPRIVATEPARTY,
|
||||
OP_PRIVATEPARTYHOST,
|
||||
OP_PRIVATEPARTYHOSTINLOBBY,
|
||||
OP_ALONEINPARTY,
|
||||
OP_ADSJAVELIN,
|
||||
OP_WEAPLOCKBLINK,
|
||||
OP_WEAPATTACKTOP,
|
||||
OP_WEAPATTACKDIRECT,
|
||||
OP_SECONDSASTIME,
|
||||
OP_TABLELOOKUP,
|
||||
OP_LOCALIZESTRING,
|
||||
OP_LOCALVARINT,
|
||||
OP_LOCALVARBOOL,
|
||||
OP_LOCALVARFLOAT,
|
||||
OP_LOCALVARSTRING,
|
||||
OP_TIMELEFT,
|
||||
OP_SECONDSASCOUNTDOWN,
|
||||
OP_GAMEMSGWNDACTIVE,
|
||||
OP_TOINT,
|
||||
OP_TOSTRING,
|
||||
OP_TOFLOAT,
|
||||
OP_GAMETYPENAME,
|
||||
OP_GAMETYPE,
|
||||
OP_GAMETYPEDESCRIPTION,
|
||||
OP_SCORE,
|
||||
OP_FRIENDSONLINE,
|
||||
OP_FOLLOWING,
|
||||
OP_STATRANGEBITSSET,
|
||||
OP_KEYBINDING,
|
||||
OP_ACTIONSLOTUSABLE,
|
||||
OP_HUDFADE,
|
||||
OP_MAXPLAYERS,
|
||||
OP_ACCEPTINGINVITE,
|
||||
OP_GAMEHOST,
|
||||
OP_ISSPLITSCREEN,
|
||||
OP_ISSPLITSCREENHOST,
|
||||
OP_SPLITSCREENNUM,
|
||||
OP_ISCINEMATICFINISHED,
|
||||
OP_ISSQUADLEADER,
|
||||
OP_GETSQUADID,
|
||||
OP_ISARTILLERY,
|
||||
OP_GETPLAYERSQUADID,
|
||||
OP_HASFRIENDS,
|
||||
OP_HASPENDINGFRIENDS,
|
||||
OP_HASINVITES,
|
||||
OP_SQUADINVITESENT,
|
||||
OP_ISINTERMISSION,
|
||||
OP_PARTYISMISSINGMAPPACK,
|
||||
OP_PARTYMISSINGMAPPACKERROR,
|
||||
OP_ANYNEWMAPPACKS,
|
||||
|
||||
NUM_OPERATORS,
|
||||
};
|
||||
|
||||
struct Operand
|
||||
@@ -2839,7 +2957,7 @@ namespace T4
|
||||
union entryInternalData
|
||||
{
|
||||
Operand operand;
|
||||
expOperationEnum op;
|
||||
operationEnum op;
|
||||
};
|
||||
|
||||
enum expressionEntryType : int
|
||||
@@ -2879,7 +2997,7 @@ namespace T4
|
||||
int elementStyle;
|
||||
int numColumns;
|
||||
columnInfo_s columnInfo[16];
|
||||
const char* doubleClick;
|
||||
const char* onDoubleClick;
|
||||
int notselectable;
|
||||
int noScrollBars;
|
||||
int usePaging;
|
||||
@@ -2945,6 +3063,15 @@ namespace T4
|
||||
ITEM_TYPE_GAME_MESSAGE_WINDOW = 0x13
|
||||
};
|
||||
|
||||
enum ItemDefDvarFlag
|
||||
{
|
||||
ITEM_DVAR_FLAG_ENABLE = 0x1,
|
||||
ITEM_DVAR_FLAG_DISABLE = 0x2,
|
||||
ITEM_DVAR_FLAG_SHOW = 0x4,
|
||||
ITEM_DVAR_FLAG_HIDE = 0x8,
|
||||
ITEM_DVAR_FLAG_FOCUS = 0x10,
|
||||
};
|
||||
|
||||
struct itemDef_s
|
||||
{
|
||||
windowDef_t window;
|
||||
@@ -2961,7 +3088,7 @@ namespace T4
|
||||
int gameMsgWindowIndex;
|
||||
int gameMsgWindowMode;
|
||||
const char* text;
|
||||
int itemFlags;
|
||||
unsigned int itemFlags;
|
||||
menuDef_t* parent;
|
||||
const char* mouseEnterText;
|
||||
const char* mouseExitText;
|
||||
|
||||
Reference in New Issue
Block a user