Commit Graph
20 Commits
Author SHA1 Message Date
moandJan Laupetin 51770e7ae5 feat: IW3 menu dumping and loading (#909)
* feat: IW3 menu dumping

* fix: IW3 menu dumper preserve menu ownerdraw flag masks

* fix: IW3 menu dumper preserve numeric script arguments

Emit numeric tokens without quotes so the linker keeps colour arguments separate.

Before: `"0.1" "0.1" "0.12" "0.5"` becomes `"0.10.10.120.5"`
After: `0.1 0.1 0.12 0.5`

This fixes `mouseExit` colour commands failing to clear menu hover borders.

* fix: IW3 menu dumper preserve empty item text

Keep explicit empty text distinct from null text when dumping menu items.

This fixes CD-key values overflowing their input boxes.

* test: cover IW3 menu dumper material case

* test: cover IW3 menu list path precedence

* chore: clang format

* fix: reverse order of union to avoid edge case bug in zcg

* feat: IW3 menu loading

* fix: validate menu expression name table

* chore: explain numeric token quoting in comment

* refactor: simplify menu dump fallback path

* chore: add more dynamic window flags

* refactor: reuse IW3 menu window flag constants

* refactor: use explicit menu item feature lookup

* refactor: represent menu item text as optional

* refactor: clarify shared IW3 and IW4 menu constants

IW4 only extends the type enum so they can be shared

* refactor: clarify IW3 menu zone state naming

* fix: log IW3 menu conversion failures

* refactor: align IW3 menu list loader with IW4

* refactor: align IW3 menu dumpers with IW4

* refactor: align IW3 menu converter with IW4

* chore: use default enum numeration for operationEnum

* chore: small optimization on edit field capability initialization

* fix: iw3 menu optimizations for rect not considering relative position to parent

* chore: align iw3 menu converting closer to iw4

* chore: align iw3 menu dumping closer to iw4

* fix: not dumping menu flags properties correctly

* chore: adjust iw3 expression dumping to work similar to iw4

* chore: adjust iw3 expression converting to work similar to iw4

* chore: use unordered_map for MenuExpressionMatchers

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-08-31 00:04:01 +02:00
Jan Laupetin 02f20f09b6 chore: update all logging to use centralized logging component 2025-09-11 20:25:51 +02:00
Jan 9068e96dfa chore: make IZoneLoadingState return reference 2025-01-03 10:42:37 +01:00
Jan aa212e0958 chore: parse includes and assetlists while parsing zone definition 2025-01-01 18:14:43 +01:00
Jan 132cccb971 refactor: use new line character instead of std::endl 2024-03-24 20:24:22 +01:00
Clang Format 6b4f5d94a8 Reformat code with clang format 2023-11-19 21:07:21 +00:00
Jan 88bc1c1056 Fix SimpleLexer not being able to read escaped strings 2023-09-23 14:28:59 +02:00
Jan a092f76ec9 Add option to not parse floating point numbers when using SimpleLexer 2022-03-30 19:07:54 +02:00
Jan cc88fb0a5a Log menu parsing errors in stderr 2021-12-27 11:32:47 +01:00
Jan 8bf0126e38 Add hint for permissive mode when parsing fails within event handlerset 2021-11-28 18:03:27 +01:00
Jan b082e471e7 Add permissive mode for menu parsing that accepts unknown script tokens as long as they can be put into the script 2021-11-28 17:55:26 +01:00
Jan 38f3d7d10e Move Menu Expression to Simple Namespace to have generic configurable expressions 2021-11-24 17:44:14 +01:00
Jan 4552a4fe4a Add asset loading states per zone for the usecase of saving loaded menus and menu functions 2021-11-13 22:18:44 +01:00
Jan 69c08def7f Add expression parsing for menu parser 2021-11-03 23:46:18 +01:00
Jan c5d7d71a51 Add multicharacter tokens to simple lexer 2021-11-03 22:02:04 +01:00
Jan ff823b4722 Move menu parsing classes to menu namespace 2021-11-01 09:43:07 +01:00
Jan 68610e49f3 Add sourceFile parameter to MultiInput ParserStream 2021-10-31 17:45:55 +01:00
Jan ca1059b05c Add Menu Parsing Result 2021-10-31 17:33:46 +01:00
Jan e79376eb3e Add menu defines for feature levels 2021-10-31 16:45:49 +01:00
Jan bba55706bf Add basic parsing for menu lists with only loadMenus instructions 2021-10-31 15:37:46 +01:00