Finish CMessageScreen

This commit is contained in:
Jack Andersen 2017-05-31 11:26:50 -10:00
parent 6f84cfcb38
commit a550ce1959
32 changed files with 462 additions and 219 deletions

View File

@ -53,15 +53,37 @@ extern hecl::Database::DataSpecEntry SpecEntMP1;
extern hecl::Database::DataSpecEntry SpecEntMP1PC;
extern hecl::Database::DataSpecEntry SpecEntMP1ORIG;
static const std::unordered_set<uint32_t> IndividualOrigIDs =
{
0xB7BBD0B4,
0x1F9DA858,
0x2A13C23E,
0xF13452F8,
0xA91A7703,
0xC042EC91,
0x12A12131,
0x5F556002,
0xA9798329,
0xB306E26F,
0xCD7B1ACA,
0x8ADA8184,
0x1A29C0E6,
0x5D9F9796,
0x951546A8,
0x7946C4C5,
0x409AA72E,
};
struct OriginalIDs
{
static void Generate(PAKRouter<DNAMP1::PAKBridge>& pakRouter, hecl::Database::Project& project)
{
std::unordered_set<UniqueID32> addedIDs;
std::vector<UniqueID32> originalIDs;
pakRouter.enumerateResources([&](const DNAMP1::PAK::Entry* ent) -> bool {
if (ent->type == FOURCC('MLVL') || ent->type == FOURCC('SCAN') ||
ent->id.toUint32() == 0xB7BBD0B4 || ent->id.toUint32() == 0x1F9DA858)
IndividualOrigIDs.find(ent->id.toUint32()) != IndividualOrigIDs.end())
{
if (addedIDs.find(ent->id) == addedIDs.cend())
{

View File

@ -1101,28 +1101,28 @@ void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager
{
if (x78_areaHintDesc.IsLoaded())
{
x2fc_textpane_hint->TextSupport()->SetText(x78_areaHintDesc->GetString(0));
x304_textpane_instructions1->TextSupport()->SetText(u"");
x300_textpane_instructions->TextSupport()->SetText(u"");
x308_textpane_instructions2->TextSupport()->SetText(u"");
x2fc_textpane_hint->TextSupport().SetText(x78_areaHintDesc->GetString(0));
x304_textpane_instructions1->TextSupport().SetText(u"");
x300_textpane_instructions->TextSupport().SetText(u"");
x308_textpane_instructions2->TextSupport().SetText(u"");
}
else
{
x2fc_textpane_hint->TextSupport()->SetText(u"");
x2fc_textpane_hint->TextSupport().SetText(u"");
std::u16string str = hecl::UTF8ToChar16(
hecl::Format("&image=SI,0.6,1.0,%8.8X;", u32(g_tweakPlayerRes->x24_lStick[x2e4_lStickPos])));
str += g_MainStringTable->GetString(46); // Rotate
x300_textpane_instructions->TextSupport()->SetText(str);
x300_textpane_instructions->TextSupport().SetText(str);
str = hecl::UTF8ToChar16(
hecl::Format("&image=SI,0.6,1.0,%8.8X;", u32(g_tweakPlayerRes->x4c_cStick[x2e8_rStickPos])));
str += g_MainStringTable->GetString(47); // Move
x304_textpane_instructions1->TextSupport()->SetText(str);
x304_textpane_instructions1->TextSupport().SetText(str);
str = hecl::UTF8ToChar16(
hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x74_lTrigger[x2ec_lTriggerPos])));
str += g_MainStringTable->GetString(48); // Zoom
str += hecl::UTF8ToChar16(
hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x80_rTrigger[x2f0_rTriggerPos])));
x308_textpane_instructions2->TextSupport()->SetText(str);
x308_textpane_instructions2->TextSupport().SetText(str);
}
}
}
@ -1174,18 +1174,18 @@ void CAutoMapper::Update(float dt, const CStateManager& mgr)
if (!m_frmeInitialized && x28_frmeMapScreen.IsLoaded())
{
m_frmeInitialized = true;
static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_left"))->TextSupport()->
static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_left"))->TextSupport().
SetText(g_MainStringTable->GetString(42));
static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_yicon"))->TextSupport()->
static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_yicon"))->TextSupport().
SetText(g_MainStringTable->GetString(43));
x2fc_textpane_hint = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_hint"));
x300_textpane_instructions = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_instructions"));
x304_textpane_instructions1 = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_instructions1"));
x308_textpane_instructions2 = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_instructions2"));
CGuiTextPane* mapLegend = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_mapLegend"));
mapLegend->TextSupport()->ClearRenderBuffer();
mapLegend->TextSupport()->SetImageBaseline(true);
mapLegend->TextSupport()->SetText(g_MainStringTable->GetString(49));
mapLegend->TextSupport().ClearRenderBuffer();
mapLegend->TextSupport().SetImageBaseline(true);
mapLegend->TextSupport().SetText(g_MainStringTable->GetString(49));
x30c_basewidget_leftPane = x28_frmeMapScreen->FindWidget("basewidget_leftPane");
x310_basewidget_yButtonPane = x28_frmeMapScreen->FindWidget("basewidget_yButtonPane");
x314_basewidget_bottomPane = x28_frmeMapScreen->FindWidget("basewidget_bottomPane");
@ -1201,13 +1201,13 @@ void CAutoMapper::Update(float dt, const CStateManager& mgr)
if (x1bc_state == EAutoMapperState::MapScreenUniverse ||
(x1bc_state == EAutoMapperState::MapScreen && HasCurrentMapUniverseWorld()))
string = hecl::UTF8ToChar16(hecl::Format("image=%8.8X", u32(g_tweakPlayerRes->x98_aButton[x2f4_aButtonPos])));
right1->TextSupport()->SetText(string);
right1->TextSupport().SetText(string);
CGuiTextPane* right = static_cast<CGuiTextPane*>(x28_frmeMapScreen->FindWidget("textpane_right"));
if (x1bc_state == EAutoMapperState::MapScreenUniverse)
string = g_MainStringTable->GetString(45);
else if (x1bc_state == EAutoMapperState::MapScreen)
string = g_MainStringTable->GetString(44);
right->TextSupport()->SetText(string);
right->TextSupport().SetText(string);
}
float dt2 = 2.f * dt;
@ -1356,11 +1356,11 @@ void CAutoMapper::Update(float dt, const CStateManager& mgr)
if (x8c_mapAreaString)
{
if (x8c_mapAreaString.IsLoaded())
x2f8_textpane_areaname->TextSupport()->SetText(x8c_mapAreaString->GetString(0));
x2f8_textpane_areaname->TextSupport().SetText(x8c_mapAreaString->GetString(0));
}
else
{
x2f8_textpane_areaname->TextSupport()->SetText(u"");
x2f8_textpane_areaname->TextSupport().SetText(u"");
}
}

View File

@ -351,18 +351,64 @@ void CGameOptions::SetIsHintSystemEnabled(bool hints)
x68_28_hintSystem = hints;
}
void CGameOptions::SetControls(s32 controls)
void CGameOptions::SetControls(int controls)
{
if (controls == 0)
g_currentPlayerControl = g_tweakPlayerControl;
else
g_currentPlayerControl = g_tweakPlayerControlAlt;
ResetControllerAssets();
ResetControllerAssets(controls);
}
void CGameOptions::ResetControllerAssets()
static const std::pair<ResId, ResId> CStickToDPadRemap[] =
{
{0x2A13C23E, 0xF13452F8},
{0xA91A7703, 0xC042EC91},
{0x12A12131, 0x5F556002},
{0xA9798329, 0xB306E26F},
{0xCD7B1ACA, 0x8ADA8184},
};
static const std::pair<ResId, ResId> CStickOutlineToDPadRemap[] =
{
{0x1A29C0E6, 0xF13452F8},
{0x5D9F9796, 0xC042EC91},
{0x951546A8, 0x5F556002},
{0x7946C4C5, 0xB306E26F},
{0x409AA72E, 0x8ADA8184},
};
static std::pair<ResId, ResId> TranslatePairToNew(const std::pair<ResId, ResId>& p)
{
return {g_ResFactory->TranslateOriginalToNew(p.first),
g_ResFactory->TranslateOriginalToNew(p.second)};
}
void CGameOptions::ResetControllerAssets(int controls)
{
if (controls != 1)
{
x6c_controlTxtrMap.clear();
}
else if (x6c_controlTxtrMap.empty())
{
x6c_controlTxtrMap.reserve(15);
for (int i=0 ; i<5 ; ++i)
{
x6c_controlTxtrMap.push_back(TranslatePairToNew(CStickToDPadRemap[i]));
x6c_controlTxtrMap.push_back({x6c_controlTxtrMap.back().second,
x6c_controlTxtrMap.back().first});
}
for (int i=0 ; i<5 ; ++i)
x6c_controlTxtrMap.push_back(TranslatePairToNew(CStickOutlineToDPadRemap[i]));
std::sort(x6c_controlTxtrMap.begin(), x6c_controlTxtrMap.end(),
[](const std::pair<ResId, ResId>& a, const std::pair<ResId, ResId>& b)
{ return a.first < b.first; });
}
}
void CGameOptions::EnsureSettings()

View File

@ -134,7 +134,7 @@ class CGameOptions
u16 _dummy = 0;
};
std::vector<CSaveWorld::SScanState> x6c_scanStates;
std::vector<std::pair<ResId, ResId>> x6c_controlTxtrMap;
public:
CGameOptions();
@ -173,9 +173,9 @@ public:
bool GetSwapBeamControls() const { return x68_27_swapBeamsControls; }
void SetIsHintSystemEnabled(bool);
bool GetIsHintSystemEnabled() const { return x68_28_hintSystem; }
void SetControls(s32);
void ResetControllerAssets();
std::vector<CSaveWorld::SScanState>& GetScanStates() { return x6c_scanStates; }
void SetControls(int controls);
void ResetControllerAssets(int controls);
const std::vector<std::pair<ResId, ResId>>& GetControlTXTRMap() const { return x6c_controlTxtrMap; }
static void TryRestoreDefaults(const CFinalInput& input, int category,
int option, bool frontend, bool forceRestore);

View File

@ -123,7 +123,7 @@ std::shared_ptr<CGuiWidget> CGuiTextPane::Create(CGuiFrame* frame, CInputStream&
fontCol, outlineCol, extentX, extentY);
ret->ParseBaseInfo(frame, in, parms);
ret->InitializeBuffers();
ret->TextSupport()->SetText(u"");
ret->TextSupport().SetText(u"");
return ret;
}

View File

@ -16,8 +16,8 @@ public:
const zeus::CColor& col1, const zeus::CColor& col2, s32 padX, s32 padY);
FourCC GetWidgetTypeID() const { return FOURCC('TXPN'); }
CGuiTextSupport* TextSupport() { return &xd4_textSupport; }
const CGuiTextSupport* GetTextSupport() const { return &xd4_textSupport; }
CGuiTextSupport& TextSupport() { return xd4_textSupport; }
const CGuiTextSupport& GetTextSupport() const { return xd4_textSupport; }
void Update(float dt);
bool GetIsFinishedLoadingWidgetSpecific() const;
std::vector<ResId> GetFontAssets() const { return {xd4_textSupport.x5c_fontId}; }

View File

@ -148,7 +148,7 @@ void CGuiTextSupport::CheckAndRebuildTextBuffer()
initStr = hecl::Char16Format(L"&font=%08X;", u32(x5c_fontId));
initStr += x0_string;
g_TextParser->ParseText(*g_TextExecuteBuf, initStr.c_str(), initStr.size());
g_TextParser->ParseText(*g_TextExecuteBuf, initStr.c_str(), initStr.size(), x14_props.xc_txtrMap);
g_TextExecuteBuf->EndBlock();
}
@ -308,11 +308,11 @@ bool CGuiTextSupport::GetIsTextSupportFinishedLoading() const
return _GetIsTextSupportFinishedLoading();
}
void CGuiTextSupport::SetScanStates(const std::vector<CSaveWorld::SScanState>* scanStates)
void CGuiTextSupport::SetControlTXTRMap(const std::vector<std::pair<ResId, ResId>>* txtrMap)
{
if (x14_props.xc_scanStates != scanStates)
if (x14_props.xc_txtrMap != txtrMap)
{
x14_props.xc_scanStates = scanStates;
x14_props.xc_txtrMap = txtrMap;
ClearRenderBuffer();
}
}

View File

@ -67,13 +67,13 @@ class CGuiTextProperties
bool x1_horizontal;
EJustification x4_justification;
EVerticalJustification x8_vertJustification;
const std::vector<CSaveWorld::SScanState>* xc_scanStates;
const std::vector<std::pair<ResId, ResId>>* xc_txtrMap;
public:
CGuiTextProperties(bool wordWrap, bool horizontal, EJustification justification,
EVerticalJustification vertJustification,
const std::vector<CSaveWorld::SScanState>* scanStates=nullptr)
const std::vector<std::pair<ResId, ResId>>* txtrMap=nullptr)
: x0_wordWrap(wordWrap), x1_horizontal(horizontal), x4_justification(justification),
x8_vertJustification(vertJustification), xc_scanStates(scanStates) {}
x8_vertJustification(vertJustification), xc_txtrMap(txtrMap) {}
};
class CGuiTextSupport
@ -139,7 +139,7 @@ public:
float GetCurTime() const { return x3c_curTime; }
void SetCurTime(float t) { x3c_curTime = t; }
const std::u16string& GetString() const { return x0_string; }
void SetScanStates(const std::vector<CSaveWorld::SScanState>* scanStates);
void SetControlTXTRMap(const std::vector<std::pair<ResId, ResId>>* txtrMap);
int GetPageCounter() const { return x304_pageCounter; }
int GetTotalPageCount();
void SetPage(int page);

View File

@ -12,7 +12,7 @@ CGuiWidget::CGuiWidget(const CGuiWidgetParms& parms)
xb6_24_pg(parms.xd_g), xb6_25_isVisible(parms.xa_defaultVisible),
xb6_26_isActive(parms.xb_defaultActive),
xb6_27_isSelectable(true), xb6_28_eventLock(false),
xb6_29_cullFaces(parms.xc_cullFaces), xb6_30_(false),
xb6_29_cullFaces(parms.xc_cullFaces), xb6_30_depthGreater(false),
xb6_31_depthTest(true), xb7_24_depthWrite(false), xb7_25_(true)
{
RecalcWidgetColor(ETraversalMode::Single);

View File

@ -83,7 +83,7 @@ protected:
bool xb6_27_isSelectable : 1;
bool xb6_28_eventLock : 1;
bool xb6_29_cullFaces : 1;
bool xb6_30_ : 1;
bool xb6_30_depthGreater : 1;
bool xb6_31_depthTest : 1;
bool xb7_24_depthWrite : 1;
bool xb7_25_ : 1;
@ -132,6 +132,7 @@ public:
CGuiWidget* FindWidget(s16 id);
bool GetIsFinishedLoading() const;
void DispatchInitialize();
void SetDepthGreater(bool v) { xb6_30_depthGreater = v; }
void SetDepthTest(bool v) { xb6_31_depthTest = v; }
void SetDepthWrite(bool v) { xb7_24_depthWrite = v; }

View File

@ -57,8 +57,8 @@ void CHudBallInterface::UpdatePowerBombReadoutColors()
fontColor = zeus::CColor::skClear;
outlineColor = zeus::CColor::skClear;
}
x10_textpane_bombdigits->TextSupport()->SetFontColor(fontColor);
x10_textpane_bombdigits->TextSupport()->SetOutlineColor(outlineColor);
x10_textpane_bombdigits->TextSupport().SetFontColor(fontColor);
x10_textpane_bombdigits->TextSupport().SetOutlineColor(outlineColor);
zeus::CColor iconColor;
if (x40_pbAmount > 0 && x4c_hasPb)
@ -76,7 +76,7 @@ void CHudBallInterface::SetBombParams(int pbAmount, int pbCapacity, int availabl
{
if (pbAmount != x40_pbAmount || init)
{
x10_textpane_bombdigits->TextSupport()->SetText(hecl::Format("%02d", pbAmount));
x10_textpane_bombdigits->TextSupport().SetText(hecl::Format("%02d", pbAmount));
x40_pbAmount = pbAmount;
UpdatePowerBombReadoutColors();
}

View File

@ -51,7 +51,7 @@ void CHudBossEnergyInterface::SetBossParams(bool visible, const std::u16string&
x18_energybart01_bossbar->SetFilledDrainSpeed(maxEnergy);
x18_energybart01_bossbar->SetCurrEnergy(curEnergy, CAuiEnergyBarT01::ESetMode::Normal);
x18_energybart01_bossbar->SetMaxEnergy(maxEnergy);
x1c_textpane_boss->TextSupport()->SetText(name);
x1c_textpane_boss->TextSupport().SetText(name);
}
x8_curEnergy = curEnergy;
xc_maxEnergy = maxEnergy;

View File

@ -211,8 +211,8 @@ void CHudDecoInterfaceScan::InitializeFlatFrame()
x274_flat_model_dash = static_cast<CGuiModel*>(x10_loadedScanHudFlat->FindWidget("model_dash"));
x260_flat_basewidget_textgroup->SetVisibility(false, ETraversalMode::Children);
x254_flat_textpane_scanning->SetIsVisible(false);
x254_flat_textpane_scanning->TextSupport()->SetFontColor(g_tweakGuiColors->GetHudMessageFill());
x254_flat_textpane_scanning->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetHudMessageOutline());
x254_flat_textpane_scanning->TextSupport().SetFontColor(g_tweakGuiColors->GetHudMessageFill());
x254_flat_textpane_scanning->TextSupport().SetOutlineColor(g_tweakGuiColors->GetHudMessageOutline());
x25c_flat_energybart01_scanbar->SetCoordFunc(CAuiEnergyBarT01::DownloadBarCoordFunc);
x25c_flat_energybart01_scanbar->ResetMaxEnergy();
x25c_flat_energybart01_scanbar->SetFilledColor(zeus::CColor(0.4f, 0.68f, 0.88f, 1.f));
@ -252,16 +252,16 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
if (x1d4_latestScanState == CPlayer::EPlayerScanState::Scanning)
{
// Scan complete
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(15));
x254_flat_textpane_scanning->TextSupport()->SetTypeWriteEffectOptions(false, 0.f, 40.f);
x254_flat_textpane_scanning->TextSupport().SetText(g_MainStringTable->GetString(15));
x254_flat_textpane_scanning->TextSupport().SetTypeWriteEffectOptions(false, 0.f, 40.f);
x238_scanningTextAlpha = 2.f;
}
}
else if (scanState == CPlayer::EPlayerScanState::Scanning)
{
// Scanning
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(14));
x254_flat_textpane_scanning->TextSupport()->SetTypeWriteEffectOptions(false, 0.f, 40.f);
x254_flat_textpane_scanning->TextSupport().SetText(g_MainStringTable->GetString(14));
x254_flat_textpane_scanning->TextSupport().SetTypeWriteEffectOptions(false, 0.f, 40.f);
x238_scanningTextAlpha = 2.f;
}
}
@ -279,8 +279,8 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
if (!player.ObjectInScanningRange(x1d0_latestHudPoi, stateMgr))
{
// Object out of scanning range
x254_flat_textpane_scanning->TextSupport()->SetText(g_MainStringTable->GetString(16));
x254_flat_textpane_scanning->TextSupport()->SetTypeWriteEffectOptions(true, 0.f, 40.f);
x254_flat_textpane_scanning->TextSupport().SetText(g_MainStringTable->GetString(16));
x254_flat_textpane_scanning->TextSupport().SetTypeWriteEffectOptions(true, 0.f, 40.f);
x238_scanningTextAlpha = 1.f;
}
}

View File

@ -45,8 +45,8 @@ CHudEnergyInterface::CHudEnergyInterface(CGuiFrame& selHud, float tankEnergy, in
ITweakGuiColors::VisorEnergyBarColors barColors = g_tweakGuiColors->GetVisorEnergyBarColors(int(hudType));
ITweakGuiColors::VisorEnergyInitColors initColors = g_tweakGuiColors->GetVisorEnergyInitColors(int(hudType));
x20_textpane_energydigits->TextSupport()->SetFontColor(initColors.digitsFont);
x20_textpane_energydigits->TextSupport()->SetOutlineColor(initColors.digitsOutline);
x20_textpane_energydigits->TextSupport().SetFontColor(initColors.digitsFont);
x20_textpane_energydigits->TextSupport().SetOutlineColor(initColors.digitsOutline);
x2c_energybart01_energybar->SetMaxEnergy(CPlayerState::GetBaseHealthCapacity());
x2c_energybart01_energybar->SetFilledColor(barColors.filled);
@ -61,12 +61,12 @@ CHudEnergyInterface::CHudEnergyInterface(CGuiFrame& selHud, float tankEnergy, in
if (x28_textpane_energywarning)
{
x28_textpane_energywarning->TextSupport()->SetFontColor(g_tweakGuiColors->GetEnergyWarningFont());
x28_textpane_energywarning->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetEnergyWarningOutline());
x28_textpane_energywarning->TextSupport().SetFontColor(g_tweakGuiColors->GetEnergyWarningFont());
x28_textpane_energywarning->TextSupport().SetOutlineColor(g_tweakGuiColors->GetEnergyWarningOutline());
if (x1c_27_energyLow)
x28_textpane_energywarning->TextSupport()->SetText(g_MainStringTable->GetString(9));
x28_textpane_energywarning->TextSupport().SetText(g_MainStringTable->GetString(9));
else
x28_textpane_energywarning->TextSupport()->SetText(u"");
x28_textpane_energywarning->TextSupport().SetText(u"");
}
for (int i=0 ; i<14 ; ++i)
@ -110,7 +110,7 @@ void CHudEnergyInterface::Update(float dt, float energyLowPulse)
x18_cachedBarEnergy = x2c_energybart01_energybar->GetFilledEnergy();
std::string string = hecl::Format("%02d",
int(std::fmod(x18_cachedBarEnergy, CPlayerState::GetEnergyTankCapacity())));
x20_textpane_energydigits->TextSupport()->SetText(string);
x20_textpane_energydigits->TextSupport().SetText(string);
}
ITweakGuiColors::VisorEnergyBarColors barColors = g_tweakGuiColors->GetVisorEnergyBarColors(int(x0_hudType));
@ -134,7 +134,7 @@ void CHudEnergyInterface::SetEnergyLow(bool energyLow)
string = g_MainStringTable->GetString(9);
if (x28_textpane_energywarning)
x28_textpane_energywarning->TextSupport()->SetText(string);
x28_textpane_energywarning->TextSupport().SetText(string);
if (energyLow)
CSfxManager::SfxStart(1405, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);

