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:
Lioncash 2020-03-29 01:49:27 -04:00
parent 0db6f96a17
commit 59fbefbd58
2 changed files with 31 additions and 26 deletions

View File

@ -161,27 +161,30 @@ void CGuiWidget::AddChildWidget(CGuiWidget* widget, bool makeWorldLocal, bool at
bool CGuiWidget::AddWorkerWidget(CGuiWidget* worker) { return false; }
void CGuiWidget::SetVisibility(bool vis, ETraversalMode mode) {
void CGuiWidget::SetVisibility(bool visible, ETraversalMode mode) {
switch (mode) {
case ETraversalMode::Children: {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
if (child)
child->SetVisibility(vis, ETraversalMode::ChildrenAndSiblings);
auto* child = static_cast<CGuiWidget*>(GetChildObject());
if (child) {
child->SetVisibility(visible, ETraversalMode::ChildrenAndSiblings);
}
break;
}
case ETraversalMode::ChildrenAndSiblings: {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
if (child)
child->SetVisibility(vis, ETraversalMode::ChildrenAndSiblings);
CGuiWidget* nextSib = static_cast<CGuiWidget*>(GetNextSibling());
if (nextSib)
nextSib->SetVisibility(vis, ETraversalMode::ChildrenAndSiblings);
auto* child = static_cast<CGuiWidget*>(GetChildObject());
if (child) {
child->SetVisibility(visible, ETraversalMode::ChildrenAndSiblings);
}
auto* nextSib = static_cast<CGuiWidget*>(GetNextSibling());
if (nextSib) {
nextSib->SetVisibility(visible, ETraversalMode::ChildrenAndSiblings);
}
break;
}
default:
break;
}
SetIsVisible(vis);
SetIsVisible(visible);
}
void CGuiWidget::RecalcWidgetColor(ETraversalMode mode) {
@ -247,16 +250,18 @@ void CGuiWidget::SetColor(const zeus::CColor& color) {
void CGuiWidget::OnActiveChange() {}
void CGuiWidget::OnVisibleChange() {}
void CGuiWidget::SetIsVisible(bool vis) {
xb6_25_isVisible = vis;
void CGuiWidget::SetIsVisible(bool visible) {
xb6_25_isVisible = visible;
OnVisibleChange();
}
void CGuiWidget::SetIsActive(bool a) {
if (a != xb6_26_isActive) {
xb6_26_isActive = a;
OnActiveChange();
void CGuiWidget::SetIsActive(bool active) {
if (active == xb6_26_isActive) {
return;
}
xb6_26_isActive = active;
OnActiveChange();
}
} // namespace urde

View File

@ -122,24 +122,24 @@ public:
const zeus::CColor& GetGeometryColor() const { return xa8_color2; }
void SetIdlePosition(const zeus::CVector3f& pos, bool reapply);
void ReapplyXform();
virtual void SetIsVisible(bool);
void SetIsActive(bool);
virtual void SetIsVisible(bool visible);
void SetIsActive(bool active);
bool GetIsSelectable() const { return xb6_27_isSelectable; }
void SetIsSelectable(bool v) { xb6_27_isSelectable = v; }
void SetMouseActive(bool v) { m_mouseActive = v; }
void SetIsSelectable(bool selectable) { xb6_27_isSelectable = selectable; }
void SetMouseActive(bool mouseActive) { m_mouseActive = mouseActive; }
void ParseBaseInfo(CGuiFrame* frame, CInputStream& in, const CGuiWidgetParms& parms);
void AddChildWidget(CGuiWidget* widget, bool makeWorldLocal, bool atEnd);
void SetVisibility(bool, ETraversalMode);
void RecalcWidgetColor(ETraversalMode);
void SetVisibility(bool visible, ETraversalMode mode);
void RecalcWidgetColor(ETraversalMode mode);
void SetColor(const zeus::CColor& color);
void InitializeRGBAFactor();
CGuiWidget* FindWidget(s16 id);
bool GetIsFinishedLoading();
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; }
void SetDepthGreater(bool depthGreater) { xb6_30_depthGreater = depthGreater; }
void SetDepthTest(bool depthTest) { xb6_31_depthTest = depthTest; }
void SetDepthWrite(bool depthWrite) { xb7_24_depthWrite = depthWrite; }
CGuiFrame* GetGuiFrame() const { return xb0_frame; }
};