Touch Interface Designer 2025.2
Create touch interface with a visual editor and manage all mobile inputs like gestures
Loading...
Searching...
No Matches
LayoutGroupComponent.h
Go to the documentation of this file.
1// Copyright 2024 Lost in Game Studio. All Rights Reserved.
2
3#pragma once
4
5#include "LayoutComponent.h"
7#include "LayoutGroupComponent.generated.h"
8
10
12UCLASS()
13class TOUCHINTERFACE_API ULayoutGroupComponent : public ULayoutComponent
14{
15 GENERATED_BODY()
16
17public:
19
20 virtual void BeginDestroy() override;
21
22 virtual TSharedRef<SLayoutComponent> TakeWidget(SConstraintCanvas::FSlot* WidgetSlot, TSharedPtr<STouchInterface> LayoutWidget, ULocalPlayer* LocalPlayer, TSharedPtr<SLayoutComponent> InParent = nullptr) override;
23
24 virtual TArray<ULayoutComponent*> GetChildren();
25
26
27#if WITH_EDITOR
28 virtual void OnBeginEditByEditor() override;
29 virtual void OnEndEditByEditor() override;
30
31 virtual TSharedRef<SLayoutComponent> TakeEditorWidget(SConstraintCanvas::FSlot* WidgetSlot, TSharedPtr<STouchInterface> LayoutWidget, TSharedPtr<SLayoutComponent> InParent = nullptr) override;
32
33 void CheckChildrenValidity();
34#endif
35
36
37 //TODO: Maybe remove this function and add create child function in function library
43 UFUNCTION(Category="Group Input Component", BlueprintCallable)
44 virtual ULayoutComponent* AddChild(const FName DesiredName, const FVector2D ChildPosition, FVector2D ChildSize, const TSubclassOf<UComponentLogic> ChildLogicClass);
45
47 UFUNCTION(Category="Group Input Component", BlueprintCallable)
48 virtual void AddChildByRef(ULayoutComponent* LayoutComponentInstance);
49
50 // Remove component from group
51 UFUNCTION(Category="Group Input Component", BlueprintCallable)
52 virtual void RemoveComponentFromGroup(ULayoutComponent* Component);
53
54 // Remove component from group
55 UFUNCTION(Category="Group Input Component", BlueprintCallable)
56 virtual void RemoveComponentByName(const FName ComponentName);
57
58
59 // Displays all components in group
60 UFUNCTION(Category="Group Input Component|Visibility", BlueprintCallable)
61 virtual void ShowAllComponentsInGroup();
62
63 // Hide all components in group
64 UFUNCTION(Category="Group Input Component|Visibility", BlueprintCallable)
65 virtual void HideAllComponentsInGroup();
66
67 // Displays all components except the named one
68 UFUNCTION(Category="Group Input Component|Visibility", BlueprintCallable)
69 virtual void ShowAllExcept(const FName Name);
70
71 // Hide all components except the named one
72 UFUNCTION(Category="Group Input Component|Visibility", BlueprintCallable)
73 virtual void HideAllExcept(const FName Name);
74
75 // Displays all components except the named one
76 UFUNCTION(Category="Group Input Component|Visibility", BlueprintCallable)
77 virtual void ShowAllExceptNamedOnes(const TArray<FName> Names);
78
79 // Hide all components except the named one
80 UFUNCTION(Category="Group Input Component|Visibility", BlueprintCallable)
81 virtual void HideAllExceptNamedOnes(const TArray<FName> Names);
82
83
86 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable)
87 virtual bool ContainComponent(const ULayoutComponent* Component);
88
91 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable)
92 virtual bool ContainComponentByName(const FName ComponentName) const;
93
96 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable)
97 virtual bool GetAllComponentsInGroup(TArray<ULayoutComponent*>& Components);
98
101 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable)
102 virtual ULayoutComponent* GetComponentByName(const FName Name) const;
103
108 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable)
109 virtual bool GetComponentsByLogicClass(const TSubclassOf<UComponentLogic> Class, const bool bIncludeInherited, TArray<ULayoutComponent*>& Components);
110
111 // Returns index of component
112 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable, BlueprintPure)
113 int32 GetIndexOfComponent(ULayoutComponent* Component);
114
117 UFUNCTION(Category="Group Input Component|Utility", BlueprintCallable)
118 virtual bool GetAllComponentNameInGroup(TArray<FName>& Names);
119
120
121 //TODO: Use Instanced meta (deep copy instead of shallow copy)
122 UPROPERTY()
123 TArray<TObjectPtr<ULayoutComponent>> Children;
124
125 //TODO: Make custom detail because we need to hide some properties if this bool == false
131};
Definition STouchInterfaceRuntime.h:30
BlueprintReadOnly
Definition LayoutComponent.h:506
ULayoutComponent()
Definition LayoutComponent.cpp:24
BlueprintCallable
Definition LayoutGroupComponent.h:112
BlueprintPure int32 GetIndexOfComponent(ULayoutComponent *Component)
Definition LayoutGroupComponent.cpp:456
virtual BlueprintCallable bool ContainComponentByName(const FName ComponentName) const
Definition LayoutGroupComponent.cpp:398
virtual BlueprintCallable void RemoveComponentFromGroup(ULayoutComponent *Component)
Definition LayoutGroupComponent.cpp:297
EditAnywhere
Definition LayoutGroupComponent.h:129
virtual BlueprintCallable ULayoutComponent * AddChild(const FName DesiredName, const FVector2D ChildPosition, FVector2D ChildSize, const TSubclassOf< UComponentLogic > ChildLogicClass)
Definition LayoutGroupComponent.cpp:188
virtual BlueprintCallable void HideAllExcept(const FName Name)
Definition LayoutGroupComponent.cpp:360
virtual BlueprintCallable bool GetAllComponentsInGroup(TArray< ULayoutComponent * > &Components)
Definition LayoutGroupComponent.cpp:411
virtual TArray< ULayoutComponent * > GetChildren()
Definition LayoutGroupComponent.cpp:104
TArray< TObjectPtr< ULayoutComponent > > Children
Definition LayoutGroupComponent.h:123
virtual BlueprintCallable void RemoveComponentByName(const FName ComponentName)
Definition LayoutGroupComponent.cpp:319
virtual TSharedRef< SLayoutComponent > TakeWidget(SConstraintCanvas::FSlot *WidgetSlot, TSharedPtr< STouchInterface > LayoutWidget, ULocalPlayer *LocalPlayer, TSharedPtr< SLayoutComponent > InParent=nullptr) override
Definition LayoutGroupComponent.cpp:32
virtual BlueprintCallable void AddChildByRef(ULayoutComponent *LayoutComponentInstance)
Definition LayoutGroupComponent.cpp:237
virtual BlueprintCallable void ShowAllExceptNamedOnes(const TArray< FName > Names)
Definition LayoutGroupComponent.cpp:371
BlueprintReadOnly uint8 bSupportInput
Definition LayoutGroupComponent.h:130
virtual BlueprintCallable void ShowAllExcept(const FName Name)
Definition LayoutGroupComponent.cpp:349
virtual BlueprintCallable void HideAllExceptNamedOnes(const TArray< FName > Names)
Definition LayoutGroupComponent.cpp:382
virtual void BeginDestroy() override
Definition LayoutGroupComponent.cpp:20
virtual BlueprintCallable ULayoutComponent * GetComponentByName(const FName Name) const
Definition LayoutGroupComponent.cpp:417
virtual BlueprintCallable bool ContainComponent(const ULayoutComponent *Component)
Definition LayoutGroupComponent.cpp:393
virtual BlueprintCallable bool GetComponentsByLogicClass(const TSubclassOf< UComponentLogic > Class, const bool bIncludeInherited, TArray< ULayoutComponent * > &Components)
Definition LayoutGroupComponent.cpp:431
ULayoutGroupComponent()
Definition LayoutGroupComponent.cpp:12
Category
Definition LayoutGroupComponent.h:43
virtual BlueprintCallable bool GetAllComponentNameInGroup(TArray< FName > &Names)
Definition LayoutGroupComponent.cpp:470
virtual BlueprintCallable void HideAllComponentsInGroup()
Definition LayoutGroupComponent.cpp:341
virtual BlueprintCallable void ShowAllComponentsInGroup()
Definition LayoutGroupComponent.cpp:333