Commit Graph
37 Commits
Author SHA1 Message Date
moandJan Laupetin 4da55a351a feat: add T4 menu dumping and loading (#986)
* feat: add T4 menu dumping

* chore: align with latest changes

* feat: add T4 menu loading

Load T4 menulists and menu files through the shared menu parser.

Preserve T4-specific menu and listbox fields and cover loading, dumping, linking, and round-trip behaviour.

* chore: make flag fields unsigned

* chore: rename `expOperationEnum` -> `operationEnum`

* chore: use default enum numeration for T4 operationEnum

* chore: remove unused members of operationEnum

* chore: remove redundant op from operationEnum

* refactor: align T4 expression operand names with IW3

* chore: small adjustment to iw3,t4 types

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-03 23:19:03 +02:00
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 f99726d62f fix(menu): allow IW4 columns without alignment (#932)
* fix(menu): allow IW4 columns without alignment

* feat: also make alignment optional for iw5 menus

* chore: move menu sequences to anonymous namespace if possible

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-26 23:02:13 +02:00
Jan Laupetin 90d7f92ddd chore: replace all usages of removed ClassUtils macros 2026-03-06 00:13:04 +01:00
Jan 69cd172879 Accept setLocalVar scripts without value as default value expression 2023-12-25 09:50:24 +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 1e6824368c Fix bugs related to parsing IW5 base game menus 2023-09-26 22:27:32 +02:00
Jan 486d704ce6 Add MP only IW5 UiScripts 2023-09-26 20:59:55 +02:00
Jan 13dfbc9bbb Add IW5 specific uiscripts 2023-09-25 22:55:00 +02:00
Jan 4ff8b3396e Implement the rest of IW5 menu event handler sequences 2023-09-25 21:54:27 +02:00
Jan d071dc1bfd Make script numeric matchers match negative numbers as well 2023-09-25 21:45:06 +02:00
Jan 870fa44b02 Add existing iw5 script statements 2023-09-24 22:48:11 +02:00
Jan 0b92b9b871 Fix setLocalVar not correctly flushing script when not setting static var 2023-09-24 11:46:39 +02:00
Jan 502e134ed8 Fix not properly handling concurrent strings in permissive menu loading mode 2023-09-23 19:04:15 +02:00
Jan 886bcfeaf8 Add non static evaluation for simple expressions 2022-08-13 14:13:11 +02:00
Jan 91cfb2e8dd Move AbstractScopeSequenceHolder to Parse and make it a template class to be reusable 2022-01-18 22:55:25 +01:00
Jan d8b1f58b40 Accept any character on menu permissive mode 2021-12-29 02:52:13 +01:00
Jan 7188b0946d Make use of custom functions when converting menus 2021-12-28 23:52:42 +01:00
Jan f0edfc5939 Fix IW4x menu script arguments 2021-12-28 18:04:32 +01:00
Jan 30bc876ee4 Add menu iw4x uiscripts 2021-12-28 15:31:56 +01:00
Jan 80a0fba606 Parse menu event handler setplayerdata 2021-12-28 14:17:02 +01:00
Jan 9c5c34b0c8 Leave away unnecessary trailing zeros in script numeric values for menus 2021-12-12 16:23:58 +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 fb70d9538a Make menu and item rect accept expressions as static values 2021-11-26 17:43:27 +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 0ffa85d557 Fix event handler set not clearing current script correctly 2021-11-20 22:01:21 +01:00
Jan ef1ad18332 Recognize script numeric and int values as strings 2021-11-20 12:01:04 +01:00
Jan 109955b8f2 Add unit tests for most eventhandlerset script sequences 2021-11-14 18:17:13 +01:00
Jan 252dee03ba Fix menu EventHandlerSetSequences if parsing behaviour based on unit tests 2021-11-14 14:04:17 +01:00
Jan 13589fd43c Add menu eventhandlerset sequences for if, elseif and else 2021-11-14 12:46:02 +01:00
Jan b1e5fc70a6 Add Menu EventHandler parser for lerp 2021-11-13 22:18:08 +01:00
Jan 7025fca81c Add simple script parsing for menus 2021-11-07 00:45:39 +01:00
Jan 81203e523e Handle condition stack on event handler closing parenthesis 2021-11-06 19:30:36 +01:00
Jan 54d7f75af6 Close EventHandlerSetBlock again 2021-11-06 18:08:58 +01:00
Jan bf19208351 Add base for menu eventhandlerset parsing 2021-11-06 16:28:24 +01:00