mirror of https://github.com/AxioDL/metaforce.git
CGuiWidget: Provide names for all function prototypes
Makes parameter introspection nicer with IDEs and also renames ambiguous "v" names to something more self-descriptive.
This commit is contained in:
parent
0db6f96a17
commit
59fbefbd58
|
@ -161,27 +161,30 @@ void CGuiWidget::AddChildWidget(CGuiWidget* widget, bool makeWorldLocal, bool at
|
||||||
|
|
||||||
bool CGuiWidget::AddWorkerWidget(CGuiWidget* worker) { return false; }
|
bool CGuiWidget::AddWorkerWidget(CGuiWidget* worker) { return false; }
|
||||||
|
|
||||||
void CGuiWidget::SetVisibility(bool vis, ETraversalMode mode) {
|
void CGuiWidget::SetVisibility(bool visible, ETraversalMode mode) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case ETraversalMode::Children: {
|
case ETraversalMode::Children: {
|
||||||
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
auto* child = static_cast<CGuiWidget*>(GetChildObject());
|
||||||
if (child)
|
if (child) {
|
||||||
child->SetVisibility(vis, ETraversalMode::ChildrenAndSiblings);
|
child->SetVisibility(visible, ETraversalMode::ChildrenAndSiblings);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ETraversalMode::ChildrenAndSiblings: {
|
case ETraversalMode::ChildrenAndSiblings: {
|
||||||
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
|
auto* child = static_cast<CGuiWidget*>(GetChildObject());
|
||||||
if (child)
|
if (child) {
|
||||||
child->SetVisibility(vis, ETraversalMode::ChildrenAndSiblings);
|
child->SetVisibility(visible, ETraversalMode::ChildrenAndSiblings);
|
||||||
CGuiWidget* nextSib = static_cast<CGuiWidget*>(GetNextSibling());
|
}
|
||||||
if (nextSib)
|
auto* nextSib = static_cast<CGuiWidget*>(GetNextSibling());
|
||||||
nextSib->SetVisibility(vis, ETraversalMode::ChildrenAndSiblings);
|
if (nextSib) {
|
||||||
|
nextSib->SetVisibility(visible, ETraversalMode::ChildrenAndSiblings);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SetIsVisible(vis);
|
SetIsVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiWidget::RecalcWidgetColor(ETraversalMode mode) {
|
void CGuiWidget::RecalcWidgetColor(ETraversalMode mode) {
|
||||||
|
@ -247,16 +250,18 @@ void CGuiWidget::SetColor(const zeus::CColor& color) {
|
||||||
void CGuiWidget::OnActiveChange() {}
|
void CGuiWidget::OnActiveChange() {}
|
||||||
void CGuiWidget::OnVisibleChange() {}
|
void CGuiWidget::OnVisibleChange() {}
|
||||||
|
|
||||||
void CGuiWidget::SetIsVisible(bool vis) {
|
void CGuiWidget::SetIsVisible(bool visible) {
|
||||||
xb6_25_isVisible = vis;
|
xb6_25_isVisible = visible;
|
||||||
OnVisibleChange();
|
OnVisibleChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiWidget::SetIsActive(bool a) {
|
void CGuiWidget::SetIsActive(bool active) {
|
||||||
if (a != xb6_26_isActive) {
|
if (active == xb6_26_isActive) {
|
||||||
xb6_26_isActive = a;
|
return;
|
||||||
OnActiveChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xb6_26_isActive = active;
|
||||||
|
OnActiveChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -122,24 +122,24 @@ public:
|
||||||
const zeus::CColor& GetGeometryColor() const { return xa8_color2; }
|
const zeus::CColor& GetGeometryColor() const { return xa8_color2; }
|
||||||
void SetIdlePosition(const zeus::CVector3f& pos, bool reapply);
|
void SetIdlePosition(const zeus::CVector3f& pos, bool reapply);
|
||||||
void ReapplyXform();
|
void ReapplyXform();
|
||||||
virtual void SetIsVisible(bool);
|
virtual void SetIsVisible(bool visible);
|
||||||
void SetIsActive(bool);
|
void SetIsActive(bool active);
|
||||||
bool GetIsSelectable() const { return xb6_27_isSelectable; }
|
bool GetIsSelectable() const { return xb6_27_isSelectable; }
|
||||||
void SetIsSelectable(bool v) { xb6_27_isSelectable = v; }
|
void SetIsSelectable(bool selectable) { xb6_27_isSelectable = selectable; }
|
||||||
void SetMouseActive(bool v) { m_mouseActive = v; }
|
void SetMouseActive(bool mouseActive) { m_mouseActive = mouseActive; }
|
||||||
|
|
||||||
void ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms);
|
void ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms);
|
||||||
void AddChildWidget(CGuiWidget* widget, bool makeWorldLocal, bool atEnd);
|
void AddChildWidget(CGuiWidget* widget, bool makeWorldLocal, bool atEnd);
|
||||||
void SetVisibility(bool, ETraversalMode);
|
void SetVisibility(bool visible, ETraversalMode mode);
|
||||||
void RecalcWidgetColor(ETraversalMode);
|
void RecalcWidgetColor(ETraversalMode mode);
|
||||||
void SetColor(const zeus::CColor& color);
|
void SetColor(const zeus::CColor& color);
|
||||||
void InitializeRGBAFactor();
|
void InitializeRGBAFactor();
|
||||||
CGuiWidget* FindWidget(s16 id);
|
CGuiWidget* FindWidget(s16 id);
|
||||||
bool GetIsFinishedLoading();
|
bool GetIsFinishedLoading();
|
||||||
void DispatchInitialize();
|
void DispatchInitialize();
|
||||||
void SetDepthGreater(bool v) { xb6_30_depthGreater = v; }
|
void SetDepthGreater(bool depthGreater) { xb6_30_depthGreater = depthGreater; }
|
||||||
void SetDepthTest(bool v) { xb6_31_depthTest = v; }
|
void SetDepthTest(bool depthTest) { xb6_31_depthTest = depthTest; }
|
||||||
void SetDepthWrite(bool v) { xb7_24_depthWrite = v; }
|
void SetDepthWrite(bool depthWrite) { xb7_24_depthWrite = depthWrite; }
|
||||||
|
|
||||||
CGuiFrame* GetGuiFrame() const { return xb0_frame; }
|
CGuiFrame* GetGuiFrame() const { return xb0_frame; }
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue