Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
83a8012
feat: IW3 menu dumping
michaeloliverx Jul 16, 2026
186caa9
fix: IW3 menu dumper preserve menu ownerdraw flag masks
michaeloliverx Jul 16, 2026
319b071
fix: IW3 menu dumper preserve numeric script arguments
michaeloliverx Jul 16, 2026
a053734
fix: IW3 menu dumper preserve empty item text
michaeloliverx Jul 16, 2026
f14d77f
test: cover IW3 menu dumper material case
michaeloliverx Jul 16, 2026
28cb492
test: cover IW3 menu list path precedence
michaeloliverx Jul 16, 2026
669c43b
chore: clang format
michaeloliverx Jul 16, 2026
0177bab
fix: reverse order of union to avoid edge case bug in zcg
michaeloliverx Jul 18, 2026
823ec18
feat: IW3 menu loading
michaeloliverx Aug 3, 2026
2f6a453
fix: validate menu expression name table
michaeloliverx Aug 22, 2026
b00c4df
chore: explain numeric token quoting in comment
michaeloliverx Aug 22, 2026
86e5148
refactor: simplify menu dump fallback path
michaeloliverx Aug 22, 2026
4dafc53
chore: add more dynamic window flags
Laupetin Aug 22, 2026
fafe179
refactor: reuse IW3 menu window flag constants
michaeloliverx Aug 28, 2026
f792acf
refactor: use explicit menu item feature lookup
michaeloliverx Aug 28, 2026
c9ca2b1
refactor: represent menu item text as optional
michaeloliverx Aug 28, 2026
8ef51a6
refactor: clarify shared IW3 and IW4 menu constants
michaeloliverx Aug 28, 2026
e62e5fa
refactor: clarify IW3 menu zone state naming
michaeloliverx Aug 28, 2026
3b74584
fix: log IW3 menu conversion failures
michaeloliverx Aug 28, 2026
0cb8901
refactor: align IW3 menu list loader with IW4
michaeloliverx Aug 28, 2026
e39d5f3
refactor: align IW3 menu dumpers with IW4
michaeloliverx Aug 28, 2026
9c3838a
refactor: align IW3 menu converter with IW4
michaeloliverx Aug 28, 2026
c82ffa0
chore: use default enum numeration for operationEnum
Laupetin Aug 29, 2026
1a27ec3
chore: small optimization on edit field capability initialization
Laupetin Aug 29, 2026
4af914d
fix: iw3 menu optimizations for rect not considering relative positio…
Laupetin Aug 29, 2026
9543fdb
chore: align iw3 menu converting closer to iw4
Laupetin Aug 29, 2026
45d5acb
chore: align iw3 menu dumping closer to iw4
Laupetin Aug 30, 2026
5afa38b
fix: not dumping menu flags properties correctly
Laupetin Aug 30, 2026
4627be1
chore: adjust iw3 expression dumping to work similar to iw4
Laupetin Aug 30, 2026
df3ccc0
chore: adjust iw3 expression converting to work similar to iw4
Laupetin Aug 30, 2026
40ab06b
chore: use unordered_map for MenuExpressionMatchers
Laupetin Aug 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/SupportedAssetTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ using `Linker`):
| GfxWorld | ❌ | ❌ | |
| GfxLightDef | ✅ | ✅ | |
| Font_s | ✅ | ✅ | |
| MenuList | ❌ | ❌ | |
| menuDef_t | ❌ | ❌ | |
| MenuList | ✅ | ✅ | The output is decompiled. The result will not be the same as the input. |
| menuDef_t | ✅ | ✅ | See menulist. |
| LocalizeEntry | ✅ | ✅ | |
| WeaponDef | ✅ | ✅ | |
| FxEffectDef | ❌ | ❌ | |
Expand Down
139 changes: 134 additions & 5 deletions src/Common/Game/IW3/IW3_Assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -2513,6 +2513,37 @@ namespace IW3
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_1 = 0x1,
WINDOW_FLAG_FOCUSED = 0x2,
WINDOW_FLAG_VISIBLE = 0x4,
WINDOW_FLAG_FADING_OUT = 0x10,
WINDOW_FLAG_FADING_IN = 0x20,
WINDOW_FLAG_HOVERED = 0x40,
WINDOW_FLAG_LISTBOX_HOVER_100 = 0x100,
WINDOW_FLAG_LISTBOX_HOVER_200 = 0x200,
WINDOW_FLAG_LISTBOX_HOVER_400 = 0x400,
WINDOW_FLAG_LISTBOX_HOVER_800 = 0x800,
WINDOW_FLAG_LISTBOX_HOVER_1000 = 0x1000,
WINDOW_FLAG_4000 = 0x4000,
WINDOW_FLAG_NON_DEFAULT_BACKCOLOR = 0x8000,
WINDOW_FLAG_NON_DEFAULT_FORECOLOR = 0x10000,
};

