iw4x-client/src/Components/Modules/AssetInterfaces/ImenuDef_t.hpp

46 lines
1.8 KiB
C++
Raw Normal View History

2017-02-25 14:55:04 -05:00
#pragma once
namespace Assets
{
class ImenuDef_t : public Components::AssetHandler::IAsset
2017-02-25 14:55:04 -05:00
{
public:
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_MENU; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
2017-02-25 15:11:17 -05:00
virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
virtual void load(Game::XAssetHeader* header, const std::string& name, Components::ZoneBuilder::Zone* builder) override;
static std::unordered_map<std::string, Game::menuDef_t*> LoadedMenus;
private:
template <typename T> void save_windowDef_t(Game::windowDef_t* asset, T* dest, Components::ZoneBuilder::Zone* builder)
{
Utils::Stream* buffer = builder->getBuffer();
if (asset->name)
{
buffer->saveString(asset->name);
Utils::Stream::ClearPointer(&dest->window.name);
}
if (asset->group)
{
buffer->saveString(asset->group);
Utils::Stream::ClearPointer(&dest->window.group);
}
if (asset->background)
{
dest->window.background = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_MATERIAL, asset->background).material;
}
}
void save_ExpressionSupportingData(Game::ExpressionSupportingData* asset, Components::ZoneBuilder::Zone* builder);
void save_Statement_s(Game::Statement_s* asset, Components::ZoneBuilder::Zone* builder);
void save_MenuEventHandlerSet(Game::MenuEventHandlerSet* asset, Components::ZoneBuilder::Zone* builder);
void save_ItemKeyHandler(Game::ItemKeyHandler* asset, Components::ZoneBuilder::Zone* builder);
2018-05-09 08:33:52 -04:00
void save_itemDefData_t(Game::itemDefData_t* asset, int type, Game::itemDef_s* dest, Components::ZoneBuilder::Zone* builder);
void save_itemDef_s(Game::itemDef_s *asset, Components::ZoneBuilder::Zone* builder);
2017-02-25 14:55:04 -05:00
};
}