Commit Graph
45 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
moandJan Laupetin 0c66d1838e feat: T4 add StringTable loader (#934)
* feat: T4 add string table loader

* chore: rename stringtable loaders to match style between games

* fix: make sure all games correctly interpret failed stringtable loading

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-26 00:40:02 +02:00
moandJan Laupetin 76e5bb17a2 feat: templated vehicle loading and dumping for IW4 and IW5 (#929)
* feat: templated vehicle loading and dumping for IW4 and IW5

* chore: restructure vehicle tests into separate files

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-26 00:28:44 +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 04b6b5b4bf refactor: physpreset codestyle (#928)
* chore: adjust phys preset code to use similar code style

* fix: infinity friction for t6

* fix: t6 phys preset canFloat qboolean

* chore: move iw5 phys preset enum strings to enum strings header

* chore: add phys preset tests for all games

* chore: rename PhysPresetFields headers
2026-07-22 21:08:36 +02:00
Jan Laupetin fadcd74182 fix: menu rect optimization not setting global values (#920)
* fix: menu rect optimization not setting global values

* fix: relative item rects not considering optimized parent rect
2026-07-20 19:24:58 +02:00
Jan Laupetin aa47ffa629 refactor: introduce subasset loading 2026-02-05 18:17:15 +01:00
Jan Laupetin b6598c5af3 chore: move string table tests 2026-01-05 09:50:22 +00:00
Jan Laupetin c4a5856bfa chore: add tests for templated image loader 2026-01-05 09:50:21 +00:00
Jan Laupetin 94cc12f4af fix: add platform to test code 2025-10-27 21:01:04 +01:00
Jan Laupetin 734173066b refactor: only refer to game id in zone 2025-08-31 18:00:27 +01:00
Jan Laupetin 46fb919a52 refactor: do not nest asset namespaces in game namespaces
* Duplicated namespace names are kind of annoying
2025-08-06 00:50:35 +02:00
Jan Laupetin 95a6a028ab refactor: streamline IW3 asset loading 2025-08-05 01:22:39 +02:00
Jan Laupetin 6806337f46 refactor: streamline IW4 asset loading 2025-08-05 01:14:20 +02:00
Jan Laupetin 81a67151b5 refactor: streamline IW5 asset loading 2025-08-05 01:14:19 +02:00
Jan Laupetin b5c9567389 refactor: streamline T5 asset loading 2025-08-05 01:14:19 +02:00
Jan Laupetin a5024d40b0 refactor: streamline T6 asset loading 2025-08-05 01:14:19 +02:00
Jan Laupetin bca5fd3f1a chore: add tests for font icon json writing and loading 2025-07-23 22:52:26 +01:00
Jan Laupetin 75c7949d3f chore: remove unused t6 material property probeMipBits 2025-07-08 19:12:26 +02:00
Jan Laupetin 790729f5e0 chore: remove unused t5 material property maxStreamedMips 2025-07-08 19:08:46 +02:00
Jan Laupetin 238ac293ab chore: add tests for t5 material dumping and loading 2025-07-06 15:56:12 +02:00
Jan 31d7ac26fe chore: remove hashIndex from t6 json material as it is always 0 2025-07-05 13:27:49 +02:00
Jan 65c8cd6198 feat: add json material loading/writing for iw3 2025-07-05 13:27:49 +02:00
Jan 116f008f90 chore: add tests for material loading for iw4,iw5,t6 2025-06-28 23:24:12 +01:00
Jan 8b85cadb77 refactor: make memory from zone a reference instead of ptr 2025-05-02 22:08:06 +01:00
Jan 0fbfb860c0 fix: ignoring last element in t6 stringtable cell index sorting 2025-04-23 07:44:43 +02:00
Jan 4c09e94220 refactor: remove MemoryManager create method usages 2025-01-13 22:03:20 +00:00
Jan fa6f9451d2 chore: extract ZoneAssetLoaderContainer to separate class 2025-01-03 10:25:51 +01:00
Jan aa212e0958 chore: parse includes and assetlists while parsing zone definition 2025-01-01 18:14:43 +01:00
Jan 692c31b711 chore: fix test compilation 2025-01-01 18:14:42 +01:00
Jan 9ebea5034a chore: generalize default asset creators 2025-01-01 18:14:40 +01:00
Jan b00c65c8c0 refactor: get rid of global game variables 2024-10-19 22:09:26 +02:00
Jan 5cc52c42cd refactor: image and obj data loading 2024-09-26 07:22:35 +02:00
Jan ada3a3251e test: add unit tests for string table asset loaders 2024-01-20 20:03:59 +01:00
Clang Format 6b4f5d94a8 Reformat code with clang format 2023-11-19 21:07:21 +00:00
Jan 1a1e1f9815 Change menu unit tests to account for discoveries and fixes of menu parser 2023-09-26 23:14:47 +02:00
Jan 6c164eee61 Update catch2 version 2023-06-18 13:40:30 +02: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 2df12e101e Disable static value evaluation for visible expression when optimizations are turned off 2022-01-01 16:59:27 +01:00
Jan 7ea53808b7 Extend menu IT with materials 2021-12-27 11:27:59 +01:00
Jan 4ed8016110 Add eventhandlersets to menu parsing integration tests 2021-12-12 14:03:23 +01:00
Jan a0200a9dbb Test certain properties with menu parsing integration test 2021-12-11 22:55:40 +01:00
Jan c683c210f5 Add base for menu parsing integration tests 2021-12-11 21:40:13 +01:00