Menu Asset (BO1)

From COD Engine Research
Jump to: navigation, search
enum expDataType
{
	VAL_INT = 0x0,
	VAL_FLOAT = 0x1,
	VAL_STRING = 0x2,
};
 
union operandInternalDataUnion
{
	int intVal;
	float floatVal;
	const char *string;
};
 
struct Operand
{
	expDataType dataType;
	operandInternalDataUnion internals;
};
 
union expressionRpnDataUnion
{
	Operand operand;
	void *cmd;
	int cmdIdx;
};
 
struct expressionRpn
{
	int type;
	expressionRpnDataUnion data;
};
 
struct ExpressionStatement	// size = 0x10
{
	char *filename;
	int line;
	int numRpn;
	expressionRpn *rpn;	// count = unk1Count;
};
 
struct rectData_t	// size = 0x40
{
	ExpressionStatement rectXExp;
	ExpressionStatement rectYExp;
	ExpressionStatement rectWExp;
	ExpressionStatement rectHExp;
};
 
struct gameMsgDef_s	// 8
{
	int gameMsgWindowIndex;
	int gameMsgWindowMode;
};
 
struct focusItemDef_t;
 
union textData_t
{
	focusItemDef_t *focusItemDef;	// 3,4,5,7,8,9,10,11,12,13,14,16,20,21,22,30
	gameMsgDef_t *gameMsgDef;	// 15
	void *data;
};
 
struct textExp_s
{
	ExpressionStatement textExp;
};
 
struct textDef_s	// 0xD4
{
	rectDef_s textRect[4];
	int alignment;
	int fontEnum;
	int itemFlags;
	int textAlignMode;
	float textalignx;
	float textaligny;
	float textscale;
	int textpadding;
	int textstyle;
	float fontColor[4];
	float glowColor[4];
	float shadowColor[4];
	float fontBlur;
	float glowRadius;
	float shadowSize;
	float shadowOffset;
	int unknown;
	const char *text;
	textExp_s *textExpData;
	textDefData_t textData;
};
 
struct MenuCell	// 0xC
{
	int type;
	int maxChars;
	char *stringValue;	// size = maxChars
};
 
struct MenuRow	// 0x18
{
	MenuCell *cells;	// count = listBoxDef_s.count1
	char *eventName;
	char *onFocusEventName;
	bool disableArg;
	int status;
	int name;
};
 
struct columnInfo_s
{
	int elementStyle;
	int maxChars;
	rectDef_s rect;
};
 
struct listBoxDef_t	// 0x2BC
{
	int mousePos;
#ifdef PC
	int cursorPos;
	int startPos;
	int endPos;
#else
	int cursorPos[4];
	int startPos[4];
	int endPos[4];
#endif
	int drawPadding;
	float elementwidth;
	float elementheight;
	int numColumns;
	float special;
	columnInfo_s columnInfo[16];
	int notselectable;
	int noScrollBars;
	int usePaging;
	float selectBorder[4];
	float disableColor[4];
	float focusColor[4];
	float elementHighlightColor[4];
	float elementBackgroundColor[4];
	Material *selectIcon;
	Material *backgroundItemListBox;
	Material *highlightTexture;
	int noBlinkingHighlight;
	MenuRow *rows;	// count = numRows
	int maxRows;
	int rowCount;
};
 
struct multiDef_s	// 0x18C
{
	const char *dvarList[32];
	const char *dvarStr[32];
	float dvarValue[32];
	int count;
	int actionOnEnterPressOnly;
	int strDef;
};
 
struct editFieldDef_s	// 0x30
{
#ifdef PC
	int cursorPos[1];
#else
	int cursorPos[4];
#endif
	float minVal;
	float maxVal;
	float defVal;
	float range;
	int maxChars;
	int maxCharsGotoNext;
	int maxPaintChars;
	int paintOffset;
};
 
struct enumDvarDef_s
{
	char *enumDvarName;
};
 
union focusDefData_t
{
	listBoxDef_s *listBox;		// 4
	multiDef_s *multiDef;		// 10
	editFieldDef_s *editField;	// 5,7,8,9,12,13,14,16,22,30
	enumDvarDef_s *enumDvarDef;	// 11
	void *data;
};
 
struct ScriptCondition // 0x10
{
	bool fireOnTrue;
	int constructId;
	int blockId;
	ScriptCondition *next;
};
 
struct GenericEventScript	// 0x2C
{
	ScriptCondition *prerequisites;
	ExpressionStatement condition;
	int type;
	bool fireOnTrue;
	const char *action;
	int blockId;
	int constructId;
	GenericEventScript *next;
};
 
struct GenericEventHandler // 0xC
{
	const char *name;
	GenericEventScript *eventScript;
	GenericEventHandler *next;
};
 
 
struct focusItemDef_t	// 0x18
{
	const char *mouseEnterText;
	const char *mouseExitText;
	const char *mouseEnter;
	const char *mouseExit;
	GenericEventHandler *onKey;
	focusDefData_t typeData;
};
 
