More CGuiSys and CFrontEndUI work

This commit is contained in:
Jack Andersen 2016-12-15 18:35:49 -10:00
parent 19a371c931
commit f665812d6e
20 changed files with 349 additions and 52 deletions

View File

@ -164,12 +164,12 @@ struct FRME : BigDNA
struct TBGPInfo : IWidgetInfo struct TBGPInfo : IWidgetInfo
{ {
DECL_DNA DECL_DNA
Value<atUint16> unk1; Value<atUint16> elementCount;
Value<atUint16> unk2; Value<atUint16> unk2;
Value<atUint32> unkEnum; Value<atUint32> unkEnum;
Value<atUint16> unk3; Value<atUint16> defaultSelection;
Value<atUint16> un4; Value<atUint16> un4;
Value<bool> unk5; Value<bool> selectWraparound;
Value<bool> unk6; Value<bool> unk6;
Value<float> unkFloat1; Value<float> unkFloat1;
Value<float> unkFloat2; Value<float> unkFloat2;

View File

@ -24,7 +24,7 @@ CPersistentOptions::CPersistentOptions(CBitStreamReader& stream)
xd0_25_ = stream.ReadEncoded(1); xd0_25_ = stream.ReadEncoded(1);
xd0_26_ = stream.ReadEncoded(1); xd0_26_ = stream.ReadEncoded(1);
xd0_27_ = stream.ReadEncoded(1); xd0_27_ = stream.ReadEncoded(1);
xd0_28_ = stream.ReadEncoded(1); xd0_28_hasFusion = stream.ReadEncoded(1);
xd0_29_ = stream.ReadEncoded(1); xd0_29_ = stream.ReadEncoded(1);
xbc_ = stream.ReadEncoded(2); xbc_ = stream.ReadEncoded(2);

View File

@ -29,7 +29,7 @@ class CPersistentOptions
bool xd0_25_; bool xd0_25_;
bool xd0_26_; bool xd0_26_;
bool xd0_27_; bool xd0_27_;
bool xd0_28_; bool xd0_28_hasFusion;
bool xd0_29_; bool xd0_29_;
}; };
u16 _dummy = 0; u16 _dummy = 0;
@ -40,6 +40,7 @@ public:
CPersistentOptions(CBitStreamReader& stream); CPersistentOptions(CBitStreamReader& stream);
void SetCinematicState(ResId mlvlId, TEditorId cineId, bool state); void SetCinematicState(ResId mlvlId, TEditorId cineId, bool state);
bool PlayerHasFusion() const { return xd0_28_hasFusion; }
}; };
/** Options tracked per game session */ /** Options tracked per game session */

View File

@ -131,7 +131,7 @@ void CGuiFrame::Initialize()
{ {
SortDrawOrder(); SortDrawOrder();
xc_headWidget->SetColor(xc_headWidget->xa4_color); xc_headWidget->SetColor(xc_headWidget->xa4_color);
xc_headWidget->InitializeRecursive(); xc_headWidget->DispatchInitialize();
} }
void CGuiFrame::LoadWidgetsInGame(CInputStream& in) void CGuiFrame::LoadWidgetsInGame(CInputStream& in)
@ -157,6 +157,17 @@ void CGuiFrame::LoadWidgetsInGame(CInputStream& in)
Initialize(); Initialize();
} }
void CGuiFrame::ProcessUserInput(const CFinalInput& input) const
{
if (x4_)
return;
for (CGuiWidget* widget : x2c_widgets)
{
if (widget->GetIsActive())
widget->ProcessUserInput(input);
}
}
CGuiFrame* CGuiFrame::CreateFrame(ResId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp) CGuiFrame* CGuiFrame::CreateFrame(ResId frmeId, CGuiSys& sys, CInputStream& in, CSimplePool* sp)
{ {
in.readInt32Big(); in.readInt32Big();

View File

@ -56,6 +56,7 @@ public:
void Draw(const CGuiWidgetDrawParms& parms) const; void Draw(const CGuiWidgetDrawParms& parms) const;
void Initialize(); void Initialize();
void LoadWidgetsInGame(CInputStream& in); void LoadWidgetsInGame(CInputStream& in);
void ProcessUserInput(const CFinalInput& input) const;
CGuiWidgetIdDB& GetWidgetIdDB() {return x18_idDB;} CGuiWidgetIdDB& GetWidgetIdDB() {return x18_idDB;}

View File

@ -163,4 +163,10 @@ void CGuiObject::SetO2WTransform(const zeus::CTransform& xf)
RecalculateTransforms(); RecalculateTransforms();
} }
void CGuiObject::SetLocalTransform(const zeus::CTransform& xf)
{
x4_localXF = xf;
RecalculateTransforms();
}
} }

View File

@ -23,7 +23,7 @@ public:
virtual ~CGuiObject(); virtual ~CGuiObject();
virtual void Update(float dt); virtual void Update(float dt);
virtual void Draw(const CGuiWidgetDrawParms& parms) const; virtual void Draw(const CGuiWidgetDrawParms& parms) const;
virtual bool Message()=0; virtual void Initialize()=0;
void MoveInWorld(const zeus::CVector3f& vec); void MoveInWorld(const zeus::CVector3f& vec);
const zeus::CVector3f& GetLocalPosition() const {return x4_localXF.origin;} const zeus::CVector3f& GetLocalPosition() const {return x4_localXF.origin;}
@ -43,6 +43,7 @@ public:
void RecalculateTransforms(); void RecalculateTransforms();
void Reorthogonalize(); void Reorthogonalize();
void SetO2WTransform(const zeus::CTransform& xf); void SetO2WTransform(const zeus::CTransform& xf);
void SetLocalTransform(const zeus::CTransform& xf);
}; };
} }

View File

@ -3,23 +3,24 @@
namespace urde namespace urde
{ {
CGuiTableGroup::CGuiTableGroup(const CGuiWidgetParms& parms, int a, int b, bool c) CGuiTableGroup::CGuiTableGroup(const CGuiWidgetParms& parms, int elementCount,
int defaultSel, bool selectWraparound)
: CGuiCompoundWidget(parms), : CGuiCompoundWidget(parms),
xc0_(a), xc4_(b), xc0_elementCount(elementCount), xc4_userSelection(defaultSel),
xc8_(b), xcc_(b), xc8_prevUserSelection(defaultSel), xcc_defaultUserSelection(defaultSel),
xd0_(c) xd0_selectWraparound(selectWraparound)
{} {}
CGuiTableGroup* CGuiTableGroup::Create(CGuiFrame* frame, CInputStream& in, bool flag) CGuiTableGroup* CGuiTableGroup::Create(CGuiFrame* frame, CInputStream& in, bool flag)
{ {
CGuiWidgetParms parms = ReadWidgetHeader(frame, in, flag); CGuiWidgetParms parms = ReadWidgetHeader(frame, in, flag);
int a = in.readInt16Big(); int elementCount = in.readInt16Big();
in.readInt16Big(); in.readInt16Big();
in.readUint32Big(); in.readUint32Big();
int b = in.readInt16Big(); int defaultSel = in.readInt16Big();
in.readInt16Big(); in.readInt16Big();
bool c = in.readBool(); bool selectWraparound = in.readBool();
in.readBool(); in.readBool();
in.readFloatBig(); in.readFloatBig();
in.readFloatBig(); in.readFloatBig();
@ -30,7 +31,7 @@ CGuiTableGroup* CGuiTableGroup::Create(CGuiFrame* frame, CInputStream& in, bool
in.readInt16Big(); in.readInt16Big();
in.readInt16Big(); in.readInt16Big();
CGuiTableGroup* ret = new CGuiTableGroup(parms, a, b, c); CGuiTableGroup* ret = new CGuiTableGroup(parms, elementCount, defaultSel, selectWraparound);
ret->ParseBaseInfo(frame, in, parms); ret->ParseBaseInfo(frame, in, parms);
return ret; return ret;
} }

View File

@ -13,15 +13,21 @@ public:
{ {
float x0_ = 0.f; float x0_ = 0.f;
}; };
enum class TableSelectReturn
{
Changed,
Unchanged,
WrappedAround
};
private: private:
SomeState xb8_; SomeState xb8_;
SomeState xbc_; SomeState xbc_;
int xc0_; int xc0_elementCount;
int xc4_; int xc4_userSelection;
int xc8_; int xc8_prevUserSelection;
int xcc_; int xcc_defaultUserSelection;
bool xd0_; bool xd0_selectWraparound;
bool xd1_ = true; bool xd1_ = true;
std::function<void(const CGuiTableGroup*)> xd4_doMenuAdvance; std::function<void(const CGuiTableGroup*)> xd4_doMenuAdvance;
std::function<void(const CGuiTableGroup*)> xec_doMenuCancel; std::function<void(const CGuiTableGroup*)> xec_doMenuCancel;
@ -46,8 +52,52 @@ public:
x104_doMenuSelChange = std::move(cb); x104_doMenuSelChange = std::move(cb);
} }
void SetColors(const zeus::CColor& selected, const zeus::CColor& unselected)
{
int id = -1;
while (CGuiWidget* worker = GetWorkerWidget(++id))
{
if (id == xc4_userSelection)
worker->SetColor(selected);
else
worker->SetColor(unselected);
}
}
void SetD1(bool v) { xd1_ = v; } void SetD1(bool v) { xd1_ = v; }
void SetUserSelection(int sel)
{
xc8_prevUserSelection = xc4_userSelection;
xc4_userSelection = sel;
}
TableSelectReturn DecrementSelectedRow()
{
xc8_prevUserSelection = xc4_userSelection;
--xc4_userSelection;
if (xc4_userSelection < 0)
{
xc4_userSelection = xd0_selectWraparound ? xc0_elementCount - 1 : 0;
return xd0_selectWraparound ? TableSelectReturn::WrappedAround : TableSelectReturn::Unchanged;
}
return TableSelectReturn::Changed;
}
TableSelectReturn IncrementSelectedRow()
{
xc8_prevUserSelection = xc4_userSelection;
++xc4_userSelection;
if (xc4_userSelection >= xc0_elementCount)
{
xc4_userSelection = xd0_selectWraparound ? 0 : xc0_elementCount - 1;
return xd0_selectWraparound ? TableSelectReturn::WrappedAround : TableSelectReturn::Unchanged;
}
return TableSelectReturn::Changed;
}
int GetUserSelection() const { return xc4_userSelection; }
static CGuiTableGroup* Create(CGuiFrame* frame, CInputStream& in, bool); static CGuiTableGroup* Create(CGuiFrame* frame, CInputStream& in, bool);
}; };