View File

@ -47,8 +47,8 @@ CHudMissileInterface::CHudMissileInterface(CGuiFrame& selHud, int missileCapacit
x10_missleIconXf = x74_basewidget_missileicon->GetLocalTransform();
x60_textpane_missiledigits->TextSupport()->SetFontColor(g_tweakGuiColors->GetMissileDigitsFont());
x60_textpane_missiledigits->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetMissileDigitsOutline());
x60_textpane_missiledigits->TextSupport().SetFontColor(g_tweakGuiColors->GetMissileDigitsFont());
x60_textpane_missiledigits->TextSupport().SetOutlineColor(g_tweakGuiColors->GetMissileDigitsOutline());
x74_basewidget_missileicon->SetColor(g_tweakGuiColors->GetMissileIconColorInactive());
x64_energybart01_missilebar->SetEmptyColor(g_tweakGuiColors->GetMissileBarEmpty());
x64_energybart01_missilebar->SetFilledColor(g_tweakGuiColors->GetMissileBarFilled());
@ -63,8 +63,8 @@ CHudMissileInterface::CHudMissileInterface(CGuiFrame& selHud, int missileCapacit
if (x68_textpane_missilewarning)
{
x68_textpane_missilewarning->TextSupport()->SetFontColor(g_tweakGuiColors->GetMissileWarningFont());
x68_textpane_missilewarning->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetMissileWarningOutline());
x68_textpane_missilewarning->TextSupport().SetFontColor(g_tweakGuiColors->GetMissileWarningFont());
x68_textpane_missilewarning->TextSupport().SetOutlineColor(g_tweakGuiColors->GetMissileWarningOutline());
}
SetNumMissiles(x8_numMissles, mgr);
@ -184,7 +184,7 @@ void CHudMissileInterface::Update(float dt, const CStateManager& mgr)
string = g_MainStringTable->GetString(13); // Depleted
default: break;
}
x68_textpane_missilewarning->TextSupport()->SetText(string);
x68_textpane_missilewarning->TextSupport().SetText(string);
if (x44_latestStatus == EInventoryStatus::Normal && curStatus == EInventoryStatus::Warning)
{
@ -250,7 +250,7 @@ void CHudMissileInterface::SetNumMissiles(int numMissiles, const CStateManager&
{
numMissiles = zeus::clamp(0, numMissiles, 999);
x60_textpane_missiledigits->TextSupport()->SetText(hecl::Format("%3d", numMissiles));
x60_textpane_missiledigits->TextSupport().SetText(hecl::Format("%3d", numMissiles));
if (x8_numMissles < numMissiles)
{

View File

@ -39,8 +39,8 @@ CHudThreatInterface::CHudThreatInterface(CGuiFrame& selHud, EHudType hudType, fl
if (x70_textpane_threatdigits)
{
x70_textpane_threatdigits->TextSupport()->SetFontColor(g_tweakGuiColors->GetThreatDigitsFont());
x70_textpane_threatdigits->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetThreatDigitsOutline());
x70_textpane_threatdigits->TextSupport().SetFontColor(g_tweakGuiColors->GetThreatDigitsFont());
x70_textpane_threatdigits->TextSupport().SetOutlineColor(g_tweakGuiColors->GetThreatDigitsOutline());
}
x54_26_hasArrows = x60_model_threatarrowup && x64_model_threatarrowdown;
@ -62,8 +62,8 @@ CHudThreatInterface::CHudThreatInterface(CGuiFrame& selHud, EHudType hudType, fl
if (x68_textpane_threatwarning)
{
x68_textpane_threatwarning->TextSupport()->SetFontColor(g_tweakGuiColors->GetThreatWarningFont());
x68_textpane_threatwarning->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetThreatWarningOutline());
x68_textpane_threatwarning->TextSupport().SetFontColor(g_tweakGuiColors->GetThreatWarningFont());
x68_textpane_threatwarning->TextSupport().SetOutlineColor(g_tweakGuiColors->GetThreatWarningOutline());
}
}
@ -104,7 +104,7 @@ void CHudThreatInterface::Update(float dt)
if (x10_threatDist < maxThreatEnergy)
{
x70_textpane_threatdigits->SetIsVisible(true);
x70_textpane_threatdigits->TextSupport()->SetText(
x70_textpane_threatdigits->TextSupport().SetText(
hecl::Format("%01.1f", std::max(0.f, x10_threatDist)));
}
else
@ -194,7 +194,7 @@ void CHudThreatInterface::Update(float dt)
else if (newStatus == EThreatStatus::Damage)
string = g_MainStringTable->GetString(11);
x68_textpane_threatwarning->TextSupport()->SetText(string);
x68_textpane_threatwarning->TextSupport().SetText(string);
if (x4c_threatStatus == EThreatStatus::Normal && newStatus == EThreatStatus::Warning)
CSfxManager::SfxStart(1396, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);

View File

@ -86,20 +86,20 @@ CHudVisorBeamMenu::CHudVisorBeamMenu(CGuiFrame& baseHud, EHudVisorBeamMenu type,
if (x4_type == EHudVisorBeamMenu::Visor)
{
x20_textpane_menu->TextSupport()->SetFontColor(g_tweakGuiColors->GetVisorMenuTextFont());
x20_textpane_menu->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetVisorMenuTextOutline());
x20_textpane_menu->TextSupport().SetFontColor(g_tweakGuiColors->GetVisorMenuTextFont());
x20_textpane_menu->TextSupport().SetOutlineColor(g_tweakGuiColors->GetVisorMenuTextOutline());
}
else
{
x20_textpane_menu->TextSupport()->SetFontColor(g_tweakGuiColors->GetBeamMenuTextFont());
x20_textpane_menu->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetBeamMenuTextOutline());
x20_textpane_menu->TextSupport().SetFontColor(g_tweakGuiColors->GetBeamMenuTextFont());
x20_textpane_menu->TextSupport().SetOutlineColor(g_tweakGuiColors->GetBeamMenuTextOutline());
}
zeus::CColor titleColor = zeus::CColor::skWhite;
titleColor.a = 0.f;
x1c_basewidget_menutitle->SetColor(titleColor);
x20_textpane_menu->TextSupport()->SetText(g_MainStringTable->GetString(MenuStringIdx[int(x4_type)][x8_selectedItem]));
x20_textpane_menu->TextSupport().SetText(g_MainStringTable->GetString(MenuStringIdx[int(x4_type)][x8_selectedItem]));
for (int i=0 ; i<4 ; ++i)
{
@ -320,8 +320,8 @@ void CHudVisorBeamMenu::SetSelection(int selection, int pending, float interp)
else if (interp < 1.f)
{
x6c_animPhase = EAnimPhase::Animate;
x20_textpane_menu->TextSupport()->SetText(g_MainStringTable->GetString(MenuStringIdx[int(x4_type)][x8_selectedItem]));
x20_textpane_menu->TextSupport()->SetTypeWriteEffectOptions(true, 0.1f, 16.f);
x20_textpane_menu->TextSupport().SetText(g_MainStringTable->GetString(MenuStringIdx[int(x4_type)][x8_selectedItem]));
x20_textpane_menu->TextSupport().SetTypeWriteEffectOptions(true, 0.1f, 16.f);
}
else
{

View File

@ -92,9 +92,9 @@ void CScanDisplay::ProcessInput(const CFinalInput& input)
{
if (input.PA())
{
if (xa8_message->TextSupport()->GetCurTime() < xa8_message->TextSupport()->GetTotalAnimationTime())
if (xa8_message->TextSupport().GetCurTime() < xa8_message->TextSupport().GetTotalAnimationTime())
{
xa8_message->TextSupport()->SetCurTime(xa8_message->TextSupport()->GetTotalAnimationTime());
xa8_message->TextSupport().SetCurTime(xa8_message->TextSupport().GetTotalAnimationTime());
}
else
{
@ -106,18 +106,14 @@ void CScanDisplay::ProcessInput(const CFinalInput& input)
else if (xc_state == EScanState::ViewingScan)
{
int oldCounter = x1ac_pageCounter;
int totalPages = xac_scrollMessage->TextSupport()->GetTotalPageCount();
int totalPages = xac_scrollMessage->TextSupport().GetTotalPageCount();
if (input.PA() && totalPages != -1)
{
CGuiTextSupport* supp = !x1ac_pageCounter ? xa8_message->TextSupport() : xac_scrollMessage->TextSupport();
if (supp->GetCurTime() < supp->GetTotalAnimationTime())
{
supp->SetCurTime(supp->GetTotalAnimationTime());
}
CGuiTextSupport& supp = !x1ac_pageCounter ? xa8_message->TextSupport() : xac_scrollMessage->TextSupport();
if (supp.GetCurTime() < supp.GetTotalAnimationTime())
supp.SetCurTime(supp.GetTotalAnimationTime());
else
{
x1ac_pageCounter = std::min(totalPages, x1ac_pageCounter + 1);
}
}
if (x1ac_pageCounter != oldCounter)
{
@ -134,7 +130,7 @@ void CScanDisplay::ProcessInput(const CFinalInput& input)
xa8_message->SetIsVisible(false);
xac_scrollMessage->SetIsVisible(true);
}
xac_scrollMessage->TextSupport()->SetPage(x1ac_pageCounter - 1);
xac_scrollMessage->TextSupport().SetPage(x1ac_pageCounter - 1);
SetScanMessageTypeEffect(xac_scrollMessage, !x1b4_scanComplete);
}
}
@ -150,7 +146,7 @@ void CScanDisplay::ProcessInput(const CFinalInput& input)
}
else if (xc_state == EScanState::ViewingScan)
{
if (x1ac_pageCounter < xac_scrollMessage->TextSupport()->GetTotalPageCount())
if (x1ac_pageCounter < xac_scrollMessage->TextSupport().GetTotalPageCount())
aAlpha = std::fabs(x1b0_aPulse);
else
dashAlpha = 1.f;
@ -295,9 +291,9 @@ void CScanDisplay::StopScan()
void CScanDisplay::SetScanMessageTypeEffect(CGuiTextPane* pane, bool type)
{
if (type)
pane->TextSupport()->SetTypeWriteEffectOptions(true, 0.1f, 60.f);
pane->TextSupport().SetTypeWriteEffectOptions(true, 0.1f, 60.f);
else
pane->TextSupport()->SetTypeWriteEffectOptions(false, 0.f, 0.f);
pane->TextSupport().SetTypeWriteEffectOptions(false, 0.f, 0.f);
}
void CScanDisplay::Update(float dt, float scanningTime)
@ -318,7 +314,7 @@ void CScanDisplay::Update(float dt, float scanningTime)
x1a8_bodyAlpha = std::min(x1a8_bodyAlpha + 2.f * dt, 1.f);
if (xc_state == EScanState::DownloadComplete)
{
if (xac_scrollMessage->TextSupport()->GetIsTextSupportFinishedLoading())
if (xac_scrollMessage->TextSupport().GetIsTextSupportFinishedLoading())
x1a4_xAlpha = std::max(0.f, x1a4_xAlpha - dt);
if (x1a4_xAlpha < 0.5f)
{
@ -334,7 +330,7 @@ void CScanDisplay::Update(float dt, float scanningTime)
x1b0_aPulse -= 2.f;
if (x1a4_xAlpha == 1.f)
{
xa8_message->TextSupport()->SetText(x194_scanStr->GetString(0));
xa8_message->TextSupport().SetText(x194_scanStr->GetString(0));
SetScanMessageTypeEffect(xa8_message, !x1b4_scanComplete);
}
}
@ -348,7 +344,7 @@ void CScanDisplay::Update(float dt, float scanningTime)
}
else
{
xa8_message->TextSupport()->SetText(std::u16string(g_MainStringTable->GetString(29)) +
xa8_message->TextSupport().SetText(std::u16string(g_MainStringTable->GetString(29)) +
g_MainStringTable->GetString(x14_scannableInfo->GetCategory() + 30) +
g_MainStringTable->GetString(30));
SetScanMessageTypeEffect(xa8_message, true);
@ -357,7 +353,7 @@ void CScanDisplay::Update(float dt, float scanningTime)
if (x194_scanStr->GetStringCount() > 2)
{
xac_scrollMessage->TextSupport()->SetText(x194_scanStr->GetString(2), true);
xac_scrollMessage->TextSupport().SetText(x194_scanStr->GetString(2), true);
SetScanMessageTypeEffect(xac_scrollMessage, !x1b4_scanComplete);
}
xac_scrollMessage->SetIsVisible(false);
@ -451,8 +447,8 @@ void CScanDisplay::Update(float dt, float scanningTime)
xc_state = EScanState::Inactive;
x10_objId = kInvalidUniqueId;
x14_scannableInfo = std::experimental::nullopt;
xa8_message->TextSupport()->SetText(u"");
xac_scrollMessage->TextSupport()->SetText(u"");
xa8_message->TextSupport().SetText(u"");
xac_scrollMessage->TextSupport().SetText(u"");
xa4_textGroup->SetVisibility(false, ETraversalMode::Children);
xb0_xmark->SetVisibility(false, ETraversalMode::Children);
xb4_abutton->SetVisibility(false, ETraversalMode::Children);

View File

@ -91,7 +91,8 @@ bool CTextParser::BeginsWith(const char16_t* str, int len, const char16_t* other
return true;
}
void CTextParser::ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len)
void CTextParser::ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len,
const std::vector<std::pair<ResId, ResId>>* txtrMap)
{
if (BeginsWith(str, len, u"font="))
{
@ -100,7 +101,7 @@ void CTextParser::ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len
}
else if (BeginsWith(str, len, u"image="))
{
CFontImageDef image = GetImage(str + 6, len - 6);
CFontImageDef image = GetImage(str + 6, len - 6, txtrMap);
out.AddImage(image);
}
else if (BeginsWith(str, len, u"fg-color="))
@ -196,7 +197,8 @@ void CTextParser::ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len
}
}
CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
CFontImageDef CTextParser::GetImage(const char16_t* str, int len,
const std::vector<std::pair<ResId, ResId>>* txtrMap)
{
int commaCount = 0;
for (int i=0 ; i<len ; ++i)
@ -238,7 +240,7 @@ CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
{
AdvanceCommaPos();
texs.push_back(x0_store.GetObj({SBIG('TXTR'),
GetAssetIdFromString(&iterable[tokenPos])}));
GetAssetIdFromString(&iterable[tokenPos], txtrMap)}));
AdvanceTokenPos();
} while (commaPos != iterable.size());
@ -265,7 +267,7 @@ CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
{
AdvanceCommaPos();
texs.push_back(x0_store.GetObj({SBIG('TXTR'),
GetAssetIdFromString(&iterable[tokenPos])}));
GetAssetIdFromString(&iterable[tokenPos], txtrMap)}));
AdvanceTokenPos();
} while (commaPos != iterable.size());
@ -284,32 +286,44 @@ CFontImageDef CTextParser::GetImage(const char16_t* str, int len)
AdvanceCommaPos();
TToken<CTexture> tex = x0_store.GetObj({SBIG('TXTR'),
GetAssetIdFromString(&iterable[tokenPos])});
GetAssetIdFromString(&iterable[tokenPos], txtrMap)});
AdvanceTokenPos();
return CFontImageDef(tex, zeus::CVector2f(cropX, cropY));
}
}
TToken<CTexture> tex = x0_store.GetObj({SBIG('TXTR'), GetAssetIdFromString(str)});
TToken<CTexture> tex = x0_store.GetObj({SBIG('TXTR'), GetAssetIdFromString(str, txtrMap)});
return CFontImageDef(tex, zeus::CVector2f(1.f, 1.f));
}
ResId CTextParser::GetAssetIdFromString(const char16_t* str)
ResId CTextParser::GetAssetIdFromString(const char16_t* str,
const std::vector<std::pair<ResId, ResId>>* txtrMap)
{
u8 r = GetColorValue(str);
u8 g = GetColorValue(str + 2);
u8 b = GetColorValue(str + 4);
u8 a = GetColorValue(str + 6);
return ((r << 24) | (g << 16) | (b << 8) | a) & 0xffffffff;
ResId id = ((r << 24) | (g << 16) | (b << 8) | a) & 0xffffffff;
if (txtrMap)
{
auto search = std::lower_bound(txtrMap->begin(), txtrMap->end(), id,
[](const std::pair<ResId, ResId>& a, ResId test) { return a.first < test; });
if (search != txtrMap->end() && search->first == id)
id = search->second;
}
return id;
}
TToken<CRasterFont> CTextParser::GetFont(const char16_t* str, int len)
{
return x0_store.GetObj({SBIG('FONT'), GetAssetIdFromString(str)});
return x0_store.GetObj({SBIG('FONT'), GetAssetIdFromString(str, nullptr)});
}
void CTextParser::ParseText(CTextExecuteBuffer& out, const char16_t* str, int len)
void CTextParser::ParseText(CTextExecuteBuffer& out, const char16_t* str, int len,
const std::vector<std::pair<ResId, ResId>>* txtrMap)
{
int b=0, e=0;
for (b=0, e=0 ; str[e] && (len == -1 || e < len) ;)
@ -328,7 +342,7 @@ void CTextParser::ParseText(CTextExecuteBuffer& out, const char16_t* str, int le
while (str[e] && (len == -1 || e < len) && str[e] != u';')
++e;
ParseTag(out, str + b, e - b);
ParseTag(out, str + b, e - b, txtrMap);
b = e + 1;
}
else

View File

@ -16,16 +16,20 @@ class CTextParser
static u8 GetColorValue(const char16_t* str);
static u32 FromHex(char16_t ch);
static s32 ParseInt(const char16_t* str, int len, bool signVal);
static ResId GetAssetIdFromString(const char16_t* str);
static ResId GetAssetIdFromString(const char16_t* str,
const std::vector<std::pair<ResId, ResId>>* txtrMap);
static bool Equals(const char16_t* str, int len, const char16_t* other);
static bool BeginsWith(const char16_t* str, int len, const char16_t* other);
void ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len);
CFontImageDef GetImage(const char16_t* str, int len);
void ParseTag(CTextExecuteBuffer& out, const char16_t* str, int len,
const std::vector<std::pair<ResId, ResId>>* txtrMap);
CFontImageDef GetImage(const char16_t* str, int len,
const std::vector<std::pair<ResId, ResId>>* txtrMap);
TToken<CRasterFont> GetFont(const char16_t* str, int len);
public:
CTextParser(IObjectStore& store) : x0_store(store) {}
void ParseText(CTextExecuteBuffer& out, const char16_t* str, int len);
void ParseText(CTextExecuteBuffer& out, const char16_t* str, int len,
const std::vector<std::pair<ResId, ResId>>* txtrMap);
};
}