struct imageDef_s
{
	ExpressionStatement materialExp;
};
 
struct ownerDrawDef_s
{
	ExpressionStatement dataExp;
};
 
union itemDefData_t
{
	textDef_s *textData;	// 1,3,4,5,7,8,9,10,11,12,13,14,15,16,18,20,22
	imageDef_s *imageDef;		// 2
	focusItemDef_s *blankButtonDef;	// 19, 21
	ownerDrawDef_s *ownerDrawDef;	// 6
	void *data;
};
 
struct ItemKeyHandler	// size = 0xC
{
	const char *keyName;
	GenericEventScript *keyScript;
	ItemKeyHandler *next;
};
 
struct animParamsDef_t	// size = 0x6C
{
	const char *name;
	rectDef_s rectClient;
	float borderSize;
	float foreColor[4];
	float backColor[4];
	float borderColor[4];
	float outlineColor[4];
	float textScale;
	float rotation;
	ItemKeyHandler *onEvent;
};
 
struct UIAnimInfo	// 0xEC
{
	int count;
	animParamsDef_t *animStates;
	animParamsDef_t currentAnimState;
	animParamsDef_t nextAnimState;
	int animating;
	int animStartTime;
	int animDuration;
};
 
/* dynamicFlags */
#define WINDOWDYNAMIC_VISIBLE		0x00000004
#define WINDOWDYNAMIC_CHECKMASK		0x000FFFFF
 
/* staticFlags */
#define WINDOWSTATIC_DECORATION			0x00100000
#define WINDOWSTATIC_HORIZONTALSCROLL		0x00200000
#define WINDOWSTATIC_AUTOWRAPPED		0x00800000
#define WINDOWSTATIC_POPUP 			0x01000000
#define WINDOWSTATIC_OUTOFBOUNDSCLICK 		0x02000000
#define WINDOWSTATIC_LEGACYSPLITSCREENSCALE	0x04000000
#define WINDOWSTATIC_ALLOWSIGNIN		0x08000000
#define WINDOWSTATIC_HIDDENDURINGFLASHBANG	0x10000000
#define WINDOWSTATIC_HIDDENDURINGSCOPE		0x20000000
#define WINDOWSTATIC_HIDDENDURINGUI		0x40000000
#define WINDOWSTATIC_CHECKMASK			0xFFF00000
 
struct rectDef_s
{
	float x;
	float y;
	float w;
	float h;
	int horzAlign;
	int vertAlign;
};
 
struct windowDef_t	// 0xB0
{
	const char *name;
	rectDef_s rect;
	rectDef_s rectClient;
	const char *group;
	char style;
	char border;
	char modal;
	char frameSides;	
	float frameTexSize;
	float frameSize;
	int ownerDraw;
	int ownerDrawFlag;
	float borderSize;
	int staticFlags;
#ifdef PC
	int dynamicFlags[1];
#else
	int dynamicFlags[4];
#endif
	int nextTime;
	float foreColor[4];
	float backColor[4];
	float borderColor[4];
	float outlineColor[4];
	float rotation;
	Material *background;
};
 
struct itemDef_t	// size = 0x118
{
	windowDef_t window;
	int type;
	int dataType;
	int imageTrack;
	const char *dvar;
	const char *dvarTest;
	const char *enableDvar;
	int dvarFlags;		// (1=enableDvar,2=disableDvar,4=showDvar,8=hideDvar,16=focusDvar)
	itemDefData_t typeData;
	menuDef_t *parent;
	rectData_s *rectExpData;
	ExpressionStatement visibleExp;
	unsigned __int64 showBits;
	unsigned __int64 hideBits;
	ExpressionStatement foreColorExp;
	int ui3dWindowId;
	ItemKeyHandler *onEvent;
	UIAnimInfo *animInfo;
	int unknown2;
};
 
#pragma pack(push, 8)
struct menuDef_t	// size = 0x1A8
{
	windowDef_t window;
	const char *font;
	int fullscreen;
	int ui3dWindowId;
	int itemCount;
	int fontIndex;
#ifdef 
	int cursorItem[1];
#else
	int cursorItem[4];
#endif
	int fadeCycle;
	int priority;
	float fadeClamp;
	float fadeAmount;
	float fadeInAmount;
	float blurRadius;
	int openSlideSpeed;
	int closeSlideSpeed;
	int openSlideDirection;
	int closeSlideDirection;
	rectDef_s initalRectInfo;
	int openFadingTime;
	int closeFadingTime;
	int fadeTimeCounter;
	int slideTimeCounter;
	GenericEventHandler *onEvent;
	ItemKeyHandler *onKey;
	ExpressionStatement visibleExp;
	// 4 byte padding
	unsigned __int64 showBits;
	unsigned __int64 hideBits;
	const char *allowedBinding;
	const char *soundLoop;
	int imageTrack;
	int control;
	float focusColor[4];
	float disableColor[4];
	ExpressionStatement rectYExp;
	ExpressionStatement rectXExp;
	itemDef_t **items;
	// 4 byte padding
};
#pragma pack(pop)