Menu Asset (BO2)

From COD Engine Research
Jump to: navigation, search
enum expDataType
{
  VAL_INT = 0x0,
  VAL_FLOAT = 0x1,
  VAL_STRING = 0x2,
  VAL_ADDRESS = 0x3,
  VAL_DVAR = 0x4,
};
union operandInternalDataUnion
{
  int intVal;
  float floatVal;
  const char *string;
  dvar_t *dvar;
};
 
struct Operand
{
  expDataType dataType;
  operandInternalDataUnion internals;
};
 
enum expOperationEnum
{
  OP_NOOP = 0x0,
  OP_RIGHTPAREN = 0x1,
  OP_MULTIPLY = 0x2,
  OP_DIVIDE = 0x3,
  OP_MODULUS = 0x4,
  OP_ADD = 0x5,
  OP_SUBTRACT = 0x6,
  OP_NEGATE = 0x7,
  OP_NOT = 0x8,
  OP_LESSTHAN = 0x9,
  OP_LESSTHANEQUALTO = 0xA,
  OP_GREATERTHAN = 0xB,
  OP_GREATERTHANEQUALTO = 0xC,
  OP_EQUALS = 0xD,
  OP_NOTEQUAL = 0xE,
  OP_AND = 0xF,
  OP_OR = 0x10,
  OP_LEFTPAREN = 0x11,
  OP_COMMA = 0x12,
  OP_BITWISEAND = 0x13,
  OP_BITWISEOR = 0x14,
  OP_BITWISENOT = 0x15,
  OP_BITSHIFTLEFT = 0x16,
  OP_BITSHIFTRIGHT = 0x17,
  NUM_EXPRESSION_OPERATORS = 0x18,
  MAX_OPERATOR_VALUE = 0x4000,
};
 
union expressionRpnDataUnion
{
  Operand constant;
  void *cmd;
  int cmdIdx;
};
 
enum expressionRpnEnum
{
  RPN_CONSTANT = 0x0,
  RPN_CMD_IDX = 0x1,
  RPN_CMD = 0x2,
  RPN_END = 0x3,
};
 
struct expressionRpn
{
  expressionRpnEnum type;
  expressionRpnDataUnion data;
};
 
struct ExpressionStatement
{
  char *filename;
  int line;
  int numRpn;
  expressionRpn *rpn;
};
 
struct ScriptCondition
{
  bool fireOnTrue;
  int constructID;
  int blockID;
  ScriptCondition *next;
};
 
struct GenericEventScript
{
  ScriptCondition *prerequisites;
  ExpressionStatement condition;
  int type;
  bool fireOnTrue;
  const char *action;
  int blockID;
  int constructID;
  GenericEventScript *next;
};
 
struct ItemKeyHandler
{
  int key;
  GenericEventScript *keyScript;
  ItemKeyHandler *next;
};
 
struct textExp_s
{
  ExpressionStatement textExp;
};
 
struct columnInfo_s
{
  int elementStyle;
  int maxChars;
  rectDef_s rect;
};
 
struct MenuCell
{
  int type;
  int maxChars;
  char *stringValue;
};
 
struct MenuRow
{
  MenuCell *cells;
  char *eventName;
  char *onFocusEventName;
  bool disableArg;
  int status;
  int name;
};
 
struct listBoxDef_s
{
  int mousePos;
#ifndef PC			//Note: PC only has 1 cursor, but consoles can have 4 controllers connected
  int cursorPos[4];
  int startPos[4];
  int endPos[4];
#else
  int cursorPos[1];
  int startPos[1];
  int endPos[1];
#endif
  int drawPadding;
  float elementWidth;
  float elementHeight;
  int numColumns;
  float special;
  columnInfo_s columnInfo[16];
  int notselectable;
  int noScrollBars;
  int usePaging;
  vec4_t selectBorder;
  vec4_t disableColor;
  vec4_t focusColor;
  vec4_t elementHighlightColor;
  vec4_t elementBackgroundColor;
  Material *selectIcon;
  Material *backgroundItemListbox;
  Material *highlightTexture;
  int noBlinkingHighlight;
  MenuRow *rows;
  int maxRows;
  int rowCount;
};
 
struct multiDef_s
{
  const char *dvarList[32];
  const char *dvarStr[32];
  float dvarValue[32];
  int count;
  int actionOnEnterPressOnly;
  int strDef;
};
 
struct profileMultiDef_s
{
  const char *profileVarList[32];
  const char *profileVarStr[32];
  float profileVarValue[32];
  int count;
  int actionOnEnterPressOnly;
  int strDef;
};
 