View File

@ -100,7 +100,7 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading()
FindAndSetPairText(x1c_loadedFrame, "textpane_title", g_MainStringTable->GetString(97));
CGuiTextPane* proceed = static_cast<CGuiTextPane*>(x1c_loadedFrame->FindWidget("textpane_proceed"));
if (proceed)
proceed->TextSupport()->SetText(g_MainStringTable->GetString(85));
proceed->TextSupport().SetText(g_MainStringTable->GetString(85));
x40_tablegroup_popup->SetIsVisible(false);
x40_tablegroup_popup->SetIsActive(false);
x40_tablegroup_popup->SetVertical(false);
@ -153,9 +153,9 @@ bool CFrontEndUI::SNewFileSelectFrame::IsTextDoneAnimating() const
return false;
if (x64_fileSelections[2].x28_curField != 4)
return false;
if (!x28_textpane_erase.x0_panes[0]->GetTextSupport()->IsAnimationDone())
if (!x28_textpane_erase.x0_panes[0]->GetTextSupport().IsAnimationDone())
return false;
return x38_textpane_gba.x0_panes[0]->GetTextSupport()->IsAnimationDone();
return x38_textpane_gba.x0_panes[0]->GetTextSupport().IsAnimationDone();
}
void CFrontEndUI::SNewFileSelectFrame::Update(float dt)
@ -373,7 +373,7 @@ void CFrontEndUI::SNewFileSelectFrame::DeactivateNewGamePopup()
x64_fileSelections[x20_tablegroup_fileselect->GetUserSelection()].
x0_base->SetColor(zeus::CColor::skWhite);
x60_textpane_cancel->TextSupport()->SetText(u"");
x60_textpane_cancel->TextSupport().SetText(u"");
}
void CFrontEndUI::SNewFileSelectFrame::ActivateNewGamePopup()
@ -409,7 +409,7 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateNewGamePopup()
x50_textpane_popupcancel.SetPairText(g_MainStringTable->GetString(94));
x44_model_dash7->SetVisibility(false, ETraversalMode::Children);
}
x60_textpane_cancel->TextSupport()->SetText(g_MainStringTable->GetString(82));
x60_textpane_cancel->TextSupport().SetText(g_MainStringTable->GetString(82));
}
void CFrontEndUI::SNewFileSelectFrame::ResetFrame()
@ -417,16 +417,16 @@ void CFrontEndUI::SNewFileSelectFrame::ResetFrame()
x8_subMenu = ESubMenu::Root;
x38_textpane_gba.x0_panes[0]->SetIsSelectable(true);
x38_textpane_gba.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skWhite);
x38_textpane_gba.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skWhite);
x30_textpane_cheats.x0_panes[0]->SetIsSelectable(true);
x30_textpane_cheats.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skWhite);
x30_textpane_cheats.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skWhite);
ClearFrameContents();
for (int i=2 ; i>=0 ; --i)
x20_tablegroup_fileselect->GetWorkerWidget(i)->SetIsSelectable(true);
x60_textpane_cancel->TextSupport()->SetText(u"");
x60_textpane_cancel->TextSupport().SetText(u"");
}
void CFrontEndUI::SNewFileSelectFrame::ActivateErase()
@ -435,9 +435,9 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateErase()
x28_textpane_erase.x0_panes[0]->SetIsSelectable(false);
zeus::CColor color = zeus::CColor::skGrey;
color.a = 0.5f;
x28_textpane_erase.x0_panes[0]->TextSupport()->SetFontColor(color);
x38_textpane_gba.x0_panes[0]->TextSupport()->SetFontColor(color);
x30_textpane_cheats.x0_panes[0]->TextSupport()->SetFontColor(color);
x28_textpane_erase.x0_panes[0]->TextSupport().SetFontColor(color);
x38_textpane_gba.x0_panes[0]->TextSupport().SetFontColor(color);
x30_textpane_cheats.x0_panes[0]->TextSupport().SetFontColor(color);
x38_textpane_gba.x0_panes[0]->SetIsSelectable(false);
x30_textpane_cheats.x0_panes[0]->SetIsSelectable(false);
@ -455,7 +455,7 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateErase()
}
}
x60_textpane_cancel->TextSupport()->SetText(g_MainStringTable->GetString(82));
x60_textpane_cancel->TextSupport().SetText(g_MainStringTable->GetString(82));
HandleActiveChange(x20_tablegroup_fileselect);
}
@ -485,14 +485,14 @@ void CFrontEndUI::SNewFileSelectFrame::ClearFrameContents()
if (hasSave)
{
x28_textpane_erase.x0_panes[0]->SetIsSelectable(true);
x28_textpane_erase.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skWhite);
x28_textpane_erase.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skWhite);
}
else
{
x28_textpane_erase.x0_panes[0]->SetIsSelectable(false);
zeus::CColor color = zeus::CColor::skGrey;
color.a = 0.5f;
x28_textpane_erase.x0_panes[0]->TextSupport()->SetFontColor(color);
x28_textpane_erase.x0_panes[0]->TextSupport().SetFontColor(color);
}
x20_tablegroup_fileselect->SetUserSelection(0);
@ -500,14 +500,14 @@ void CFrontEndUI::SNewFileSelectFrame::ClearFrameContents()
if (CSlideShow::SlideShowGalleryFlags())
{
cheats->SetIsSelectable(true);
x30_textpane_cheats.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skWhite);
x30_textpane_cheats.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skWhite);
}
else
{
cheats->SetIsSelectable(false);
zeus::CColor color = zeus::CColor::skGrey;
color.a = 0.5f;
x30_textpane_cheats.x0_panes[0]->TextSupport()->SetFontColor(color);
x30_textpane_cheats.x0_panes[0]->TextSupport().SetFontColor(color);
}
HandleActiveChange(x20_tablegroup_fileselect);
@ -522,8 +522,8 @@ void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents()
continue;
SGuiTextPair* pair = (option.x28_curField == -1) ? nullptr : &option.x4_textpanes[option.x28_curField];
if (!pair ||
pair->x0_panes[0]->GetTextSupport()->GetNumCharsPrinted() >=
pair->x0_panes[0]->GetTextSupport()->GetNumCharsTotal())
pair->x0_panes[0]->GetTextSupport().GetNumCharsPrinted() >=
pair->x0_panes[0]->GetTextSupport().GetNumCharsTotal())
{
if (++option.x28_curField < 4)
{
@ -706,8 +706,8 @@ CFrontEndUI::SFileMenuOption CFrontEndUI::SNewFileSelectFrame::FindFileSelectOpt
void CFrontEndUI::SNewFileSelectFrame::StartTextAnimating(CGuiTextPane* text, const std::u16string& str, float chRate)
{
text->TextSupport()->SetText(str);
text->TextSupport()->SetTypeWriteEffectOptions(true, 0.1f, chRate);
text->TextSupport().SetText(str);
text->TextSupport().SetTypeWriteEffectOptions(true, 0.1f, chRate);
}
CFrontEndUI::SFusionBonusFrame::SFusionBonusFrame(CFrontEndUITouchBar& touchBar)
@ -809,12 +809,12 @@ void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::SetUIText(EUIType tp)
std::u16string yesStr;
if (yes != -1)
yesStr = g_MainStringTable->GetString(yes);
x14_textpane_yes->TextSupport()->SetText(yesStr);
x14_textpane_yes->TextSupport().SetText(yesStr);
std::u16string noStr;
if (no != -1)
noStr = g_MainStringTable->GetString(no);
x18_textpane_no->TextSupport()->SetText(noStr);
x18_textpane_no->TextSupport().SetText(noStr);
x1c_model_gc->SetVisibility(true, ETraversalMode::Children);
x20_model_gba->SetVisibility(true, ETraversalMode::Children);
@ -978,9 +978,9 @@ void CFrontEndUI::SFusionBonusFrame::FinishedLoading()
FindAndSetPairText(x24_loadedFrame, "textpane_title", g_MainStringTable->GetString(100));
static_cast<CGuiTextPane*>(x24_loadedFrame->FindWidget("textpane_proceed"))->
TextSupport()->SetText(g_MainStringTable->GetString(85));
TextSupport().SetText(g_MainStringTable->GetString(85));
static_cast<CGuiTextPane*>(x24_loadedFrame->FindWidget("textpane_cancel"))->
TextSupport()->SetText(g_MainStringTable->GetString(82));
TextSupport().SetText(g_MainStringTable->GetString(82));
x2c_tablegroup_fusionsuit->SetIsActive(false);
x2c_tablegroup_fusionsuit->SetIsVisible(false);
@ -1046,7 +1046,7 @@ void CFrontEndUI::SFusionBonusFrame::Update(float dt, CSaveGameScreen* saveUI)
x24_loadedFrame->FindWidget("textpane_proceed")->SetIsVisible(showFusionSuitProceed);
std::u16string instructionStr;
x30_textpane_instructions.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skWhite);
x30_textpane_instructions.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skWhite);
if (x28_tablegroup_options->GetUserSelection() == 1)
{
/* Fusion Suit */
@ -1065,7 +1065,7 @@ void CFrontEndUI::SFusionBonusFrame::Update(float dt, CSaveGameScreen* saveUI)
else
{
instructionStr = u"NES Emulator currently unsupported";
x30_textpane_instructions.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skYellow);
x30_textpane_instructions.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skYellow);
}
}
@ -1241,8 +1241,8 @@ void CFrontEndUI::SFusionBonusFrame::DoAdvance(CGuiTableGroup* caller)
void CFrontEndUI::SGuiTextPair::SetPairText(const std::u16string& str)
{
x0_panes[0]->TextSupport()->SetText(str);
x0_panes[1]->TextSupport()->SetText(str);
x0_panes[0]->TextSupport().SetText(str);
x0_panes[1]->TextSupport().SetText(str);
}
CFrontEndUI::SGuiTextPair CFrontEndUI::FindTextPanePair(CGuiFrame* frame, const char* name)
@ -1256,9 +1256,9 @@ CFrontEndUI::SGuiTextPair CFrontEndUI::FindTextPanePair(CGuiFrame* frame, const
void CFrontEndUI::FindAndSetPairText(CGuiFrame* frame, const char* name, const std::u16string& str)
{
CGuiTextPane* w1 = static_cast<CGuiTextPane*>(frame->FindWidget(name));
w1->TextSupport()->SetText(str);
w1->TextSupport().SetText(str);
CGuiTextPane* w2 = static_cast<CGuiTextPane*>(frame->FindWidget(hecl::Format("%sb", name).c_str()));
w2->TextSupport()->SetText(str);
w2->TextSupport().SetText(str);
}
void CFrontEndUI::SFrontEndFrame::FinishedLoading()
@ -1277,7 +1277,7 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading()
CGuiTextPane* proceed = static_cast<CGuiTextPane*>(x14_loadedFrme->FindWidget("textpane_proceed"));
if (proceed)
proceed->TextSupport()->SetText(g_MainStringTable->GetString(85));
proceed->TextSupport().SetText(g_MainStringTable->GetString(85));
x18_tablegroup_mainmenu->SetMenuAdvanceCallback(
std::bind(&SFrontEndFrame::DoAdvance, this, std::placeholders::_1));
@ -1316,14 +1316,14 @@ void CFrontEndUI::SFrontEndFrame::Update(float dt)
if (CSlideShow::SlideShowGalleryFlags())
{
imageGallery->SetIsSelectable(true);
x24_cheatPair.x0_panes[0]->TextSupport()->SetFontColor(zeus::CColor::skWhite);
x24_cheatPair.x0_panes[0]->TextSupport().SetFontColor(zeus::CColor::skWhite);
}
else
{
imageGallery->SetIsSelectable(false);
zeus::CColor color = zeus::CColor::skGrey;
color.a = 0.5f;
x24_cheatPair.x0_panes[0]->TextSupport()->SetFontColor(color);
x24_cheatPair.x0_panes[0]->TextSupport().SetFontColor(color);
}
x14_loadedFrme->Update(dt);
@ -1798,10 +1798,10 @@ void CFrontEndUI::SOptionsFrontEndFrame::FinishedLoading()
FindTextPanePair(x1c_loadedFrame, "textpane_title").SetPairText(g_MainStringTable->GetString(99)); // OPTIONS
if (CGuiTextPane* proceed = static_cast<CGuiTextPane*>(x1c_loadedFrame->FindWidget("textpane_proceed")))
proceed->TextSupport()->SetText(g_MainStringTable->GetString(85));
proceed->TextSupport().SetText(g_MainStringTable->GetString(85));
if (CGuiTextPane* cancel = static_cast<CGuiTextPane*>(x1c_loadedFrame->FindWidget("textpane_cancel")))
cancel->TextSupport()->SetText(g_MainStringTable->GetString(82));
cancel->TextSupport().SetText(g_MainStringTable->GetString(82));
// Visor, Display, Sound, Controller
for (int i=0 ; i<4 ;++i)

View File

@ -421,7 +421,7 @@ void CInGameGuiManager::Update(CStateManager& stateMgr, float dt, CArchitectureQ
{
if (stateMgr.GetPlayer().GetVisorStaticAlpha() != x1f4_visorStaticAlpha)
{
if (TCastToPtr<CFirstPersonCamera> fpCam = stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr))
if (TCastToPtr<CFirstPersonCamera>(stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr)))
{
if (std::fabs(stateMgr.GetPlayer().GetVisorStaticAlpha() - x1f4_visorStaticAlpha) < 0.5f)
{

View File

@ -173,9 +173,9 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input)
x1ad_textBodyVisible = false;
if (x10_mode == EMode::TextScroll)
{
int oldPage = x174_textpane_body->TextSupport()->GetPageCounter();
int oldPage = x174_textpane_body->TextSupport().GetPageCounter();
int newPage = oldPage;
int totalCount = x174_textpane_body->TextSupport()->GetTotalPageCount();
int totalCount = x174_textpane_body->TextSupport().GetTotalPageCount();
bool lastPage = totalCount - 1 == oldPage;
if (totalCount != -1)
{
@ -183,7 +183,7 @@ void CInventoryScreen::ProcessControllerInput(const CFinalInput& input)
newPage = std::max(oldPage - 1, 0);
else if (input.PLADown() || (input.PA() && !lastPage))
newPage = std::min(oldPage + 1, totalCount - 1);
x174_textpane_body->TextSupport()->SetPage(newPage);
x174_textpane_body->TextSupport().SetPage(newPage);
if (oldPage != newPage)
CSfxManager::SfxStart(1444, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
x198_28_pulseTextArrowTop = newPage > 1;
@ -257,16 +257,16 @@ void CInventoryScreen::VActivate()
{
if (HasLeftInventoryItem(i))
{
xa8_textpane_categories[i]->TextSupport()->SetText(xc_pauseStrg.GetString(i + 10));
xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 10));
}
else
{
xa8_textpane_categories[i]->TextSupport()->SetText(u"??????");
xa8_textpane_categories[i]->TextSupport().SetText(u"??????");
x70_tablegroup_leftlog->GetWorkerWidget(i)->SetIsSelectable(false);
}
}
x178_textpane_title->TextSupport()->SetText(xc_pauseStrg.GetString(9));
x178_textpane_title->TextSupport().SetText(xc_pauseStrg.GetString(9));
x180_basewidget_yicon->SetVisibility(true, ETraversalMode::Children);
}
@ -286,8 +286,8 @@ void CInventoryScreen::UpdateTextBody()
entryText += xc_pauseStrg.GetString(playerState.HasPowerUp(CPlayerState::EItemType::Flamethrower) ? 77 : 65);
}
x174_textpane_body->TextSupport()->SetText(entryText, true);
x174_textpane_body->TextSupport()->SetPage(0);
x174_textpane_body->TextSupport().SetText(entryText, true);
x174_textpane_body->TextSupport().SetPage(0);
}
void CInventoryScreen::ChangedMode(EMode oldMode)
@ -435,20 +435,20 @@ void CInventoryScreen::UpdateRightTable()
{
if (HasRightInventoryItem(category.second[i].idx))
{
title->TextSupport()->SetText(xc_pauseStrg.GetString(category.second[i].nameStrIdx));
title->TextSupport().SetText(xc_pauseStrg.GetString(category.second[i].nameStrIdx));
x84_tablegroup_rightlog->GetWorkerWidget(i + 1)->SetIsSelectable(true);
if (i < minSel)
minSel = i;
}
else
{
title->TextSupport()->SetText(u"??????");
title->TextSupport().SetText(u"??????");
x84_tablegroup_rightlog->GetWorkerWidget(i + 1)->SetIsSelectable(false);
}
}
else
{
title->TextSupport()->SetText(u"??????");
title->TextSupport().SetText(u"??????");
}
}
@ -496,12 +496,12 @@ void CInventoryScreen::UpdateRightLogColors(bool active, const zeus::CColor& act
if (i < cat.first && IsRightInventoryItemEquipped(cat.second[i].idx))
{
x15c_model_righttitledecos[i]->SetColor(g_tweakGuiColors->GetPauseItemBlueColor());
xd8_textpane_titles[i]->TextSupport()->SetFontColor(g_tweakGuiColors->GetPauseItemBlueColor());
xd8_textpane_titles[i]->TextSupport().SetFontColor(g_tweakGuiColors->GetPauseItemBlueColor());
}
else
{
x15c_model_righttitledecos[i]->SetColor(activeColor);
xd8_textpane_titles[i]->TextSupport()->SetFontColor(activeColor);
xd8_textpane_titles[i]->TextSupport().SetFontColor(activeColor);
}
}
}

