Refactor UI Control actor active state mirroring in UI via Visible properties rather than unlinked from parent

#2242 #851
This commit is contained in:
Wojtek Figat
2024-03-11 19:10:13 +01:00
parent 1bbb2727b8
commit 0a9f746abb
3 changed files with 13 additions and 34 deletions

View File

@@ -17,7 +17,7 @@ MMethod* UIControl_Deserialize = nullptr;
MMethod* UIControl_ParentChanged = nullptr;
MMethod* UIControl_TransformChanged = nullptr;
MMethod* UIControl_OrderInParentChanged = nullptr;
MMethod* UIControl_ActiveInTreeChanged = nullptr;
MMethod* UIControl_ActiveChanged = nullptr;
MMethod* UIControl_BeginPlay = nullptr;
MMethod* UIControl_EndPlay = nullptr;
@@ -46,7 +46,7 @@ UIControl::UIControl(const SpawnParams& params)
UIControl_ParentChanged = mclass->GetMethod("ParentChanged");
UIControl_TransformChanged = mclass->GetMethod("TransformChanged");
UIControl_OrderInParentChanged = mclass->GetMethod("OrderInParentChanged");
UIControl_ActiveInTreeChanged = mclass->GetMethod("ActiveInTreeChanged");
UIControl_ActiveChanged = mclass->GetMethod("ActiveChanged");
UIControl_BeginPlay = mclass->GetMethod("BeginPlay");
UIControl_EndPlay = mclass->GetMethod("EndPlay");
UIControl_Serialize = mclass->GetMethod("Serialize", 2);
@@ -207,12 +207,12 @@ void UIControl::OnOrderInParentChanged()
UICONTROL_INVOKE(OrderInParentChanged);
}
void UIControl::OnActiveInTreeChanged()
void UIControl::OnActiveChanged()
{
UICONTROL_INVOKE(ActiveInTreeChanged);
UICONTROL_INVOKE(ActiveChanged);
// Base
Actor::OnActiveInTreeChanged();
Actor::OnActiveChanged();
}
#if !COMPILE_WITHOUT_CSHARP