CScriptHUDMemo: Brace conditionals where applicable

This commit is contained in:
Lioncash 2020-05-07 13:06:47 -04:00
parent beb7884b54
commit 34d989c443
1 changed files with 9 additions and 6 deletions

View File

@ -12,8 +12,9 @@ namespace urde {
CScriptHUDMemo::CScriptHUDMemo(TUniqueId uid, std::string_view name, const CEntityInfo& info, CScriptHUDMemo::CScriptHUDMemo(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const CHUDMemoParms& parms, EDisplayType disp, CAssetId msg, bool active) const CHUDMemoParms& parms, EDisplayType disp, CAssetId msg, bool active)
: CEntity(uid, info, active, name), x34_parms(parms), x3c_dispType(disp), x40_stringTableId(msg) { : CEntity(uid, info, active, name), x34_parms(parms), x3c_dispType(disp), x40_stringTableId(msg) {
if (msg.IsValid()) if (msg.IsValid()) {
x44_stringTable.emplace(g_SimplePool->GetObj({FOURCC('STRG'), msg})); x44_stringTable.emplace(g_SimplePool->GetObj({FOURCC('STRG'), msg}));
}
} }
void CScriptHUDMemo::Accept(IVisitor& visitor) { visitor.Visit(this); } void CScriptHUDMemo::Accept(IVisitor& visitor) { visitor.Visit(this); }
@ -21,17 +22,19 @@ void CScriptHUDMemo::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptHUDMemo::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) { void CScriptHUDMemo::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) {
if (msg == EScriptObjectMessage::SetToZero) { if (msg == EScriptObjectMessage::SetToZero) {
if (GetActive()) { if (GetActive()) {
if (x3c_dispType == EDisplayType::MessageBox) if (x3c_dispType == EDisplayType::MessageBox) {
mgr.ShowPausedHUDMemo(x40_stringTableId, x34_parms.GetDisplayTime()); mgr.ShowPausedHUDMemo(x40_stringTableId, x34_parms.GetDisplayTime());
else if (x3c_dispType == EDisplayType::StatusMessage) { } else if (x3c_dispType == EDisplayType::StatusMessage) {
if (x44_stringTable) if (x44_stringTable) {
MP1::CSamusHud::DisplayHudMemo((*x44_stringTable)->GetString(0), x34_parms); MP1::CSamusHud::DisplayHudMemo((*x44_stringTable)->GetString(0), x34_parms);
else } else {
MP1::CSamusHud::DisplayHudMemo(u"", x34_parms); MP1::CSamusHud::DisplayHudMemo(u"", x34_parms);
}
} }
} }
} else if (msg == EScriptObjectMessage::Deactivate && GetActive() && x3c_dispType == EDisplayType::StatusMessage) } else if (msg == EScriptObjectMessage::Deactivate && GetActive() && x3c_dispType == EDisplayType::StatusMessage) {
MP1::CSamusHud::DisplayHudMemo(u"", CHUDMemoParms(0.f, false, true, false)); MP1::CSamusHud::DisplayHudMemo(u"", CHUDMemoParms(0.f, false, true, false));
}
CEntity::AcceptScriptMsg(msg, uid, mgr); CEntity::AcceptScriptMsg(msg, uid, mgr);
} }