struct editFieldDef_s
{
  int cursorPos[1];
  float minVal;
  float maxVal;
  float defVal;
  float range;
  int maxChars;
  int maxCharsGotoNext;
  int maxPaintChars;
  int paintOffset;
};
 
struct enumDvarDef_s
{
  const char *enumDvarName;
};
 
union focusDefData_t
{
  listBoxDef_s *listBox;
  multiDef_s *multi;
  profileMultiDef_s *profileMulti;
  editFieldDef_s *editField;
  enumDvarDef_s *enumDvar;
  void *data;
};
 
struct focusItemDef_s
{
  const char *mouseEnterText;
  const char *mouseExitText;
  const char *mouseEnter;
  const char *mouseExit;
  ItemKeyHandler *onKey;
  focusDefData_t focusTypeData;
};
 
struct gameMsgDef_s
{
  int gameMsgWindowIndex;
  int gameMsgWindowMode;
};
 
union textDefData_t
{
  focusItemDef_s *focusItemDef;	// 3,4,5,7,8,9,10,11,12,13,14,16,20,21,22,30
  gameMsgDef_s *gameMsgDef;	// 15
  void *data;
};
 
struct textDef_s
{
#ifndef PC			//Note: PC only has 1 cursor, but consoles can have 4 controllers connected
  rectDef_s textRect[4];
#else
  rectDef_s textRect[1];
#endif
  int alignment;
  int fontEnum;
  int itemFlags;
  int textAlignMode;
  float textalignx;
  float textaligny;
  float textscale;
  float textpadding;
  int textStyle;
  vec4_t fontColor;
  vec4_t glowColor;
  vec4_t shadowColor;
  float fontBlur;
  float glowSize;
  float shadowSize;
  vec2_t shadowOffset;
  const char *text;
  textExp_s *textExpData;
  textDefData_t textTypeData;
};
 
struct imageDef_s
{
  ExpressionStatement materialExp;
};
 
struct ownerDrawDef_s
{
  ExpressionStatement dataExp;
};
 
union itemData_t
{
  textDef_s *textDef;	// 1,3,4,5,7,8,9,10,11,12,13,14,15,16,18,20,22
  imageDef_s *imageDef;		// 2
  ownerDrawDef_s *ownerDrawDef;	// 6
  focusItemDef_s *blankButtonDef;		// 19, 21
  void *data;
};
 
/* 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
{
  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 ownerDrawFlags;
  float borderSize;
  int staticFlags;
  int dynamicFlags[1];
  int nextTime;
  vec4_t foreColor;
  vec4_t backColor;
  vec4_t borderColor;
  vec4_t outlineColor;
  float rotation;
  Material *background;
};
 
struct animParamsDef_t
{
  const char *name;
  rectDef_s rectClient;
  float borderSize;
  vec4_t foreColor;
  vec4_t backColor;
  vec4_t borderColor;
  vec4_t outlineColor;
  float textScale;
  float rotation;
  GenericEventHandler *onEvent;
};
 
struct UIAnimInfo
{
  int animStateCount;
  animParamsDef_t **animStates;
  animParamsDef_t currentAnimState;
  animParamsDef_t nextAnimState;
  int animating;
  int animStartTime;
  int animDuration;
};
 
struct itemDef_t
{
  windowDef_t window;
  int type;
  int dataType;
  int imageTrack;
  const char *dvar;
  const char *profileVar;
  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 forecolorAExp;
  int ui3dWindowId;
  GenericEventHandler *onEvent;
  UIAnimInfo *animInfo;
};
 
struct menuDef_t
{
  windowDef_t window;
  const char *font;
  int fullScreen;
  int ui3dWindowId;
  int itemCount;
  int fontIndex;
#ifndef PC			//Note: PC only has 1 cursor, but consoles can have 4 controllers connected
  int cursorItem[4];
#else
  int cursorItem[1];
#endif
  int fadeCycle;
  int priority;
  float fadeClamp;
  float fadeAmount;
  float fadeInAmount;
  float blurRadius;
  int openSlideSpeed;
  int closeSlideSpeed;
  int openSlideDirection;
  int closeSlideDirection;
  rectDef_s initialRectInfo;
  int openFadingTime;
  int closeFadingTime;
  int fadeTimeCounter;
  int slideTimeCounter;
  GenericEventHandler *onEvent;
  ItemKeyHandler *onKey;
  ExpressionStatement visibleExp;
  unsigned __int64 showBits;
  unsigned __int64 hideBits;
  const char *allowedBinding;
  const char *soundName;
  int imageTrack;
  int control;
  vec4_t focusColor;
  vec4_t disableColor;
  ExpressionStatement rectXExp;
  ExpressionStatement rectYExp;
  itemDef_s **items;
	int unknown5;
};