Commit Graph
115 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 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
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
mo 9c56a28ef4 fix: apply menu item origin as an offset (#917)
Add `origin` values to the existing item rectangle instead of replacing its coordinates.
2026-07-19 21:32:10 +02:00
mo 0c1efa1667 fix: assign ownerdraw item type when parsing menus (#911)
Set `m_type` to `ITEM_TYPE_OWNERDRAW` when parsing an `ownerdraw` property. Otherwise, it retains the default `ITEM_TYPE_TEXT`.

This restores controls such as the Source button in the IW4x server browser.
2026-07-17 18:26:50 +02:00
Jan Laupetin 90d7f92ddd chore: replace all usages of removed ClassUtils macros 2026-03-06 00:13:04 +01:00
Jan Laupetin 02f20f09b6 chore: update all logging to use centralized logging component 2025-09-11 20:25:51 +02:00
Jan 416823c6cd chore: rename ZoneAssetLoaderState to ZoneAssetCreationState 2025-01-03 11:01:44 +01: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 9852f52a15 chore: get rid of now unused AssetLoading classes 2025-01-01 18:14:43 +01:00
Jan af01bac183 fix: linux gcc 14 build 2024-08-13 00:01:00 +02:00
Jan 132cccb971 refactor: use new line character instead of std::endl 2024-03-24 20:24:22 +01:00
Jan 7820390dd8 Support static expressions for menu simple string properties 2023-12-25 22:59:56 +01:00
Jan f5c987ce59 Add unit tests for menu item rect 2023-12-25 19:52:05 +01:00
Jan 7fff36dab2 Accept expressions as part of the column sequence 2023-12-25 11:34:49 +01:00
Jan 69cd172879 Accept setLocalVar scripts without value as default value expression 2023-12-25 09:50:24 +01:00
Jan 82f3d4925f Fix not respecting case-insensitive functions when converting menus 2023-12-14 19:32:51 +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
Jan 00c866c246 Fix custom menu function not being compared case-insensitive 2023-12-14 18:22:02 +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
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 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 88bc1c1056 Fix SimpleLexer not being able to read escaped strings 2023-09-23 14:28:59 +02:00
Jan 4829a4206b Ensure correct expression type for static expressions in menu parsing but do not enforce when permissive 2023-08-24 20:12:57 +02: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 a092f76ec9 Add option to not parse floating point numbers when using SimpleLexer 2022-03-30 19:07:54 +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 8a3bbf948b Make sure you can specify event handlers more than once to be able to append script data 2022-01-01 20:00:09 +01:00
Jan 4b80ed1e9e Do not parse menus more than once when they have already been parsed 2022-01-01 16:39:28 +01:00
Jan b5475e30f0 Only load menu files once 2021-12-31 00:09:25 +01: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 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