chore: align iw3,iw4,iw5 menu code (#987)

* chore: small adjustments to iw3 menu dumper

* chore: align iw4 menu loader closer to iw3

* chore: align iw4 menu dumper closer to iw3

* chore: adjust iw4 menu expression dumping

* chore: adjust iw4 menu expression converting

* chore: align iw5 menu loader closer to iw3

* chore: align iw4 menu dumper closer to iw3

* chore: adjust iw5 menu expression dumping

* chore: adjust iw5 menu expression converting

* fix: not respecting reference menus when inlining menu list menus

* fix: compilation on linux
This commit is contained in:
Jan Laupetin
2026-08-31 22:10:37 +02:00
committed by GitHub
parent 51770e7ae5
commit 662780a896
24 changed files with 1331 additions and 1427 deletions
@@ -3,26 +3,15 @@
#include "Asset/IZoneAssetCreationState.h"
#include "Game/IW5/IW5.h"
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
namespace IW5
{
class MenuConversionZoneState final : public IZoneAssetCreationState
{
Zone* m_zone;
std::vector<Statement_s*> m_functions;
std::map<std::string, Statement_s*> m_function_by_name;
std::vector<StaticDvar*> m_static_dvars;
std::map<std::string, size_t> m_dvars_by_name;
std::vector<const char*> m_strings;
std::map<std::string, const char*> m_strings_by_value;
public:
std::map<std::string, std::vector<XAssetInfo<menuDef_t>*>> m_menus_by_filename;
ExpressionSupportingData* m_supporting_data;
MenuConversionZoneState();
void Inject(ZoneAssetCreationInjection& inject) override;
@@ -35,5 +24,19 @@ namespace IW5
void AddLoadedFile(std::string loadedFileName, std::vector<XAssetInfo<menuDef_t>*> menusOfFile);
void FinalizeSupportingData() const;
std::unordered_map<std::string, std::vector<XAssetInfo<menuDef_t>*>> m_menus_by_filename;
ExpressionSupportingData* m_supporting_data;
private:
Zone* m_zone;
std::vector<Statement_s*> m_functions;
std::unordered_map<std::string, Statement_s*> m_function_by_name;
std::vector<StaticDvar*> m_static_dvars;
std::unordered_map<std::string, size_t> m_dvars_by_name;
std::vector<const char*> m_strings;
std::unordered_map<std::string, const char*> m_strings_by_value;
};
} // namespace IW5