#include "OperatingSystemWidgetBase.h"
This is an abstract base class that represents an operating system widget. It inherits from UCommonUserWidget and IOperatingSystemThemeInterface. It provides functionality to set the operating system, handle theme changes, and call blueprint events.
◆ UOperatingSystemWidgetBase()
UOperatingSystemWidgetBase::UOperatingSystemWidgetBase |
( |
| ) |
|
◆ DestroyOperatingSystemBaseWidget()
void UOperatingSystemWidgetBase::DestroyOperatingSystemBaseWidget |
( |
| ) |
|
Destroys the operating system base widget.
This function is called to destroy the operating system base widget. It performs the following actions:
- Calls the OnDestroyWidget() virtual function.
- Sets the ParentOS pointer to nullptr.
- Removes the widget from its parent.
- See also
- UOperatingSystemWidgetBase::OnDestroyWidget()
-
UOperatingSystemWidgetBase::RemoveFromParent()
◆ K2_OnSetOperatingSystem()
void UOperatingSystemWidgetBase::K2_OnSetOperatingSystem |
( |
| ) |
|
|
protected |
Blueprint event called when the operating system is set.
This event is called when the operating system for the widget is set using the SetOperatingSystem() function. Blueprint implementations can override this event to perform additional actions or handle the operating system change.
- Note
- This is a BlueprintImplementableEvent, meaning it can be implemented in blueprint.
- See also
- UOperatingSystemWidgetBase::SetOperatingSystem()
◆ NativeConstruct()
void UOperatingSystemWidgetBase::NativeConstruct |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ OnDestroyWidget()
virtual OPERATINGSYSTEMSIMULATOR_API void UOperatingSystemWidgetBase::OnDestroyWidget |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ SetOperatingSystem()
Sets the given new Operating System as Parent OS and calls OnSetOperatingSystem event in Blueprint
- Parameters
-
◆ ThemeChanged()
Callback function for handling theme changes in the operating system widget.
This function is invoked when the operating system theme is changed. It takes a ThemePayload parameter, which is an instance of the UOperatingSystemSettingModule_Theme class. ThemePayload contains information about the new theme that is being applied.
The function first checks if there are any blueprint events registered for handling theme changes. If there are, it calls the Execute_K2_OnOperatingSystemThemeChanged() function, passing this widget instance and the ThemePayload.
- Parameters
-
ThemePayload | A pointer to the theme payload object that contains information about the new theme. |
◆ ParentOS
UOperatingSystemWidgetBase::ParentOS |
|
protected |
A pointer to the parent operating system of the operating system widget.
This variable is a UObjectPtr that points to a UOperatingSystem object. It is marked as BlueprintReadOnly, which means it can be read from blueprints but not modified. It belongs to the OperatingSystemWidgetBase category and is exposed on spawn.
This variable is used to set and retrieve the operating system for the widget. The SetOperatingSystem() function can be called to set a new operating system, which will trigger the OnSetOperatingSystem event in the blueprint. The ParentOS variable is checked against the new OS to avoid unnecessary updates. If the ParentOS is invalid, the widget will be destroyed.
- See also
- UOperatingSystem
-
UOperatingSystemWidgetBase::SetOperatingSystem()
-
UOperatingSystemWidgetBase::OnSetOperatingSystem()
The documentation for this class was generated from the following files: