2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 13:47:43 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -1,67 +1,51 @@
#include "CGuiGroup.hpp"
namespace urde
{
namespace urde {
void CGuiGroup::LoadWidgetFnMap()
{
}
void CGuiGroup::LoadWidgetFnMap() {}
CGuiGroup::CGuiGroup(const CGuiWidgetParms& parms, int defaultWorker, bool b)
: CGuiCompoundWidget(parms), xbc_selectedWorker(defaultWorker), xc0_b(b)
{
}
: CGuiCompoundWidget(parms), xbc_selectedWorker(defaultWorker), xc0_b(b) {}
void CGuiGroup::SelectWorkerWidget(int workerId, bool setActive, bool setVisible)
{
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child)
{
if (child->GetWorkerId() == workerId)
{
CGuiWidget* sel = GetSelectedWidget();
if (setActive)
{
sel->SetIsActive(false);
child->SetIsActive(true);
}
if (setVisible)
{
sel->SetVisibility(false, ETraversalMode::Single);
child->SetVisibility(true, ETraversalMode::Single);
}
break;
}
child = static_cast<CGuiWidget*>(child->GetNextSibling());
void CGuiGroup::SelectWorkerWidget(int workerId, bool setActive, bool setVisible) {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
while (child) {
if (child->GetWorkerId() == workerId) {
CGuiWidget* sel = GetSelectedWidget();
if (setActive) {
sel->SetIsActive(false);
child->SetIsActive(true);
}
if (setVisible) {
sel->SetVisibility(false, ETraversalMode::Single);
child->SetVisibility(true, ETraversalMode::Single);
}
break;
}
child = static_cast<CGuiWidget*>(child->GetNextSibling());
}
}
CGuiWidget* CGuiGroup::GetSelectedWidget()
{
return GetWorkerWidget(xbc_selectedWorker);
CGuiWidget* CGuiGroup::GetSelectedWidget() { return GetWorkerWidget(xbc_selectedWorker); }
bool CGuiGroup::AddWorkerWidget(CGuiWidget* worker) {
++xb8_workerCount;
return true;
}
bool CGuiGroup::AddWorkerWidget(CGuiWidget* worker)
{
++xb8_workerCount;
return true;
void CGuiGroup::OnActiveChange() {
CGuiWidget* sel = GetSelectedWidget();
if (sel)
sel->SetIsActive(true);
}
void CGuiGroup::OnActiveChange()
{
CGuiWidget* sel = GetSelectedWidget();
if (sel)
sel->SetIsActive(true);
std::shared_ptr<CGuiWidget> CGuiGroup::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp) {
CGuiWidgetParms parms = ReadWidgetHeader(frame, in);
s16 defaultWorker = in.readInt16Big();
bool b = in.readBool();
std::shared_ptr<CGuiWidget> ret = std::make_shared<CGuiGroup>(parms, defaultWorker, b);
ret->ParseBaseInfo(frame, in, parms);
return ret;
}
std::shared_ptr<CGuiWidget> CGuiGroup::Create(CGuiFrame* frame, CInputStream& in, CSimplePool* sp)
{
CGuiWidgetParms parms = ReadWidgetHeader(frame, in);
s16 defaultWorker = in.readInt16Big();
bool b = in.readBool();
std::shared_ptr<CGuiWidget> ret = std::make_shared<CGuiGroup>(parms, defaultWorker, b);
ret->ParseBaseInfo(frame, in, parms);
return ret;
}
}
} // namespace urde