Commit Graph
23 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
moandJan Laupetin ae4f63eb2b fix(menu): accept numeric dvarStrList values (#947)
* fix(menu): accept numeric `dvarStrList` values

Convert numeric tokens to strings to match the game menu parser behaviour.

https://github.com/Laupetin/OpenAssetTools/issues/160

* chore: rename TextOrNumericNoChain to TextNoChainOrNumeric

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-08-05 19:08:02 +02:00
moandJan Laupetin 4421b94831 fix(menu): allow numeric dvar values (#927)
* fix(menu): allow numeric dvar values

* chore: use std format instead of stringstream

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-23 20:06:08 +02:00
Jan Laupetin 90d7f92ddd chore: replace all usages of removed ClassUtils macros 2026-03-06 00:13:04 +01:00
Jan 7820390dd8 Support static expressions for menu simple string properties 2023-12-25 22:59:56 +01:00
Jan 0b1120f26f Add menu base function as lowercase to the function map to enable case-insensitivity 2023-12-14 18:29:09 +01:00
Future b8b76adc73 fix(menus): make functions case insensitive 2023-12-10 21:33:02 +01:00
Clang Format c858695f0c Adjust further code formatting 2023-11-19 21:07:28 +00:00
Clang Format 6b4f5d94a8 Reformat code with clang format 2023-11-19 21:07:21 +00:00
Jan d071dc1bfd Make script numeric matchers match negative numbers as well 2023-09-25 21:45:06 +02:00
Jan 886bcfeaf8 Add non static evaluation for simple expressions 2022-08-13 14:13:11 +02:00
Jan 7188b0946d Make use of custom functions when converting menus 2021-12-28 23:52:42 +01:00
Jan d2262ebaec Fix menu dvarStrList not working because of String chaining 2021-12-28 11:49:42 +01:00
Jan 616c6414ff Add string chains to menu string properties 2021-12-02 22:39:12 +01:00
Jan fb70d9538a Make menu and item rect accept expressions as static values 2021-11-26 17:43:27 +01:00
Jan 2a4768e5b0 Add conditional operator to simple expressions 2021-11-26 17:39:46 +01:00
Jan c5475ce780 Fix unit tests failing for menu expressions 2021-11-25 00:24:36 +01:00
Jan 38f3d7d10e Move Menu Expression to Simple Namespace to have generic configurable expressions 2021-11-24 17:44:14 +01:00
Jan 4f2a8454a6 Move common expression classes to simple parsing setup 2021-11-22 21:47:05 +01:00
Jan ef1ad18332 Recognize script numeric and int values as strings 2021-11-20 12:01:04 +01:00
Jan 9a2e74d083 Add menu unary expression for minus 2021-11-14 20:04:36 +01:00
Jan 69c08def7f Add expression parsing for menu parser 2021-11-03 23:46:18 +01:00
Jan ab7b516918 Move MenuMatcherFactory to Matcher folder 2021-11-03 17:17:23 +01:00