View File

@ -53,6 +53,11 @@ float CGuiTextSupport::GetTotalAnimationTime() const
return x60_renderBuf->GetPrimitiveCount() / x58_chRate; return x60_renderBuf->GetPrimitiveCount() / x58_chRate;
} }
bool CGuiTextSupport::AnimationDone() const
{
return x3c_curTime >= GetTotalAnimationTime();
}
void CGuiTextSupport::SetTypeWriteEffectOptions(bool enable, float chFadeTime, float chRate) void CGuiTextSupport::SetTypeWriteEffectOptions(bool enable, float chFadeTime, float chRate)
{ {
x50_typeEnable = enable; x50_typeEnable = enable;

View File

@ -110,6 +110,7 @@ public:
float GetCurrentAnimationOverAge() const; float GetCurrentAnimationOverAge() const;
float GetNumCharsPrinted() const; float GetNumCharsPrinted() const;
float GetTotalAnimationTime() const; float GetTotalAnimationTime() const;
bool AnimationDone() const;
void SetTypeWriteEffectOptions(bool enable, float chFadeTime, float chRate); void SetTypeWriteEffectOptions(bool enable, float chFadeTime, float chRate);
void Update(float dt); void Update(float dt);
void ClearBuffer(); void ClearBuffer();

View File

@ -47,9 +47,8 @@ CGuiWidget* CGuiWidget::Create(CGuiFrame* frame, CInputStream& in, bool flag)
return ret; return ret;
} }
bool CGuiWidget::Message() void CGuiWidget::Initialize()
{ {
return false;
} }
void CGuiWidget::ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms) void CGuiWidget::ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms)
@ -89,7 +88,7 @@ void CGuiWidget::Update(float dt)
} }
void CGuiWidget::Draw(const CGuiWidgetDrawParms&) const {} void CGuiWidget::Draw(const CGuiWidgetDrawParms&) const {}
void CGuiWidget::Initialize() {} void CGuiWidget::ProcessUserInput(const CFinalInput& input) {}
void CGuiWidget::Touch() const {} void CGuiWidget::Touch() const {}
bool CGuiWidget::GetIsVisible() const bool CGuiWidget::GetIsVisible() const
@ -219,15 +218,15 @@ bool CGuiWidget::GetIsFinishedLoading() const
return GetIsFinishedLoadingWidgetSpecific(); return GetIsFinishedLoadingWidgetSpecific();
} }
void CGuiWidget::InitializeRecursive() void CGuiWidget::DispatchInitialize()
{ {
Initialize(); Initialize();
CGuiWidget* ch = static_cast<CGuiWidget*>(GetChildObject()); CGuiWidget* ch = static_cast<CGuiWidget*>(GetChildObject());
if (ch) if (ch)
ch->InitializeRecursive(); ch->DispatchInitialize();
CGuiWidget* sib = static_cast<CGuiWidget*>(GetNextSibling()); CGuiWidget* sib = static_cast<CGuiWidget*>(GetNextSibling());
if (sib) if (sib)
sib->InitializeRecursive(); sib->DispatchInitialize();
} }
void CGuiWidget::SetColor(const zeus::CColor& color) void CGuiWidget::SetColor(const zeus::CColor& color)