View File

@ -103,7 +103,7 @@ void CLogBookScreen::UpdateRightTitles()
if (string.empty())
string = u"........";
}
xd8_textpane_titles[i]->TextSupport()->SetText(string);
xd8_textpane_titles[i]->TextSupport().SetText(string);
}
int rightSelMod = x18_firstViewRightSel % 5;
@ -198,7 +198,7 @@ void CLogBookScreen::UpdateBodyText()
{
if (x10_mode != EMode::TextScroll)
{
x174_textpane_body->TextSupport()->SetText(u"");
x174_textpane_body->TextSupport().SetText(u"");
return;
}
@ -219,7 +219,7 @@ void CLogBookScreen::UpdateBodyText()
accumStr = std::u16string(u"\n\n\n\n\n\n") + g_MainStringTable->GetString(105);
}
x174_textpane_body->TextSupport()->SetText(accumStr, true);
x174_textpane_body->TextSupport().SetText(accumStr, true);
}
}
@ -351,9 +351,9 @@ void CLogBookScreen::ProcessControllerInput(const CFinalInput& input)
if (x10_mode == EMode::TextScroll)
{
int oldPage = x174_textpane_body->TextSupport()->GetPageCounter();
int oldPage = x174_textpane_body->TextSupport().GetPageCounter();
int newPage = oldPage;
int pageCount = x174_textpane_body->TextSupport()->GetTotalPageCount();
int pageCount = x174_textpane_body->TextSupport().GetTotalPageCount();
bool lastPage = (pageCount - 1) == oldPage;
if (pageCount != -1)
{
@ -361,7 +361,7 @@ void CLogBookScreen::ProcessControllerInput(const CFinalInput& input)
newPage = std::max(oldPage - 1, 0);
else if (input.PLADown() || (input.PA() && !lastPage))
newPage = std::min(oldPage + 1, pageCount - 1);
x174_textpane_body->TextSupport()->SetPage(newPage);
x174_textpane_body->TextSupport().SetPage(newPage);
if (oldPage != newPage)
CSfxManager::SfxStart(1444, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
x198_28_pulseTextArrowTop = newPage > 1;
@ -412,16 +412,16 @@ void CLogBookScreen::VActivate()
{
if (IsScanCategoryReady(CSaveWorld::EScanCategory(i + 1)))
{
xa8_textpane_categories[i]->TextSupport()->SetText(xc_pauseStrg.GetString(i + 1));
xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 1));
}
else
{
xa8_textpane_categories[i]->TextSupport()->SetText(u"??????");
xa8_textpane_categories[i]->TextSupport().SetText(u"??????");
x70_tablegroup_leftlog->GetWorkerWidget(i)->SetIsSelectable(false);
}
}
x178_textpane_title->TextSupport()->SetText(xc_pauseStrg.GetString(0));
x178_textpane_title->TextSupport().SetText(xc_pauseStrg.GetString(0));
for (int i=0 ; i<5 ; ++i)
x70_tablegroup_leftlog->GetWorkerWidget(i)->SetIsSelectable(false);
@ -439,7 +439,7 @@ void CLogBookScreen::ChangedMode(EMode oldMode)
x74_basewidget_leftguages->SetVisibility(false, ETraversalMode::Children);
x88_basewidget_rightguages->SetVisibility(false, ETraversalMode::Children);
UpdateBodyText();
x174_textpane_body->TextSupport()->SetPage(0);
x174_textpane_body->TextSupport().SetPage(0);
}
else if (x10_mode == EMode::TextScroll)
{

View File

@ -1,28 +1,146 @@
#include "CMessageScreen.hpp"
#include "GameGlobalObjects.hpp"
#include "CSimplePool.hpp"
#include "GuiSys/CGuiModel.hpp"
#include "GuiSys/CGuiTextPane.hpp"
#include "CGameState.hpp"
#include "Input/CFinalInput.hpp"
#include "Audio/CSfxManager.hpp"
#include "GuiSys/CGuiWidgetDrawParms.hpp"
namespace urde
{
namespace MP1
{
CMessageScreen::CMessageScreen(ResId msg, float time)
CMessageScreen::CMessageScreen(ResId msg, float delayTime)
: x74_delayTime(delayTime)
{
x78_24_exit = false;
x0_msg = g_SimplePool->GetObj({FOURCC('STRG'), msg});
xc_msgScreen = g_SimplePool->GetObj("FRME_MsgScreen");
}
void CMessageScreen::ProcessControllerInput(const CFinalInput& input)
{
if (!x18_loadedMsgScreen || x74_delayTime > 0.f || !input.PA())
return;
if (x1c_textpane_message->TextSupport().GetCurTime() <
x1c_textpane_message->TextSupport().GetTotalAnimationTime())
{
x1c_textpane_message->TextSupport().SetCurTime(
x1c_textpane_message->TextSupport().GetTotalAnimationTime());
return;
}
x6c_page += 1;
if (x6c_page >= x0_msg->GetStringCount())
{
x78_24_exit = true;
return;
}
x1c_textpane_message->TextSupport().SetTypeWriteEffectOptions(false, 0.1f, 30.f);
x1c_textpane_message->TextSupport().SetText(x0_msg->GetString(x6c_page));
CSfxManager::SfxStart(1421, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
x74_delayTime = 0.8f;
}
bool CMessageScreen::Update(float dt, float blurAmt)
{
return false;
x70_blurAmt = blurAmt;
if (!x18_loadedMsgScreen && xc_msgScreen.IsLoaded() && x0_msg.IsLoaded())
{
x18_loadedMsgScreen = xc_msgScreen.GetObj();
x1c_textpane_message = static_cast<CGuiTextPane*>(x18_loadedMsgScreen->FindWidget("textpane_message"));
x20_basewidget_top = x18_loadedMsgScreen->FindWidget("basewidget_top");
x24_basewidget_center = x18_loadedMsgScreen->FindWidget("basewidget_center");
x28_basewidget_bottom = x18_loadedMsgScreen->FindWidget("basewidget_bottom");
x2c_model_abutton = static_cast<CGuiModel*>(x18_loadedMsgScreen->FindWidget("model_abutton"));
x30_model_top = static_cast<CGuiModel*>(x18_loadedMsgScreen->FindWidget("model_top"));
x38_model_bottom = static_cast<CGuiModel*>(x18_loadedMsgScreen->FindWidget("model_bottom"));
x34_model_center = static_cast<CGuiModel*>(x18_loadedMsgScreen->FindWidget("model_center"));
x3c_model_bg = static_cast<CGuiModel*>(x18_loadedMsgScreen->FindWidget("model_bg"));
x40_model_videoband = static_cast<CGuiModel*>(x18_loadedMsgScreen->FindWidget("model_videoband"));
x44_topPos = x20_basewidget_top->GetLocalPosition();
x50_bottomPos = x28_basewidget_bottom->GetLocalPosition();
x5c_videoBandPos = x40_model_videoband->GetLocalPosition();
if (CGuiWidget* w = x18_loadedMsgScreen->FindWidget("basewidget_top"))
w->SetColor(g_tweakGuiColors->GetHudFrameColor());
if (CGuiWidget* w = x18_loadedMsgScreen->FindWidget("basewidget_centerdeco"))
w->SetColor(g_tweakGuiColors->GetHudFrameColor());
if (CGuiWidget* w = x18_loadedMsgScreen->FindWidget("model_bottom"))
w->SetColor(g_tweakGuiColors->GetHudFrameColor());
x40_model_videoband->SetDepthGreater(true);
x30_model_top->SetDepthWrite(true);
x38_model_bottom->SetDepthWrite(true);
x34_model_center->SetDepthWrite(true);
x3c_model_bg->SetDepthWrite(true);
if (x0_msg->GetStringCount())
{
x1c_textpane_message->TextSupport().SetTypeWriteEffectOptions(false, 0.1f, 30.f);
x1c_textpane_message->TextSupport().SetText(x0_msg->GetString(0));
x1c_textpane_message->TextSupport().SetFontColor(g_tweakGuiColors->GetHudMessageFill());
x1c_textpane_message->TextSupport().SetControlTXTRMap(&g_GameState->GameOptions().GetControlTXTRMap());
}
}
if (x18_loadedMsgScreen)
{
if (x74_delayTime > 0.f)
x74_delayTime -= dt;
float xT = std::max(0.f, (x70_blurAmt - 0.5f) / 0.5f);
float scaleX;
if (xT < 0.7f)
scaleX = xT / 0.7f;
else if (xT < 0.85f)
scaleX = 0.1f * (1.f - (xT - 0.7f) / 0.15f) + 0.9f;
else
scaleX = 0.1f * ((xT - 0.7f - 0.15f) / 0.3f) + 0.9f;
x24_basewidget_center->SetLocalTransform(zeus::CTransform::Scale(scaleX, 1.f, 1.f));
x20_basewidget_top->SetLocalTransform(zeus::CTransform::Translate(0.f, 0.f, 12.f * (1.f - xT)));
x28_basewidget_bottom->SetLocalTransform(zeus::CTransform::Translate(0.f, 0.f, -12.f * (1.f - xT)));
float alpha = std::max(0.f, (x70_blurAmt - 0.7f) / 0.3f);
zeus::CColor color = g_tweakGuiColors->GetHudFrameColor();
color.a *= alpha;
x20_basewidget_top->SetColor(color);
x28_basewidget_bottom->SetColor(zeus::CColor(1.f, alpha));
float pulse = 0.f;
if (x74_delayTime <= 0.f)
pulse = zeus::clamp(0.f, 0.5f * (1.f + std::sin(5.f * CGraphics::GetSecondsMod900() - M_PIF / 2.f)), 1.f);
x2c_model_abutton->SetColor(zeus::CColor(1.f, pulse));
x68_videoBandOffset += 12.f * dt;
if (x68_videoBandOffset > 10.f)
x68_videoBandOffset -= 20.f;
x40_model_videoband->SetColor(zeus::CColor(1.f, 0.04f * (rand() / float(RAND_MAX)) + 0.08f));
x40_model_videoband->SetLocalTransform(
zeus::CTransform::Translate(x5c_videoBandPos + zeus::CVector3f(0.f, 0.f, x68_videoBandOffset)));
x18_loadedMsgScreen->Update(dt);
}
return !x78_24_exit;
}
void CMessageScreen::Draw() const
{
if (!x18_loadedMsgScreen)
return;
x18_loadedMsgScreen->Draw(CGuiWidgetDrawParms(x70_blurAmt, zeus::CVector3f::skZero));
}
}

View File

@ -2,16 +2,43 @@
#define __URDE_CMESSAGESCREEN_HPP__
#include "RetroTypes.hpp"
#include "CToken.hpp"
#include "GuiSys/CStringTable.hpp"
#include "GuiSys/CGuiFrame.hpp"
namespace urde
{
class CFinalInput;
class CGuiWidget;
class CGuiTextPane;
class CGuiModel;
namespace MP1
{
class CMessageScreen
{
TLockedToken<CStringTable> x0_msg;
TLockedToken<CGuiFrame> xc_msgScreen;
CGuiFrame* x18_loadedMsgScreen = nullptr;
CGuiTextPane* x1c_textpane_message = nullptr;
CGuiWidget* x20_basewidget_top = nullptr;
CGuiWidget* x24_basewidget_center = nullptr;
CGuiWidget* x28_basewidget_bottom = nullptr;
CGuiModel* x2c_model_abutton = nullptr;
CGuiModel* x30_model_top = nullptr;
CGuiModel* x34_model_center = nullptr;
CGuiModel* x38_model_bottom = nullptr;
CGuiModel* x3c_model_bg = nullptr;
CGuiModel* x40_model_videoband = nullptr;
zeus::CVector3f x44_topPos;
zeus::CVector3f x50_bottomPos;
zeus::CVector3f x5c_videoBandPos;
float x68_videoBandOffset = 10.f;
u32 x6c_page = 0;
float x70_blurAmt = 0.f;
float x74_delayTime;
bool x78_24_exit : 1;
public:
CMessageScreen(ResId msg, float time);
void ProcessControllerInput(const CFinalInput& input);

View File

@ -197,27 +197,27 @@ bool COptionsScreen::VReady() const
void COptionsScreen::VActivate()
{
for (int i=0 ; i<5 ; ++i)
xa8_textpane_categories[i]->TextSupport()->SetText(xc_pauseStrg.GetString(i + 16));
xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 16));
x178_textpane_title->TextSupport()->SetText(xc_pauseStrg.GetString(15));
x178_textpane_title->TextSupport().SetText(xc_pauseStrg.GetString(15));
for (int i=0 ; i<5 ; ++i)
x70_tablegroup_leftlog->GetWorkerWidget(i)->SetIsSelectable(false);
x174_textpane_body->TextSupport()->SetJustification(EJustification::Center);
x174_textpane_body->TextSupport()->SetVerticalJustification(EVerticalJustification::Bottom);
x174_textpane_body->TextSupport().SetJustification(EJustification::Center);
x174_textpane_body->TextSupport().SetVerticalJustification(EVerticalJustification::Bottom);
static_cast<CGuiTextPane*>(x190_tablegroup_double->GetWorkerWidget(0))->
TextSupport()->SetText(xc_pauseStrg.GetString(95));
TextSupport().SetText(xc_pauseStrg.GetString(95));
static_cast<CGuiTextPane*>(x190_tablegroup_double->GetWorkerWidget(1))->
TextSupport()->SetText(xc_pauseStrg.GetString(94));
TextSupport().SetText(xc_pauseStrg.GetString(94));
static_cast<CGuiTextPane*>(x194_tablegroup_triple->GetWorkerWidget(0))->
TextSupport()->SetText(xc_pauseStrg.GetString(96));
TextSupport().SetText(xc_pauseStrg.GetString(96));
static_cast<CGuiTextPane*>(x194_tablegroup_triple->GetWorkerWidget(1))->
TextSupport()->SetText(xc_pauseStrg.GetString(97));
TextSupport().SetText(xc_pauseStrg.GetString(97));
static_cast<CGuiTextPane*>(x194_tablegroup_triple->GetWorkerWidget(2))->
TextSupport()->SetText(xc_pauseStrg.GetString(98));
TextSupport().SetText(xc_pauseStrg.GetString(98));
x18c_slidergroup_slider->SetSelectionChangedCallback(
std::bind(&COptionsScreen::OnSliderChanged, this, std::placeholders::_1, std::placeholders::_2));
@ -254,9 +254,9 @@ void COptionsScreen::UpdateRightTable()
for (int i=0 ; i<5 ; ++i)
{
if (i < category.first)
xd8_textpane_titles[i]->TextSupport()->SetText(xc_pauseStrg.GetString(category.second[i].stringId));
xd8_textpane_titles[i]->TextSupport().SetText(xc_pauseStrg.GetString(category.second[i].stringId));
else
xd8_textpane_titles[i]->TextSupport()->SetText(u"");
xd8_textpane_titles[i]->TextSupport().SetText(u"");
}
}

View File

@ -57,10 +57,10 @@ void CPauseScreen::InitializeFrameGlue()
x4c_textpane_next = static_cast<CGuiTextPane*>(x34_loadedPauseScreenInstructions->FindWidget("textpane_next"));
x50_textpane_back = static_cast<CGuiTextPane*>(x34_loadedPauseScreenInstructions->FindWidget("textpane_back"));
x40_textpane_a->TextSupport()->SetText(x14_strgPauseScreen->GetString(7)); // OPTIONS
x40_textpane_a->TextSupport()->SetFontColor(g_tweakGuiColors->GetPauseItemAmberColor());
x44_textpane_b->TextSupport()->SetText(x14_strgPauseScreen->GetString(6)); // LOG BOOK
x44_textpane_b->TextSupport()->SetFontColor(g_tweakGuiColors->GetPauseItemAmberColor());
x40_textpane_a->TextSupport().SetText(x14_strgPauseScreen->GetString(7)); // OPTIONS
x40_textpane_a->TextSupport().SetFontColor(g_tweakGuiColors->GetPauseItemAmberColor());
x44_textpane_b->TextSupport().SetText(x14_strgPauseScreen->GetString(6)); // LOG BOOK
x44_textpane_b->TextSupport().SetFontColor(g_tweakGuiColors->GetPauseItemAmberColor());
x40_textpane_a->SetColor(zeus::CColor::skClear);
x44_textpane_b->SetColor(zeus::CColor::skClear);
@ -206,11 +206,11 @@ void CPauseScreen::ProcessControllerInput(const CStateManager& mgr, const CFinal
}
}
x38_textpane_l1->TextSupport()->SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x74_lTrigger[input.DLTrigger()])));
x3c_textpane_r->TextSupport()->SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x80_rTrigger[input.DRTrigger()])));
x48_textpane_return->TextSupport()->SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x8c_startButton[input.DStart()])));
x50_textpane_back->TextSupport()->SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x98_aButton[input.DA()])));
x4c_textpane_next->TextSupport()->SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->xa4_bButton[input.DB()])));
x38_textpane_l1->TextSupport().SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x74_lTrigger[input.DLTrigger()])));
x3c_textpane_r->TextSupport().SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x80_rTrigger[input.DRTrigger()])));
x48_textpane_return->TextSupport().SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x8c_startButton[input.DStart()])));
x50_textpane_back->TextSupport().SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->x98_aButton[input.DA()])));
x4c_textpane_next->TextSupport().SetText(hecl::Format("&image=%8.8X;", u32(g_tweakPlayerRes->xa4_bButton[input.DB()])));
}
void CPauseScreen::TransitionComplete()
@ -219,8 +219,8 @@ void CPauseScreen::TransitionComplete()
curScreen.reset();
x78_activeIdx = 1 - x78_activeIdx;
x8_curSubscreen = xc_nextSubscreen;
x40_textpane_a->TextSupport()->SetText(x14_strgPauseScreen->GetString(int(GetPreviousSubscreen(x8_curSubscreen)) + 6));
x44_textpane_b->TextSupport()->SetText(x14_strgPauseScreen->GetString(int(GetNextSubscreen(x8_curSubscreen)) + 6));
x40_textpane_a->TextSupport().SetText(x14_strgPauseScreen->GetString(int(GetPreviousSubscreen(x8_curSubscreen)) + 6));
x44_textpane_b->TextSupport().SetText(x14_strgPauseScreen->GetString(int(GetNextSubscreen(x8_curSubscreen)) + 6));
}
void CPauseScreen::Update(float dt, const CStateManager& mgr, CRandom16& rand, CArchitectureQueue& archQueue)

