Commit Graph
38 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 90d7f92ddd chore: replace all usages of removed ClassUtils macros 2026-03-06 00:13:04 +01:00
Jan 0c4835bc36 Fix build due to reordered headers 2023-11-19 21:07:27 +00:00
Clang Format 6b4f5d94a8 Reformat code with clang format 2023-11-19 21:07:21 +00:00
Jan 8a1fe03358 Add base for IW5 menu parsing 2023-08-23 23:08:50 +02:00
Jan ccc020ca7e Make key handler map a multimap to be able to support multiple handlers for the same key 2023-08-23 23:07:55 +02:00
Jan db60287a7b Apply statemaps to materials 2022-08-20 19:23:49 +02:00
Jan 886bcfeaf8 Add non static evaluation for simple expressions 2022-08-13 14:13:11 +02:00
Jan 8e4b2bb057 Add non default forecolor flag if forecolor is not white 2021-12-29 18:08:38 +01:00
Jan f30bbd65da Initialize default values of menus via class level defaults 2021-12-29 13:50:45 +01:00
Jan 96ad97b784 Apply menu elements defaults 2021-12-29 09:02:40 +01:00
Jan 7188b0946d Make use of custom functions when converting menus 2021-12-28 23:52:42 +01:00
Jan 245a2ed642 Add equals operation to simpleexpressionvalue to check if an expression is the same as another one 2021-12-27 14:15:44 +01:00
Jan d4154d0cc2 Parse menu function values 2021-12-27 11:28:11 +01:00
Jan 988620e23d Menu conversion base 2021-12-05 16:23:25 +01:00
Jan 5b087e0d31 Add missing itemscope and menuscope sequences 2021-11-25 19:22:14 +01:00
Jan 4f2a8454a6 Move common expression classes to simple parsing setup 2021-11-22 21:47:05 +01:00
Jan 03b3981312 Add menu key handlers 2021-11-20 22:01:01 +01:00
Jan ebdfb5b9aa Parse feature specific item properties 2021-11-20 18:22:34 +01:00
Jan dd8a9bf374 Set item type features when setting type 2021-11-20 14:29:24 +01:00
Jan ed329e6453 Add item scope sequences for expressions and menueventhandlerset 2021-11-14 20:05:06 +01:00
Jan 9a2e74d083 Add menu unary expression for minus 2021-11-14 20:04:36 +01:00
Jan 0033ab2a2b Add base for menu parsing unit tests 2021-11-14 12:46:13 +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 7025fca81c Add simple script parsing for menus 2021-11-07 00:45:39 +01:00
Jan 5af2e6da61 Add menu scopes to state before closing them 2021-11-06 17:47:18 +01:00
Jan bf19208351 Add base for menu eventhandlerset parsing 2021-11-06 16:28:24 +01:00
Jan 321794a209 Parse Expression Properties for menuDefs 2021-11-04 22:47:49 +01:00
Jan 69c08def7f Add expression parsing for menu parser 2021-11-03 23:46:18 +01:00
Jan 0f017749c8 Add domain classes for menu expressions 2021-11-02 23:45:04 +01:00
Jan 84a9c5e701 Read multi token properties for items 2021-11-01 21:59:58 +01:00
Jan 4d868d9b6d Load menu item properties with common field types 2021-11-01 17:19:51 +01:00
Jan be4e489118 Add sequences for simple common menu properties 2021-11-01 13:30:12 +01:00
Jan 2aa0eb2a8c Add generic property matchers for menus 2021-11-01 12:28:40 +01:00
Jan 68945de51a Add menu matcher for fullscreen property 2021-11-01 10:25:15 +01:00
Jan ff823b4722 Move menu parsing classes to menu namespace 2021-11-01 09:43:07 +01:00
Jan ca1059b05c Add Menu Parsing Result 2021-10-31 17:33:46 +01:00
Jan bba55706bf Add basic parsing for menu lists with only loadMenus instructions 2021-10-31 15:37:46 +01:00