View File

@ -9,6 +9,7 @@ namespace urde
{ {
class CGuiFrame; class CGuiFrame;
class CGuiTextSupport; class CGuiTextSupport;
class CFinalInput;
enum class ETraversalMode enum class ETraversalMode
{ {
@ -94,8 +95,8 @@ public:
virtual void Update(float dt); virtual void Update(float dt);
virtual void Draw(const CGuiWidgetDrawParms& drawParms) const; virtual void Draw(const CGuiWidgetDrawParms& drawParms) const;
virtual bool Message();
virtual void Initialize(); virtual void Initialize();
virtual void ProcessUserInput(const CFinalInput& input);
virtual void Touch() const; virtual void Touch() const;
virtual bool GetIsVisible() const; virtual bool GetIsVisible() const;
virtual bool GetIsActive() const; virtual bool GetIsActive() const;
@ -109,6 +110,7 @@ public:
s16 GetParentId() const {return x72_parentId;} s16 GetParentId() const {return x72_parentId;}
s16 GetWorkerId() const {return xb4_workerId;} s16 GetWorkerId() const {return xb4_workerId;}
const zeus::CTransform& GetTransform() const {return x74_transform;} const zeus::CTransform& GetTransform() const {return x74_transform;}
zeus::CTransform& GetTransform() {return x74_transform;}
const zeus::CVector3f& GetIdlePosition() const {return x74_transform.origin;} const zeus::CVector3f& GetIdlePosition() const {return x74_transform.origin;}
void SetIdlePosition(const zeus::CVector3f& pos, bool reapply); void SetIdlePosition(const zeus::CVector3f& pos, bool reapply);
void ReapplyXform(); void ReapplyXform();
@ -125,7 +127,7 @@ public:
void InitializeRGBAFactor(); void InitializeRGBAFactor();
CGuiWidget* FindWidget(s16 id); CGuiWidget* FindWidget(s16 id);
bool GetIsFinishedLoading() const; bool GetIsFinishedLoading() const;
void InitializeRecursive(); void DispatchInitialize();
}; };
} }

View File

