metaforce/Runtime/GuiSys/CGuiSys.cpp

124 lines
4.9 KiB
C++
Raw Normal View History

2016-03-11 00:23:16 +00:00
#include "CGuiSys.hpp"
#include "CGuiWidget.hpp"
#include "CGuiHeadWidget.hpp"
#include "CGuiBackground.hpp"
#include "CGuiLight.hpp"
#include "CGuiCamera.hpp"
#include "CGuiGroup.hpp"
#include "CGuiStaticImage.hpp"
#include "CGuiPane.hpp"
#include "CAuiImagePane.hpp"
#include "CAuiMeter.hpp"
#include "CGuiModel.hpp"
#include "CGuiTableGroup.hpp"
#include "CGuiSliderGroup.hpp"
#include "CGuiTextPane.hpp"
#include "CAuiEnergyBarT01.hpp"
2016-03-11 00:23:16 +00:00
namespace urde
{
void CGuiSys::AddFactories(EUsageMode /* mode */)
{
x8_factoryMgr.m_factories.clear();
}
void CGuiSys::LoadWidgetFunctions()
{
}
2016-03-14 00:58:19 +00:00
CGuiWidget* CGuiSys::CreateWidgetInGame(FourCC type, CInputStream& in, CGuiFrame* frame)
{
switch (type)
{
case SBIG('BWIG'):
return CGuiWidget::Create(frame, in, false);
case SBIG('HWIG'):
return CGuiHeadWidget::Create(frame, in, false);
case SBIG('BGND'):
return CGuiBackground::Create(frame, in, false);
case SBIG('LITE'):
return CGuiLight::Create(frame, in, false);
case SBIG('CAMR'):
return CGuiCamera::Create(frame, in, false);
case SBIG('GRUP'):
return CGuiGroup::Create(frame, in, false);
case SBIG('IMAG'):
return CGuiStaticImage::Create(frame, in, false);
case SBIG('PANE'):
return CGuiPane::Create(frame, in, false);
case SBIG('IMGP'):
return CAuiImagePane::Create(frame, in, false);
case SBIG('METR'):
return CAuiMeter::Create(frame, in, false);
case SBIG('MODL'):
return CGuiModel::Create(frame, in, false);
case SBIG('TBGP'):
return CGuiTableGroup::Create(frame, in, false);
case SBIG('SLGP'):
return CGuiSliderGroup::Create(frame, in, false);
case SBIG('TXPN'):
return CGuiTextPane::Create(frame, in, false);
case SBIG('ENRG'):
return CAuiEnergyBarT01::Create(frame, in, false);
default: break;
}
return nullptr;
}
2016-03-11 00:23:16 +00:00
CGuiSys::CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode)
: x0_resFactory(resFactory), x4_resStore(resStore), x2c_mode(mode),
x38_frameFactoryParams(new TObjOwnerParam<CGuiResFrameData>(CGuiResFrameData(*this))),
x40_constructTime(std::chrono::steady_clock::now())
{
AddFactories(mode);
LoadWidgetFunctions();
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::DPadUpInst,
CGuiAutoRepeatData(EPhysicalControllerID::DPadUpInst, EPhysicalControllerID::DPadUp)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::DPadRightInst,
CGuiAutoRepeatData(EPhysicalControllerID::DPadRightInst, EPhysicalControllerID::DPadRight)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::DPadDownInst,
CGuiAutoRepeatData(EPhysicalControllerID::DPadDownInst, EPhysicalControllerID::DPadDown)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::DPadLeftInst,
CGuiAutoRepeatData(EPhysicalControllerID::DPadLeftInst, EPhysicalControllerID::DPadLeft)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftStickRightInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftStickRightInst, EPhysicalControllerID::LeftStickRight)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftStickDownInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftStickDownInst, EPhysicalControllerID::LeftStickDown)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftStickLeftInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftStickLeftInst, EPhysicalControllerID::LeftStickLeft)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::RightStickUpInst,
CGuiAutoRepeatData(EPhysicalControllerID::RightStickUpInst, EPhysicalControllerID::RightStickUp)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::RightStickRightInst,
CGuiAutoRepeatData(EPhysicalControllerID::RightStickRightInst, EPhysicalControllerID::RightStickRight)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::RightStickDownInst,
CGuiAutoRepeatData(EPhysicalControllerID::RightStickDownInst, EPhysicalControllerID::RightStickDown)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::RightStickLeftInst,
CGuiAutoRepeatData(EPhysicalControllerID::RightStickLeftInst, EPhysicalControllerID::RightStickLeft)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftUpInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftUpInst, EPhysicalControllerID::LeftUp)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftRightInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftRightInst, EPhysicalControllerID::LeftRight)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftDownInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftDownInst, EPhysicalControllerID::LeftDown)));
2016-03-11 00:23:16 +00:00
2016-03-14 23:32:44 +00:00
x18_repeatMap.emplace(std::make_pair(EPhysicalControllerID::LeftLeftInst,
CGuiAutoRepeatData(EPhysicalControllerID::LeftLeftInst, EPhysicalControllerID::LeftLeft)));
2016-03-11 00:23:16 +00:00
}
}