Minor cleanup and fixes

This commit is contained in:
Phillip Stephens 2020-11-06 22:03:45 -08:00
parent 134646a32f
commit 5cbcfc9038
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
4 changed files with 13 additions and 5 deletions

View File

@ -5,6 +5,7 @@
namespace DataSpec {
struct ITweakSlideShow : ITweak {
virtual std::string_view GetPakName() const = 0;
virtual std::string_view GetFont() const = 0;
virtual const zeus::CColor& GetFontColor() const = 0;
virtual const zeus::CColor& GetOutlineColor() const = 0;

View File

@ -28,6 +28,7 @@ struct CTweakSlideShow final : ITweakSlideShow {
CTweakSlideShow() = default;
CTweakSlideShow(athena::io::IStreamReader& in) { read(in); }
std::string_view GetPakName() const override { return x4_pakName; }
std::string_view GetFont() const override { return x14_fontAssetName; }
const zeus::CColor& GetFontColor() const override { return x24_fontColor; }
const zeus::CColor& GetOutlineColor() const override { return x28_outlineColor; }

View File

@ -13,6 +13,7 @@ bool AreAllDepsLoaded(const std::vector<TLockedToken<CDependencyGroup>>& deps) {
} // Anonymous namespace
CSlideShow::CSlideShow() : CIOWin("SlideShow"), x130_(g_tweakSlideShow->GetX54()) {
g_ResFactory->GetResLoader()->AddPakFileAsync(g_tweakSlideShow->GetPakName(), false, false);
const SObjectTag* font = g_ResFactory->GetResourceIdByName(g_tweakSlideShow->GetFont());
if (font) {
CGuiTextProperties propsA(false, true, EJustification::Center, EVerticalJustification::Bottom);
@ -55,6 +56,9 @@ CSlideShow::CSlideShow() : CIOWin("SlideShow"), x130_(g_tweakSlideShow->GetX54()
}
}
CSlideShow::~CSlideShow() {
//TODO: Remove pak from loader
}
bool CSlideShow::LoadTXTRDep(std::string_view name) {
const SObjectTag* dgrpTag = g_ResFactory->GetResourceIdByName(name);
if (dgrpTag && dgrpTag->type == FOURCC('DGRP')) {
@ -74,11 +78,11 @@ CIOWin::EMessageReturn CSlideShow::OnMessage(const CArchitectureMessage& msg, CA
switch (x14_phase) {
case Phase::Zero: {
// if (!g_resLoader->AreAllPaksLoaded())
//{
// g_resLoader->AsyncIdlePakLoading();
// return EMessageReturn::Exit;
//}
if (!g_ResFactory->GetResLoader()->AreAllPaksLoaded())
{
g_ResFactory->GetResLoader()->AsyncIdlePakLoading();
return EMessageReturn::Exit;
}
x14_phase = Phase::One;
[[fallthrough]];
}
@ -138,6 +142,7 @@ void CSlideShow::Draw() {
}
u32 CSlideShow::SlideShowGalleryFlags() {
return 1 | 2 | 4 | 8;
u32 ret = 0;
if (!g_GameState)
return ret;

View File

@ -101,6 +101,7 @@ private:
public:
CSlideShow();
~CSlideShow();
EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&) override;
bool GetIsContinueDraw() const override { return false; }
void Draw() override;