@ -16,6 +16,11 @@ bool CSaveUI::PumpLoad()
return false; return false;
} }
void CSaveUI::ProcessUserInput(const CFinalInput& input)
{
}
CSaveUI::CSaveUI(u32 instIdx, u32 a, u32 b) CSaveUI::CSaveUI(u32 instIdx, u32 a, u32 b)
: x0_instIdx(instIdx), x8_a(a), xc_b(b) : x0_instIdx(instIdx), x8_a(a), xc_b(b)
{ {

View File

@ -11,6 +11,7 @@ class CTexture;
class CStringTable; class CStringTable;
class CGuiFrame; class CGuiFrame;
class CSaveWorld; class CSaveWorld;
class CFinalInput;
struct CSaveUI struct CSaveUI
{ {
@ -37,6 +38,7 @@ struct CSaveUI
CIOWin::EMessageReturn Update(float dt); CIOWin::EMessageReturn Update(float dt);
bool PumpLoad(); bool PumpLoad();
void ProcessUserInput(const CFinalInput& input);
CSaveUI(u32 inst, u32 a, u32 b); CSaveUI(u32 inst, u32 a, u32 b);
}; };

View File

@ -74,6 +74,7 @@ public:
CFinalInput& operator|=(const CFinalInput& other); CFinalInput& operator|=(const CFinalInput& other);
bool operator==(const CFinalInput& other) bool operator==(const CFinalInput& other)
{ return memcmp(this, &other, sizeof(CFinalInput)) == 0; } { return memcmp(this, &other, sizeof(CFinalInput)) == 0; }
float DeltaTime() const {return x0_dt;}
u32 ControllerIdx() const {return x4_controllerIdx;} u32 ControllerIdx() const {return x4_controllerIdx;}
bool PStart() const {return x2e_b31_PStart;} bool PStart() const {return x2e_b31_PStart;}

View File

@ -103,18 +103,18 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading()
worker->SetVisibility(false, ETraversalMode::Children); worker->SetVisibility(false, ETraversalMode::Children);
x20_tablegroup_fileselect->SetMenuAdvanceCallback( x20_tablegroup_fileselect->SetMenuAdvanceCallback(
std::bind(&SNewFileSelectFrame::DoMenuAdvance, this, std::placeholders::_1)); std::bind(&SNewFileSelectFrame::DoFileselectAdvance, this, std::placeholders::_1));
x20_tablegroup_fileselect->SetMenuSelectionChangeCallback( x20_tablegroup_fileselect->SetMenuSelectionChangeCallback(
std::bind(&SNewFileSelectFrame::DoMenuSelectionChange, this, std::placeholders::_1)); std::bind(&SNewFileSelectFrame::DoSelectionChange, this, std::placeholders::_1));
x20_tablegroup_fileselect->SetMenuCancelCallback( x20_tablegroup_fileselect->SetMenuCancelCallback(
std::bind(&SNewFileSelectFrame::DoMenuAdvance, this, std::placeholders::_1)); std::bind(&SNewFileSelectFrame::DoFileselectCancel, this, std::placeholders::_1));
x40_tablegroup_popup->SetMenuAdvanceCallback( x40_tablegroup_popup->SetMenuAdvanceCallback(
std::bind(&SNewFileSelectFrame::DoMenuAdvance, this, std::placeholders::_1)); std::bind(&SNewFileSelectFrame::DoPopupAdvance, this, std::placeholders::_1));
x40_tablegroup_popup->SetMenuSelectionChangeCallback( x40_tablegroup_popup->SetMenuSelectionChangeCallback(
std::bind(&SNewFileSelectFrame::DoMenuSelectionChange, this, std::placeholders::_1)); std::bind(&SNewFileSelectFrame::DoSelectionChange, this, std::placeholders::_1));
x40_tablegroup_popup->SetMenuCancelCallback( x40_tablegroup_popup->SetMenuCancelCallback(
std::bind(&SNewFileSelectFrame::DoMenuAdvance, this, std::placeholders::_1)); std::bind(&SNewFileSelectFrame::DoPopupCancel, this, std::placeholders::_1));
for (int i=0 ; i<3 ; ++i) for (int i=0 ; i<3 ; ++i)
x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, i); x64_fileSelections[i] = FindFileSelectOption(x1c_loadedFrame, i);
@ -138,12 +138,105 @@ bool CFrontEndUI::SNewFileSelectFrame::PumpLoad()
return false; return false;
} }
void CFrontEndUI::SNewFileSelectFrame::DoMenuSelectionChange(const CGuiTableGroup* caller) bool CFrontEndUI::SNewFileSelectFrame::IsTextDoneAnimating() const
{
if (x64_fileSelections[0].x28_ != 4)
return false;
if (x64_fileSelections[1].x28_ != 4)
return false;
if (x64_fileSelections[2].x28_ != 4)
return false;
if (!x28_textpane_erase.x0_panes[0]->GetTextSupport()->AnimationDone())
return false;
return x38_.x0_panes[0]->GetTextSupport()->AnimationDone();
}
CFrontEndUI::SNewFileSelectFrame::EPhase
CFrontEndUI::SNewFileSelectFrame::ProcessUserInput(const CFinalInput& input)
{
if (x8_ != 2)
x4_saveUI->ProcessUserInput(input);
if (IsTextDoneAnimating())
x108_curTime = std::min(0.5f, x108_curTime + input.DeltaTime());
if (x108_curTime < 0.5f)
return xc_phase;
if (x10c_inputEnable)
x1c_loadedFrame->ProcessUserInput(input);
if (x10d_needsToggle)
{
if (x40_tablegroup_popup->GetIsActive())
DeactivatePopup();
else
ActivatePopup();
}
return xc_phase;
}
void CFrontEndUI::SNewFileSelectFrame::HandleActiveChange(CGuiTableGroup* active)
{
if (!active)
return;
active->SetColors(zeus::CColor::skWhite,
zeus::CColor{0.627450f, 0.627450f, 0.627450f, 0.784313f});
if (active == x20_tablegroup_fileselect)
x24_model_erase->SetLocalTransform(zeus::CTransform::Translate(
zeus::CVector3f{0.f, 0.f, active->GetUserSelection() * x104_rowPitch} + xf8_model_erase_position));
if (x8_ == 0 || x8_ == 3)
x24_model_erase->SetIsVisible(false);
else
x24_model_erase->SetIsVisible(true);
}
void CFrontEndUI::SNewFileSelectFrame::DeactivatePopup()
{
x40_tablegroup_popup->SetIsActive(false);
x40_tablegroup_popup->SetIsVisible(false);
x20_tablegroup_fileselect->SetIsActive(true);
HandleActiveChange(x20_tablegroup_fileselect);
x64_fileSelections[x20_tablegroup_fileselect->GetUserSelection()].
x0_base->SetColor(zeus::CColor::skWhite);
}
void CFrontEndUI::SNewFileSelectFrame::ActivatePopup()
{
x40_tablegroup_popup->SetIsActive(true);
x40_tablegroup_popup->SetIsVisible(true);
x40_tablegroup_popup->SetLocalTransform(
zeus::CTransform::Translate(0.f, 0.f, x20_tablegroup_fileselect->GetUserSelection() * x104_rowPitch) *
x40_tablegroup_popup->GetTransform());
x20_tablegroup_fileselect->SetIsActive(false);
x8_ = 2;
HandleActiveChange(x40_tablegroup_popup);
x48_.SetPairText(g_MainStringTable->GetString(95));
x50_.SetPairText(g_MainStringTable->GetString(38));
x64_fileSelections[x20_tablegroup_fileselect->GetUserSelection()].
x0_base->SetColor(zeus::CColor{1.f, 1.f, 1.f, 0.f});
x44_model_dash7->SetVisibility(false, ETraversalMode::Children);
}
void CFrontEndUI::SNewFileSelectFrame::DoPopupCancel(const CGuiTableGroup* caller)
{ {
} }
void CFrontEndUI::SNewFileSelectFrame::DoMenuAdvance(const CGuiTableGroup* caller) void CFrontEndUI::SNewFileSelectFrame::DoPopupAdvance(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SNewFileSelectFrame::DoFileselectCancel(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SNewFileSelectFrame::DoSelectionChange(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SNewFileSelectFrame::DoFileselectAdvance(const CGuiTableGroup* caller)
{ {
} }
@ -157,10 +250,75 @@ CFrontEndUI::SGBASupportFrame::SGBASupportFrame()
void CFrontEndUI::SGBASupportFrame::FinishedLoading() void CFrontEndUI::SGBASupportFrame::FinishedLoading()
{ {
x28_tablegroup_options = static_cast<CGuiTableGroup*>(x24_loadedFrame->FindWidget("tablegroup_options"));
x2c_tablegroup_fusionsuit = static_cast<CGuiTableGroup*>(x24_loadedFrame->FindWidget("tablegroup_fusionsuit"));
x30_textpane_instructions = FindTextPanePair(x24_loadedFrame, "textpane_instructions");
FindAndSetPairText(x24_loadedFrame, "textpane_nes", g_MainStringTable->GetString(66));
FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuit", g_MainStringTable->GetString(63));
FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuitno", g_MainStringTable->GetString(65));
FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuityes", g_MainStringTable->GetString(64));
FindAndSetPairText(x24_loadedFrame, "textpane_title", g_MainStringTable->GetString(100));
static_cast<CGuiTextPane*>(x24_loadedFrame->FindWidget("textpane_proceed"))->
TextSupport()->SetText(g_MainStringTable->GetString(85));
static_cast<CGuiTextPane*>(x24_loadedFrame->FindWidget("textpane_cancel"))->
TextSupport()->SetText(g_MainStringTable->GetString(82));
x2c_tablegroup_fusionsuit->SetIsActive(false);
x2c_tablegroup_fusionsuit->SetIsVisible(false);
x2c_tablegroup_fusionsuit->SetD1(false);
x2c_tablegroup_fusionsuit->SetUserSelection(g_GameState->SystemOptions().PlayerHasFusion());
SetTableColors(x28_tablegroup_options);
SetTableColors(x2c_tablegroup_fusionsuit);
x28_tablegroup_options->SetMenuAdvanceCallback(
std::bind(&SGBASupportFrame::DoOptionsAdvance, this, std::placeholders::_1));
x28_tablegroup_options->SetMenuSelectionChangeCallback(
std::bind(&SGBASupportFrame::DoSelectionChange, this, std::placeholders::_1));
x28_tablegroup_options->SetMenuCancelCallback(
std::bind(&SGBASupportFrame::DoOptionsCancel, this, std::placeholders::_1));
x2c_tablegroup_fusionsuit->SetMenuSelectionChangeCallback(
std::bind(&SGBASupportFrame::DoSelectionChange, this, std::placeholders::_1));
} }
bool CFrontEndUI::SGBASupportFrame::PumpLoad() bool CFrontEndUI::SGBASupportFrame::PumpLoad()
{
if (x24_loadedFrame)
return true;
if (!xc_gbaScreen.IsLoaded())
return false;
if (!x18_gbaLink.IsLoaded())
return false;
if (!x4_gbaSupport->IsReady())
return false;
if (!xc_gbaScreen->GetIsFinishedLoading())
return false;
x24_loadedFrame = xc_gbaScreen.GetObj();
FinishedLoading();
return true;
}
void CFrontEndUI::SGBASupportFrame::SetTableColors(CGuiTableGroup* tbgp) const
{
tbgp->SetColors(zeus::CColor::skWhite,
zeus::CColor{0.627450f, 0.627450f, 0.627450f, 0.784313f});
}
void CFrontEndUI::SGBASupportFrame::ProcessUserInput(const CFinalInput& input, CSaveUI* sui)
{
}
void CFrontEndUI::SGBASupportFrame::DoOptionsCancel(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SGBASupportFrame::DoSelectionChange(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SGBASupportFrame::DoOptionsAdvance(const CGuiTableGroup* caller)
{ {
} }
@ -201,13 +359,12 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading()
if (proceed) if (proceed)
proceed->TextSupport()->SetText(g_MainStringTable->GetString(85)); proceed->TextSupport()->SetText(g_MainStringTable->GetString(85));
/* These appear to be unused leftovers from the CGuiFrame scripting system */
x18_tablegroup_mainmenu->SetMenuAdvanceCallback( x18_tablegroup_mainmenu->SetMenuAdvanceCallback(
std::bind(&SFrontEndFrame::DoMenuAdvance, this, std::placeholders::_1)); std::bind(&SFrontEndFrame::DoAdvance, this, std::placeholders::_1));
x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback( x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback(
std::bind(&SFrontEndFrame::DoMenuSelectionChange, this, std::placeholders::_1)); std::bind(&SFrontEndFrame::DoSelectionChange, this, std::placeholders::_1));
x18_tablegroup_mainmenu->SetMenuCancelCallback( x18_tablegroup_mainmenu->SetMenuCancelCallback(
std::bind(&SFrontEndFrame::DoMenuAdvance, this, std::placeholders::_1)); std::bind(&SFrontEndFrame::DoCancel, this, std::placeholders::_1));
} }
bool CFrontEndUI::SFrontEndFrame::PumpLoad() bool CFrontEndUI::SFrontEndFrame::PumpLoad()
@ -229,11 +386,22 @@ bool CFrontEndUI::SFrontEndFrame::PumpLoad()
return false; return false;
} }
void CFrontEndUI::SFrontEndFrame::DoMenuSelectionChange(const CGuiTableGroup* caller) void CFrontEndUI::SFrontEndFrame::ProcessUserInput(const CFinalInput& input)
{ {
} }
void CFrontEndUI::SFrontEndFrame::DoMenuAdvance(const CGuiTableGroup* caller) void CFrontEndUI::SFrontEndFrame::DoCancel(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SFrontEndFrame::DoSelectionChange(const CGuiTableGroup* caller)
{
}
void CFrontEndUI::SFrontEndFrame::DoAdvance(const CGuiTableGroup* caller)
{ {
} }

View File

@ -84,13 +84,30 @@ public:
/* filename, world, playtime, date */ /* filename, world, playtime, date */
SGuiTextPair x4_textpanes[4]; SGuiTextPair x4_textpanes[4];
u32 x28_ = 0;
float x2c_ = ComputeRandom();
static float ComputeRandom()
{
return rand() / float(RAND_MAX) * 30.f + 30.f;
}
}; };
static SFileSelectOption FindFileSelectOption(CGuiFrame* frame, int idx); static SFileSelectOption FindFileSelectOption(CGuiFrame* frame, int idx);
struct SNewFileSelectFrame struct SNewFileSelectFrame
{ {
enum class EPhase
{
Zero,
One,
Two
};
u32 x0_rnd; u32 x0_rnd;
CSaveUI* x4_saveUI; CSaveUI* x4_saveUI;
u32 x8_ = 0;
EPhase xc_phase = EPhase::Zero;
TLockedToken<CGuiFrame> x10_frme; TLockedToken<CGuiFrame> x10_frme;
CGuiFrame* x1c_loadedFrame = nullptr; CGuiFrame* x1c_loadedFrame = nullptr;
CGuiTableGroup* x20_tablegroup_fileselect = nullptr; CGuiTableGroup* x20_tablegroup_fileselect = nullptr;
@ -107,16 +124,26 @@ public:
SFileSelectOption x64_fileSelections[3]; SFileSelectOption x64_fileSelections[3];
zeus::CVector3f xf8_model_erase_position; zeus::CVector3f xf8_model_erase_position;
float x104_rowPitch = 0.f; float x104_rowPitch = 0.f;
float x108_ = 0.f; float x108_curTime = 0.f;
bool x10c_ = false; bool x10c_inputEnable = false;
bool x10d_ = false; bool x10d_needsToggle = false;
bool x10e_ = false; bool x10e_ = false;
SNewFileSelectFrame(CSaveUI* sui, u32 rnd); SNewFileSelectFrame(CSaveUI* sui, u32 rnd);
void FinishedLoading(); void FinishedLoading();
bool PumpLoad(); bool PumpLoad();
bool IsTextDoneAnimating() const;
EPhase ProcessUserInput(const CFinalInput& input);
void DoMenuSelectionChange(const CGuiTableGroup* caller); void HandleActiveChange(CGuiTableGroup* active);
void DoMenuAdvance(const CGuiTableGroup* caller); void DeactivatePopup();
void ActivatePopup();
void DoPopupCancel(const CGuiTableGroup* caller);
void DoPopupAdvance(const CGuiTableGroup* caller);
void DoFileselectCancel(const CGuiTableGroup* caller);
void DoSelectionChange(const CGuiTableGroup* caller);
void DoFileselectAdvance(const CGuiTableGroup* caller);
}; };
struct SGBASupportFrame struct SGBASupportFrame
@ -126,9 +153,9 @@ public:
TLockedToken<CGuiFrame> xc_gbaScreen; TLockedToken<CGuiFrame> xc_gbaScreen;
TLockedToken<CGuiFrame> x18_gbaLink; TLockedToken<CGuiFrame> x18_gbaLink;
CGuiFrame* x24_loadedFrame = nullptr; CGuiFrame* x24_loadedFrame = nullptr;
CGuiWidget* x28_ = nullptr; CGuiTableGroup* x28_tablegroup_options = nullptr;
CGuiWidget* x2c_ = nullptr; CGuiTableGroup* x2c_tablegroup_fusionsuit = nullptr;
SGuiTextPair x30_; SGuiTextPair x30_textpane_instructions;
bool x38_ = false; bool x38_ = false;
bool x39_ = false; bool x39_ = false;
bool x3a_ = false; bool x3a_ = false;
@ -136,6 +163,12 @@ public:
SGBASupportFrame(); SGBASupportFrame();
void FinishedLoading(); void FinishedLoading();
bool PumpLoad(); bool PumpLoad();
void SetTableColors(CGuiTableGroup* tbgp) const;
void ProcessUserInput(const CFinalInput& input, CSaveUI* sui);
void DoOptionsCancel(const CGuiTableGroup* caller);
void DoSelectionChange(const CGuiTableGroup* caller);
void DoOptionsAdvance(const CGuiTableGroup* caller);
}; };
struct SFrontEndFrame struct SFrontEndFrame
@ -149,9 +182,11 @@ public:
SFrontEndFrame(u32 rnd); SFrontEndFrame(u32 rnd);
void FinishedLoading(); void FinishedLoading();
bool PumpLoad(); bool PumpLoad();
void ProcessUserInput(const CFinalInput& input);
void DoMenuSelectionChange(const CGuiTableGroup* caller); void DoCancel(const CGuiTableGroup* caller);
void DoMenuAdvance(const CGuiTableGroup* caller); void DoSelectionChange(const CGuiTableGroup* caller);
void DoAdvance(const CGuiTableGroup* caller);
}; };
struct SFusionBonusFrame struct SFusionBonusFrame
@ -164,6 +199,7 @@ public:
bool x15_ = true; bool x15_ = true;
SFusionBonusFrame(); SFusionBonusFrame();
void ProcessUserInput(const CFinalInput& input, CSaveUI* sui);
bool DoUpdateWithSaveUI(float dt, CSaveUI* saveUi); bool DoUpdateWithSaveUI(float dt, CSaveUI* saveUi);
}; };
@ -192,6 +228,7 @@ public:
}; };
}; };
SOptionsFrontEndFrame(); SOptionsFrontEndFrame();
void ProcessUserInput(const CFinalInput& input, CSaveUI* sui);
}; };
private: private:

View File

@ -22,5 +22,10 @@ CGBASupport::~CGBASupport()
SharedInstance = nullptr; SharedInstance = nullptr;
} }
bool CGBASupport::IsReady() const
{
return false;
}
} }
} }

View File

@ -23,6 +23,7 @@ class CGBASupport : public CDvdFile
public: public:
CGBASupport(); CGBASupport();
~CGBASupport(); ~CGBASupport();
bool IsReady() const;
}; };
} }