struct windowDef_t
{
const char* name;
Expand All @@ -2522,10 +2553,10 @@ namespace IW3
int style;
int border;
int ownerDraw;
int ownerDrawFlags;
unsigned int ownerDrawFlags;
float borderSize;
int staticFlags;
int dynamicFlags[1];
unsigned int staticFlags;
unsigned int dynamicFlags[1];
int nextTime;
float foreColor[4];
float backColor[4];
Expand Down Expand Up @@ -2561,10 +2592,99 @@ namespace IW3
operandInternalDataUnion internals;
};

enum operationEnum : int
{
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_ISINTERMISSION,

NUM_OPERATORS,
};

union entryInternalData
{
Operand operand;
int op;
operationEnum op;
};

enum expressionEntryType : int
Expand Down Expand Up @@ -2604,7 +2724,7 @@ namespace IW3
int elementStyle;
int numColumns;
columnInfo_s columnInfo[16];
const char* doubleClick;
const char* onDoubleClick;
int notselectable;
int noScrollBars;
int usePaging;
Expand Down Expand Up @@ -2667,6 +2787,15 @@ namespace IW3
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;
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Game/IW4/IW4_Assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -2313,7 +2313,7 @@ namespace IW4
int style;
int border;
int ownerDraw;
int ownerDrawFlags;
unsigned int ownerDrawFlags;
float borderSize;
int staticFlags;
unsigned int dynamicFlags[1];
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Game/IW5/IW5_Assets.h
Original file line number Diff line number Diff line change
Expand Up @@ -3233,7 +3233,7 @@ namespace IW5
int style;
int border;
int ownerDraw;
int ownerDrawFlags;
unsigned int ownerDrawFlags;
float borderSize;
int staticFlags;
int dynamicFlags[1];
Expand Down
94 changes: 94 additions & 0 deletions src/ObjCommon/Game/IW3/MenuConstantsIW3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#pragma once

#include "Game/IW3/IW3.h"

#include <type_traits>

namespace IW3
{
inline constexpr const char* g_expFunctionNames[]{
"NOOP",
")",
"*",
"/",
"%",
"+",
"-",
"!",
"<",
"<=",
">",
">=",
"==",
"!=",
"&&",
"||",
"(",
",",
"&",
"|",
"~",
"<<",
">>",
"sin",
"cos",
"min",
"max",
"milliseconds",
"dvarint",
"dvarbool",
"dvarfloat",
"dvarstring",
"stat",
"ui_active",
"flashbanged",
"scoped",
"scoreboard_visible",
"inkillcam",
"player",
"selecting_location",
"team",
"otherteam",
"marinesfield",
"opforfield",
"menuisopen",
"writingdata",
"inlobby",
"inprivateparty",
"privatepartyhost",
"privatepartyhostinlobby",
"aloneinparty",
"adsjavelin",
"weaplockblink",
"weapattacktop",
"weapattackdirect",
"secondsastime",
"tablelookup",
"locstring",
"localvarint",
"localvarbool",
"localvarfloat",
"localvarstring",
"timeleft",
"secondsascountdown",
"gamemsgwndactive",
"int",
"string",
"float",
"gametypename",
"gametype",
"gametypedescription",
"scoreatrank",
"friendsonline",
"spectatingclient",
"statrangeanybitsset",
"keybinding",
"actionslotusable",
"hudfade",
"maxrecommendedplayers",
"acceptinginvite",
"isintermission",
};

static_assert(std::extent_v<decltype(g_expFunctionNames)> == static_cast<unsigned>(NUM_OPERATORS));
} // namespace IW3
Loading
Loading