View File

@ -8,6 +8,8 @@
#include "GuiSys/CGuiWidgetDrawParms.hpp"
#include "GameGlobalObjects.hpp"
#include "Audio/CSfxManager.hpp"
#include "CGameState.hpp"
#include "GuiSys/CStringTable.hpp"
namespace urde
{
@ -42,11 +44,24 @@ void CPauseScreenBase::InitializeFrameGlue()
xa4_model_scrollrightdown = static_cast<CGuiModel*>(x8_frame.FindWidget("model_scrollrightdown"));
x94_model_textarrowbottom = static_cast<CGuiModel*>(x8_frame.FindWidget("model_textarrowbottom"));
x178_textpane_title = static_cast<CGuiTextPane*>(x8_frame.FindWidget("textpane_title"));
x178_textpane_title->TextSupport().SetFontColor(g_tweakGuiColors->GetPauseItemAmberColor());
x174_textpane_body = static_cast<CGuiTextPane*>(x8_frame.FindWidget("textpane_body"));
x174_textpane_body->SetIsVisible(true);
x174_textpane_body->TextSupport().SetFontColor(g_tweakGuiColors->GetPauseItemAmberColor());
x174_textpane_body->TextSupport().SetPage(0);
x174_textpane_body->TextSupport().SetText(u"");
x174_textpane_body->TextSupport().SetJustification(EJustification::Left);
x174_textpane_body->TextSupport().SetVerticalJustification(EVerticalJustification::Top);
x174_textpane_body->TextSupport().SetControlTXTRMap(&g_GameState->GameOptions().GetControlTXTRMap());
x180_basewidget_yicon = x8_frame.FindWidget("basewidget_yicon");
x180_basewidget_yicon->SetVisibility(false, ETraversalMode::Children);
x17c_model_textalpha = static_cast<CGuiModel*>(x8_frame.FindWidget("model_textalpha"));
x184_textpane_yicon = static_cast<CGuiTextPane*>(x8_frame.FindWidget("textpane_yicon"));
x188_textpane_ytext = static_cast<CGuiTextPane*>(x8_frame.FindWidget("textpane_ytext"));
x184_textpane_yicon->TextSupport().SetText(hecl::UTF8ToChar16(hecl::Format("&image=%8.8X;",
u32(g_tweakPlayerRes->xbc_yButton[0]))));
x188_textpane_ytext->TextSupport().SetText(xc_pauseStrg.GetString(99));
x188_textpane_ytext->SetColor(g_tweakGuiColors->GetPauseItemAmberColor());
x18c_slidergroup_slider = static_cast<CGuiSliderGroup*>(x8_frame.FindWidget("slidergroup_slider"));
x190_tablegroup_double = static_cast<CGuiTableGroup*>(x8_frame.FindWidget("tablegroup_double"));
x194_tablegroup_triple = static_cast<CGuiTableGroup*>(x8_frame.FindWidget("tablegroup_triple"));

View File

@ -46,12 +46,12 @@ void CQuitGameScreen::FinishedLoading()
x14_tablegroup_quitgame->SetMenuSelectionChangeCallback(
std::bind(&CQuitGameScreen::DoSelectionChange, this, std::placeholders::_1, std::placeholders::_2));
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_title"))->TextSupport()->
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_title"))->TextSupport().
SetText(g_MainStringTable->GetString(Titles[int(x0_type)]));
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_yes"))->TextSupport()->
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_yes"))->TextSupport().
SetText(g_MainStringTable->GetString(22));
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_no"))->TextSupport()->
static_cast<CGuiTextPane*>(x10_loadedFrame->FindWidget("textpane_no"))->TextSupport().
SetText(g_MainStringTable->GetString(23));
x14_tablegroup_quitgame->SetUserSelection(DefaultSelections[int(x0_type)]);

View File

@ -100,8 +100,8 @@ void CSamusHud::InitializeFrameGluePermanent(const CStateManager& mgr)
x58c_helmet_BaseWidget_Pivot = x264_loadedFrmeHelmet->FindWidget("BaseWidget_Pivot");
x590_base_Model_AutoMapper = static_cast<CGuiModel*>(x274_loadedFrmeBaseHud->FindWidget("Model_AutoMapper"));
x594_base_textpane_counter = static_cast<CGuiTextPane*>(x274_loadedFrmeBaseHud->FindWidget("textpane_counter"));
x594_base_textpane_counter->TextSupport()->SetFontColor(g_tweakGuiColors->GetHudCounterFill());
x594_base_textpane_counter->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetHudCounterOutline());
x594_base_textpane_counter->TextSupport().SetFontColor(g_tweakGuiColors->GetHudCounterFill());
x594_base_textpane_counter->TextSupport().SetOutlineColor(g_tweakGuiColors->GetHudCounterOutline());
x598_base_basewidget_message = x274_loadedFrmeBaseHud->FindWidget("basewidget_message");
for (CGuiWidget* child = static_cast<CGuiWidget*>(x598_base_basewidget_message->GetChildObject());
child ; child = static_cast<CGuiWidget*>(child->GetNextSibling()))
@ -120,9 +120,9 @@ void CSamusHud::InitializeFrameGluePermanent(const CStateManager& mgr)
}
x59c_base_textpane_message->SetDepthTest(false);
x598_base_basewidget_message->SetVisibility(false, ETraversalMode::Children);
x59c_base_textpane_message->TextSupport()->SetFontColor(g_tweakGuiColors->GetHudMessageFill());
x59c_base_textpane_message->TextSupport()->SetOutlineColor(g_tweakGuiColors->GetHudMessageOutline());
x59c_base_textpane_message->TextSupport()->SetScanStates(&g_GameState->GameOptions().GetScanStates());
x59c_base_textpane_message->TextSupport().SetFontColor(g_tweakGuiColors->GetHudMessageFill());
x59c_base_textpane_message->TextSupport().SetOutlineColor(g_tweakGuiColors->GetHudMessageOutline());
x59c_base_textpane_message->TextSupport().SetControlTXTRMap(&g_GameState->GameOptions().GetControlTXTRMap());
x590_base_Model_AutoMapper->SetDepthWrite(true);
x304_basewidgetIdlePos = x588_base_basewidget_pivot->GetIdlePosition();
x310_cameraPos = x274_loadedFrmeBaseHud->GetFrameCamera()->GetLocalPosition();
@ -1386,7 +1386,7 @@ void CSamusHud::Update(float dt, const CStateManager& mgr,
x558_messageTextAlpha = std::max(0.f, x558_messageTextAlpha - dt);
if (x558_messageTextAlpha == 0.f)
{
x59c_base_textpane_message->TextSupport()->SetTypeWriteEffectOptions(false, 0.f, 1.f);
x59c_base_textpane_message->TextSupport().SetTypeWriteEffectOptions(false, 0.f, 1.f);
x598_base_basewidget_message->SetVisibility(false, ETraversalMode::Children);
}
}
@ -1425,7 +1425,7 @@ void CSamusHud::Update(float dt, const CStateManager& mgr,
}
float nextSfxChars = x55c_lastSfxChars + g_tweakGui->GetWorldTransManagerCharsPerSfx();
if (x59c_base_textpane_message->TextSupport()->GetNumCharsPrinted() >= nextSfxChars)
if (x59c_base_textpane_message->TextSupport().GetNumCharsPrinted() >= nextSfxChars)
{
x55c_lastSfxChars = nextSfxChars;
if (!x598_base_basewidget_message->GetIsVisible() || textScale == 1.f)
@ -1439,7 +1439,7 @@ void CSamusHud::Update(float dt, const CStateManager& mgr,
int hundredths = std::fmod(mgr.GetEscapeSequenceTimer() * 100.f, 100.f);
std::string timeStr = hecl::Format("%02d:%02d:%02d",
int(minutes), int(seconds), int(hundredths));
x594_base_textpane_counter->TextSupport()->SetText(timeStr);
x594_base_textpane_counter->TextSupport().SetText(timeStr);
x594_base_textpane_counter->SetIsVisible(true);
zeus::CColor counterColor = zeus::CColor::skWhite;
@ -1794,21 +1794,21 @@ void CSamusHud::SetMessage(const std::u16string& text, const CHUDMemoParms& info
x598_base_basewidget_message->SetVisibility(false, ETraversalMode::Children);
CGuiWidget* pane = info.x6_hintMemo ? x598_base_basewidget_message : x59c_base_textpane_message;
pane->SetVisibility(true, ETraversalMode::Children);
x59c_base_textpane_message->TextSupport()->SetTypeWriteEffectOptions(true, 0.1f, 40.f);
x59c_base_textpane_message->TextSupport().SetTypeWriteEffectOptions(true, 0.1f, 40.f);
if (info.x4_initializeMemo)
{
x55c_lastSfxChars = 0.f;
x59c_base_textpane_message->TextSupport()->SetCurTime(0.f);
x59c_base_textpane_message->TextSupport()->SetText(text);
x59c_base_textpane_message->TextSupport().SetCurTime(0.f);
x59c_base_textpane_message->TextSupport().SetText(text);
}
else if (x59c_base_textpane_message->TextSupport()->GetString().empty())
else if (x59c_base_textpane_message->TextSupport().GetString().empty())
{
x55c_lastSfxChars = 0.f;
x59c_base_textpane_message->TextSupport()->AddText(text);
x59c_base_textpane_message->TextSupport().AddText(text);
}
else
{
x59c_base_textpane_message->TextSupport()->AddText(std::u16string(u"\n") + text);
x59c_base_textpane_message->TextSupport().AddText(std::u16string(u"\n") + text);
}
x59c_base_textpane_message->SetColor(zeus::CColor::skWhite);

View File

@ -322,21 +322,21 @@ void CSaveGameScreen::SetUIText()
msgAStr = x38_strgMemoryCard->GetString(msgA);
if (msgB > -1)
msgBStr = x38_strgMemoryCard->GetString(msgB);
x54_textpane_message->TextSupport()->SetText(msgAStr + msgBStr);
x54_textpane_message->TextSupport().SetText(msgAStr + msgBStr);
if (opt0 > -1)
opt0Str = x38_strgMemoryCard->GetString(opt0);
x5c_textpane_choice0->TextSupport()->SetText(opt0Str);
x5c_textpane_choice0->TextSupport().SetText(opt0Str);
if (opt1 > -1)
opt1Str = x38_strgMemoryCard->GetString(opt1);
x60_textpane_choice1->TextSupport()->SetText(opt1Str);
x60_textpane_choice1->TextSupport().SetText(opt1Str);
if (opt2 > -1)
opt2Str = x38_strgMemoryCard->GetString(opt2);
x64_textpane_choice2->TextSupport()->SetText(opt2Str);
x64_textpane_choice2->TextSupport().SetText(opt2Str);
x68_textpane_choice3->TextSupport()->SetText(opt3Str);
x68_textpane_choice3->TextSupport().SetText(opt3Str);
m_touchBar->SetUIOpts(opt0Str, opt1Str, opt2Str);