2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 21:11:21 +00:00
metaforce/Runtime/World/CScriptHUDMemo.cpp
Lioncash 221cc5c6b8 RuntimeCommonB: Normalize cpp file includes
Like the prior changes normalizing the inclusions within headers, this
tackles the cpp files of the RuntimeCommonB target, making these source
files consistent with their headers.
2019-12-22 18:12:04 -05:00

40 lines
1.5 KiB
C++

#include "Runtime/World/CScriptHUDMemo.hpp"
#include "Runtime/CSimplePool.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/GuiSys/CStringTable.hpp"
#include "Runtime/MP1/CSamusHud.hpp"
#include "TCastTo.hpp" // Generated file, do not modify include path
namespace urde {
CScriptHUDMemo::CScriptHUDMemo(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const CHUDMemoParms& parms, EDisplayType disp, CAssetId msg, bool active)
: CEntity(uid, info, active, name), x34_parms(parms), x3c_dispType(disp), x40_stringTableId(msg) {
if (msg.IsValid())
x44_stringTable.emplace(g_SimplePool->GetObj({FOURCC('STRG'), msg}));
}
void CScriptHUDMemo::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptHUDMemo::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
if (msg == EScriptObjectMessage::SetToZero) {
if (GetActive()) {
if (x3c_dispType == EDisplayType::MessageBox)
mgr.ShowPausedHUDMemo(x40_stringTableId, x34_parms.GetDisplayTime());
else if (x3c_dispType == EDisplayType::StatusMessage) {
if (x44_stringTable)
MP1::CSamusHud::DisplayHudMemo((*x44_stringTable)->GetString(0), x34_parms);
else
MP1::CSamusHud::DisplayHudMemo(u"", x34_parms);
}
}
} else if (msg == EScriptObjectMessage::Deactivate && GetActive() && x3c_dispType == EDisplayType::StatusMessage)
MP1::CSamusHud::DisplayHudMemo(u"", CHUDMemoParms(0.f, false, true, false));
CEntity::AcceptScriptMsg(msg, uid, mgr);
}
} // namespace urde