Skip to content

UOperatingSystemBaseDevice

#include <OperatingSystemSimulator/Public/Devices/OperatingSystemBaseDevice.h>
class UOperatingSystemBaseDevice

Defined in OperatingSystemBaseDevice.h:46

Inherits: UObject

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemBaseDevice["UOperatingSystemBaseDevice"]
  class UObject["UObject"]
  UObject <|-- UOperatingSystemBaseDevice
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemBaseDevice["UOperatingSystemBaseDevice"]
  class UOperatingSystemDeviceWidget["UOperatingSystemDeviceWidget"]
  UOperatingSystemBaseDevice *-- UOperatingSystemDeviceWidget
  class UOperatingSystem["UOperatingSystem"]
  UOperatingSystemBaseDevice *-- UOperatingSystem
  class EOperatingSystemDeviceStartupType["EOperatingSystemDeviceStartupType"]
  UOperatingSystemBaseDevice ..> EOperatingSystemDeviceStartupType
  class FOperatingSystemRangeTime["FOperatingSystemRangeTime"]
  UOperatingSystemBaseDevice *-- FOperatingSystemRangeTime
  class UOperatingSystemMBB["UOperatingSystemMBB"]
  UOperatingSystemBaseDevice *-- UOperatingSystemMBB
  class EOperatingSystemDeviceState["EOperatingSystemDeviceState"]
  UOperatingSystemBaseDevice ..> EOperatingSystemDeviceState
  class UOperatingSystemBaseHardware["UOperatingSystemBaseHardware"]
  UOperatingSystemBaseDevice *-- UOperatingSystemBaseHardware
  class AOperatingSystemDeviceActor["AOperatingSystemDeviceActor"]
  UOperatingSystemBaseDevice *-- AOperatingSystemDeviceActor
  class UOperatingSystemBiosWidget["UOperatingSystemBiosWidget"]
  UOperatingSystemBaseDevice *-- UOperatingSystemBiosWidget
  class UOperatingSystemSaveGame["UOperatingSystemSaveGame"]
  UOperatingSystemBaseDevice *-- UOperatingSystemSaveGame
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemBaseDevice {
    +OnOperatingSystemStartedDelegate : FOnOperatingSystemStartedDelegate()
    +OnDeviceStateChanged : FOnDeviceStateChanged
    +DeviceCreated(AOperatingSystemDeviceActor *OwningDeviceAc
    +DestroyDevice()
    +ClearOnScreenWidget() const
    +ApplyWidgetToScreen() const
    +ReApplyWidget() const
    +ClockTick()
    +OpenBIOS(TWeakObjectPtr< UOperatingSystemBiosWidget 
    +OnFinishOperatingSystemInstallation() bool
    +OnFinishSettingUpOperatingSystemPostInstallation() const
    +ShowBSOD() bool
    +StartOperatingSystem(FGenericError &OutError)
    +DeviceSessionEnd(const bool bShouldRestart)
    +GetMessenger() const UOperatingSystemDeviceMessenger() *
    +GetCurrentOperatingSystem() const UOperatingSystem() *
    +GetOperatingSystemClass() const TSoftClassPtr< UOperatingSystem() >
    +GetHardwareByTag(const FGameplayTag TestTag) const UOperatingSystemBaseHardware() *
    +GetHardwareByTag(const FGameplayTag &TestTag) const T *
    +GetCurrentState() const EOperatingSystemDeviceState()
    +GetParentDeviceActor() const AOperatingSystemDeviceActor() *
    +GetSaveGameClass() const TSoftClassPtr< UOperatingSystemSaveGame(
    +TimerHandle_SessionEnd : FTimerHandle
    +DeviceName : FText
    +DeviceWidgetClass : TSoftClassPtr< UOperatingSystemDeviceWid
    +OperatingSystemClass : TSoftClassPtr< UOperatingSystem() >
    +DeviceStartupType : EOperatingSystemDeviceStartupType()
    +bOperatingSystemIsPreInstalled_DEPRECATED : bool
    +PowerOnTime : FOperatingSystemRangeTime()
    +SessionEndTime : FOperatingSystemRangeTime()
    +MotherboardClass : TSoftClassPtr< UOperatingSystemMBB() >
    +bRequiresGPU : uint8
    +bOperatingSystemInstalled : uint8
    +DeviceTag : FGameplayTag
    +PreviousState : EOperatingSystemDeviceState()
    +CurrentState : EOperatingSystemDeviceState()
    +ActiveOperatingSystem : TObjectPtr< UOperatingSystem() >
    +DeviceWidget : TObjectPtr< UOperatingSystemDeviceWidget
    +OnScreenWidget : TObjectPtr< UUserWidget >
    +Hardwares : TArray< TObjectPtr< UOperatingSystemBase
    +DeviceActor : TWeakObjectPtr< AOperatingSystemDeviceAc
    +BiosWidget : TWeakObjectPtr< UOperatingSystemBiosWidg
    +LoadGameInstance : TWeakObjectPtr< UOperatingSystemSaveGame
    +ChangeOnScreenWidget(UUserWidget *NewOnScreenWidget=nullptr)
    +CheckHardware(FGenericError &OutError)
    +UpdateDeviceState(const EOperatingSystemDeviceState &NewState bool
    +OnDeviceCreated(FGenericError &OutError)
    +OnDeviceStartRunning()
    +OnDeviceShutdown()
    +OnDeviceRestart()
    +DestroyDeviceAndRestart()
    +Internal_SessionEnd()
    +Internal_OnDeviceSessionEnd(const bool bRestart)
    +Internal_DestroyDevice()
  }

Documented call sites inside the plugin (6):

flowchart LR
  UOperatingSystemBaseDevice__UpdateDeviceState["UOperatingSystemBaseDevice::UpdateDeviceState"]
  UOperatingSystemBaseDevice__DeviceCreated["UOperatingSystemBaseDevice::DeviceCreated"]
  UOperatingSystemBaseDevice__DeviceCreated --> UOperatingSystemBaseDevice__UpdateDeviceState
  UOperatingSystemBaseDevice__DeviceSessionEnd["UOperatingSystemBaseDevice::DeviceSessionEnd"]
  UOperatingSystemBaseDevice__DeviceSessionEnd --> UOperatingSystemBaseDevice__UpdateDeviceState
  UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation["UOperatingSystemBaseDevice::OnFinishOperatingSystemInstallation"]
  UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation --> UOperatingSystemBaseDevice__UpdateDeviceState
  UOperatingSystemBaseDevice__OpenBIOS["UOperatingSystemBaseDevice::OpenBIOS"]
  UOperatingSystemBaseDevice__OpenBIOS --> UOperatingSystemBaseDevice__UpdateDeviceState
  UOperatingSystemBaseDevice__ShowBSOD["UOperatingSystemBaseDevice::ShowBSOD"]
  UOperatingSystemBaseDevice__ShowBSOD --> UOperatingSystemBaseDevice__UpdateDeviceState
  UOperatingSystemBaseDevice__StartOperatingSystem["UOperatingSystemBaseDevice::StartOperatingSystem"]
  UOperatingSystemBaseDevice__StartOperatingSystem --> UOperatingSystemBaseDevice__UpdateDeviceState

Documented call sites inside the plugin (4):

flowchart LR
  UOperatingSystemBaseDevice__GetParentDeviceActor["UOperatingSystemBaseDevice::GetParentDeviceActor"]
  UOperatingSystemBaseDevice__DestroyDeviceAndRestart["UOperatingSystemBaseDevice::DestroyDeviceAndRestart"]
  UOperatingSystemBaseDevice__DestroyDeviceAndRestart --> UOperatingSystemBaseDevice__GetParentDeviceActor
  UOperatingSystemBaseDevice__GetMessenger["UOperatingSystemBaseDevice::GetMessenger"]
  UOperatingSystemBaseDevice__GetMessenger --> UOperatingSystemBaseDevice__GetParentDeviceActor
  UOperatingSystemBaseDevice__Internal_DestroyDevice["UOperatingSystemBaseDevice::Internal_DestroyDevice"]
  UOperatingSystemBaseDevice__Internal_DestroyDevice --> UOperatingSystemBaseDevice__GetParentDeviceActor
  UOperatingSystemBaseDevice__Internal_SessionEnd["UOperatingSystemBaseDevice::Internal_SessionEnd"]
  UOperatingSystemBaseDevice__Internal_SessionEnd --> UOperatingSystemBaseDevice__GetParentDeviceActor

Documented call sites inside the plugin (4):

flowchart LR
  UOperatingSystemBaseDevice__ChangeOnScreenWidget["UOperatingSystemBaseDevice::ChangeOnScreenWidget"]
  UOperatingSystemBaseDevice__DeviceCreated["UOperatingSystemBaseDevice::DeviceCreated"]
  UOperatingSystemBaseDevice__DeviceCreated --> UOperatingSystemBaseDevice__ChangeOnScreenWidget
  UOperatingSystemBaseDevice__Internal_DestroyDevice["UOperatingSystemBaseDevice::Internal_DestroyDevice"]
  UOperatingSystemBaseDevice__Internal_DestroyDevice --> UOperatingSystemBaseDevice__ChangeOnScreenWidget
  UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation["UOperatingSystemBaseDevice::OnFinishOperatingSystemInstallation"]
  UOperatingSystemBaseDevice__OnFinishOperatingSystemInstallation --> UOperatingSystemBaseDevice__ChangeOnScreenWidget
  UOperatingSystemBaseDevice__StartOperatingSystem["UOperatingSystemBaseDevice::StartOperatingSystem"]
  UOperatingSystemBaseDevice__StartOperatingSystem --> UOperatingSystemBaseDevice__ChangeOnScreenWidget

This class represents a device that can run an operating system. It contains properties related to the device hardware, the operating system that the device is running, and the device state. It also provides functions to start and stop the operating system, manage the device’s on-screen widget, and update the device state.

ReturnNameDescription
FOnOperatingSystemStartedDelegateOnOperatingSystemStartedDelegateDelegate for handling the event when the operating system has started.
FOnDeviceStateChangedOnDeviceStateChangedA BlueprintAssignable event that is raised when the device state changes. This event can be bound to a delegate or a blueprint function to receive notifications when the device state changes.

FOnOperatingSystemStartedDelegate OnOperatingSystemStartedDelegate

Defined in OperatingSystemBaseDevice.h:230 Delegate for handling the event when the operating system has started.

This delegate is used to define a callback function that will be called when the operating system has started. It is used in conjunction with the OnOperatingSystemStarted event to provide a way to handle the event and perform any desired actions.

Use the BindDynamic function to bind a specific function to this delegate. The bound function will be called when the OnOperatingSystemStarted event is broadcast.

See also: OnOperatingSystemStarted event


FOnDeviceStateChanged OnDeviceStateChanged

Defined in OperatingSystemBaseDevice.h:237 A BlueprintAssignable event that is raised when the device state changes. This event can be bound to a delegate or a blueprint function to receive notifications when the device state changes.

ReturnNameDescription
voidDeviceCreatedCreates a new operating system device.
voidDestroyDeviceDestroys the operating system device.
voidClearOnScreenWidget constRemove the on-screen widget from the device’s viewport if it is currently valid and visible.
voidApplyWidgetToScreen constApplies the device’s on-screen widget to the viewport, allowing it to be displayed on the screen. The widget will only be added if it is valid and if the device actor can add widgets to the screen.
voidReApplyWidget constReapplies the widget to the device actor.
voidClockTickNot implemented yet.
voidOpenBIOSOpens the BIOS widget for the operating system device and sets it as the active widget. The BIOS widget is responsible for displaying BIOS-related information and providing options to interact with the device’s BIOS settings.
boolOnFinishOperatingSystemInstallationExecuted when the operating system installation process completes successfully. It updates the device state to indicate that the operating system is installed, logs the installation, and determines whether a restart is required. If a restart is not required (e.g., device startup type is not set to “FullBoot”), it only updates the device state and returns false. If a restart is required, it updates the device state, clears the restart timer handle, destroys the device, restarts the system, changes the on-screen widget to the device widget, and returns true.
voidOnFinishSettingUpOperatingSystemPostInstallation constFunction to be called after the operating system has finished setting up post installation.
boolShowBSODDisplays the Blue Screen of Death (BSOD) on the operating system device. It updates the device state to indicate that the device is currently in a BSOD state.
voidStartOperatingSystemStarts the operating system on the base device. It checks if the loaded game instance is valid, then compares the operating system ID of the loaded device with the ID of the active operating system. If they do not match, an error is generated and the device’s on-screen widget is updated to indicate the operating system mismatch. The active operating system is marked as garbage and set to nullptr.
voidDeviceSessionEndEnd the session of the operating system device.
UOperatingSystemDeviceMessenger *GetMessenger constGet the device messenger of the operating system base device.
UOperatingSystem *GetCurrentOperatingSystem constReturns the active operating system on the device.
TSoftClassPtr< UOperatingSystem >GetOperatingSystemClass constReturns the class of the operating system associated with this device. The operating system class is represented by the type TSoftClassPtr<UOperatingSystem>.
UOperatingSystemBaseHardware *GetHardwareByTag constRetrieves the hardware object associated with the specified tag.
T *GetHardwareByTag const inlineRetrieves the hardware instance associated with the specified tag.
EOperatingSystemDeviceStateGetCurrentState const inlineGets the current state of the operating system device.
AOperatingSystemDeviceActor *GetParentDeviceActor constRetrieves the parent device actor associated with this operating system device.
TSoftClassPtr< UOperatingSystemSaveGame >GetSaveGameClass constReturns the class pointer to the save game class associated with the device.

void DeviceCreated(AOperatingSystemDeviceActor * OwningDeviceActor, UOperatingSystemSaveGame * NewLoadGameInstance, FGenericError & OutError)

Defined in OperatingSystemBaseDevice.h:266 Creates a new operating system device.

This method initializes the operating system device with the given parameters. It performs the following steps:

  1. Checks if the device name is set. If the name is empty or consists of only whitespace characters, an error is set and the method returns.

  2. Checks if the device widget class is null. If it is null, an error is set and the method returns.

  3. Sets the load game instance and owning device actor properties of the operating system device.

  4. Sets the device tag by getting it from the owning device actor.

  5. Creates an instance of the device widget using the UOperatingSystemDeviceWidget::CreateDeviceWidget() method.

  6. Updates the device state to “Starting” and sets the error parameter if there was an error during the state update.

  7. Changes the on-screen widget of the device to the newly created device widget.

  8. Logs a success message with the name of the device.

  9. Calls the OnDeviceCreated() method to notify listeners that the device was successfully created.

  10. If there was an error during the creation process, ends the device session.

  11. If there were no errors, schedules a timer to update the device state to “Running” after a delay specified by the PowerOnTime property.

  • OwningDeviceActor The owning device actor that represents the physical device in the game world.

  • NewLoadGameInstance The load game instance to use for the operating system device.

  • OutError The error object that receives any errors that occur during the device creation process.


void DestroyDevice()

Defined in OperatingSystemBaseDevice.h:277 Destroys the operating system device.

This function is responsible for destroying the operating system device. It performs the necessary cleanup tasks and notifies the device actor that the device has been destroyed.

Once this function is called, the device will no longer be accessible or functional. Make sure to handle any necessary tasks before calling this function.


const

void ClearOnScreenWidget() const

Defined in OperatingSystemBaseDevice.h:282 Remove the on-screen widget from the device’s viewport if it is currently valid and visible.


const

void ApplyWidgetToScreen() const

Defined in OperatingSystemBaseDevice.h:291 Applies the device’s on-screen widget to the viewport, allowing it to be displayed on the screen. The widget will only be added if it is valid and if the device actor can add widgets to the screen.


const

void ReApplyWidget() const

Defined in OperatingSystemBaseDevice.h:302 Reapplies the widget to the device actor.

This function is called to update the widget of the device actor. It will reapply the widget to the device actor, ensuring that any changes made to the widget are reflected in the device actor’s display.


void ClockTick()

Defined in OperatingSystemBaseDevice.h:305 Not implemented yet.


void OpenBIOS(TWeakObjectPtr< UOperatingSystemBiosWidget > InBiosWidget)

Defined in OperatingSystemBaseDevice.h:320 Opens the BIOS widget for the operating system device and sets it as the active widget. The BIOS widget is responsible for displaying BIOS-related information and providing options to interact with the device’s BIOS settings.

  • InBiosWidget The BIOS widget to be opened for the operating system device. It should be a reference to an instance of UOperatingSystemBiosWidget class. The BIOS widget is responsible for displaying BIOS-related information and providing options to interact with the device’s BIOS settings.

bool OnFinishOperatingSystemInstallation()

Defined in OperatingSystemBaseDevice.h:332 Executed when the operating system installation process completes successfully. It updates the device state to indicate that the operating system is installed, logs the installation, and determines whether a restart is required. If a restart is not required (e.g., device startup type is not set to “FullBoot”), it only updates the device state and returns false. If a restart is required, it updates the device state, clears the restart timer handle, destroys the device, restarts the system, changes the on-screen widget to the device widget, and returns true.

True if a restart is required and the on-screen widget is changed to the device widget, false otherwise.


OnFinishSettingUpOperatingSystemPostInstallation

Section titled “OnFinishSettingUpOperatingSystemPostInstallation”

const

void OnFinishSettingUpOperatingSystemPostInstallation() const

Defined in OperatingSystemBaseDevice.h:346 Function to be called after the operating system has finished setting up post installation.

This function is called after the operating system of the device has finished setting up post installation. It is called internally within the UOperatingSystemBaseDevice class. The function saves the game by calling the SaveGame() function from the UOperatingSystemSaveGame class, passing in the DeviceActor member variable as the argument.


bool ShowBSOD()

Defined in OperatingSystemBaseDevice.h:354 Displays the Blue Screen of Death (BSOD) on the operating system device. It updates the device state to indicate that the device is currently in a BSOD state.

True if the device state was successfully updated to BSOD, false otherwise.


void StartOperatingSystem(FGenericError & OutError)

Defined in OperatingSystemBaseDevice.h:374 Starts the operating system on the base device. It checks if the loaded game instance is valid, then compares the operating system ID of the loaded device with the ID of the active operating system. If they do not match, an error is generated and the device’s on-screen widget is updated to indicate the operating system mismatch. The active operating system is marked as garbage and set to nullptr.

If the operating system IDs match, the “bOperatingSystemInstalled” property of the device is updated based on the “bSaveLoad_OperatingSystemInstalled” property of the loaded device. The device’s on-screen widget is updated with the active operating system’s widget, and the “StartOperatingSystem” function is called on the active operating system with the loaded game instance and the “OutError” parameter.

If an error occurs during the start operation, the device’s state is updated to “BSOD” (Blue Screen of Death). Otherwise, the “OnOperatingSystemStartedDelegate” is executed and a log message is written indicating that the operating system has started.

  • OutError The error message to be populated in case an error occurs during the start operation.

void DeviceSessionEnd(const bool bShouldRestart)

Defined in OperatingSystemBaseDevice.h:386 End the session of the operating system device.

This method is used to end the session of the operating system device. It updates the device state and performs any necessary actions based on the given value of bShouldRestart. If bShouldRestart is true, the device state is updated to “Restarting”. If bShouldRestart is false, the device state is updated to “ShuttingDown”.

  • bShouldRestart Indicates whether the device should be restarted after ending the session.

const

UOperatingSystemDeviceMessenger * GetMessenger() const

Defined in OperatingSystemBaseDevice.h:504 Get the device messenger of the operating system base device.

This method returns the device messenger associated with the operating system base device. The device messenger is responsible for handling device communications, such as sending and receiving messages.

The device messenger of the operating system base device.


const

UOperatingSystem * GetCurrentOperatingSystem() const

Defined in OperatingSystemBaseDevice.h:511 Returns the active operating system on the device.

The current operating system running on the device.


const

TSoftClassPtr< UOperatingSystem > GetOperatingSystemClass() const

Defined in OperatingSystemBaseDevice.h:520 Returns the class of the operating system associated with this device. The operating system class is represented by the type TSoftClassPtr<UOperatingSystem>.

The class of the operating system associated with this device.


const

UOperatingSystemBaseHardware * GetHardwareByTag(const FGameplayTag TestTag) const

Defined in OperatingSystemBaseDevice.h:529 Retrieves the hardware object associated with the specified tag.

  • TestTag The gameplay tag used to search for the hardware object.

Pointer to the hardware object if found, nullptr otherwise.


const inline

template<class T> inline T * GetHardwareByTag(const FGameplayTag & TestTag) const

Defined in OperatingSystemBaseDevice.h:543 Retrieves the hardware instance associated with the specified tag.

This method searches for a hardware instance that is derived from UOperatingSystemBaseHardware and is associated with the given tag. It returns a pointer to the hardware instance if found, otherwise it returns nullptr.

This method will assert if T is not derived from UOperatingSystemBaseHardware.

  • TestTag The tag used to search for the hardware instance.

A pointer to the hardware instance associated with the tag, or nullptr if no hardware instance is found.


const inline

inline EOperatingSystemDeviceState GetCurrentState() const

Defined in OperatingSystemBaseDevice.h:555 Gets the current state of the operating system device.

The current state of the operating system device.


const

AOperatingSystemDeviceActor * GetParentDeviceActor() const

Defined in OperatingSystemBaseDevice.h:564 Retrieves the parent device actor associated with this operating system device.

The parent device actor, or nullptr if no parent device actor is set.

See also: DeviceActor


const

TSoftClassPtr< UOperatingSystemSaveGame > GetSaveGameClass() const

Defined in OperatingSystemBaseDevice.h:571 Returns the class pointer to the save game class associated with the device.

A class pointer to the save game class associated with the device. Returns nullptr if the device actor is invalid.

ReturnNameDescription
FTimerHandleTimerHandle_SessionEndTimer handle for the end of a session.
FTextDeviceNameDevice name of the operating system device.
TSoftClassPtr< UOperatingSystemDeviceWidget >DeviceWidgetClassClass is used to store the reference to the widget class that will be used to display a specific device in the operating system.
TSoftClassPtr< UOperatingSystem >OperatingSystemClassSpecify the class pointer of an operating system device in the editor.
EOperatingSystemDeviceStartupTypeDeviceStartupTypeDetermine whether the operating system should follow the normal installation flow or should it be preinstalled or directly boot to desktop.
boolbOperatingSystemIsPreInstalled_DEPRECATEDDEPRECATED. Use Device Startup Type instead. Determine whether the operating system comes pre-installed on the device. If set to true, it indicates that the operating system is already present on the device. If set to false, it indicates that the operating system needs to be installed on the device.
FOperatingSystemRangeTimePowerOnTimeThe PowerOnTime variable represents the range of time for which the operating system device needs to power on. This is a FOperatingSystemRangeTime object that provides a convenient way to store and manipulate the range of time values.
FOperatingSystemRangeTimeSessionEndTimeShutdown and restart time.
TSoftClassPtr< UOperatingSystemMBB >MotherboardClassMotherboard class for which this device will be created.
uint8bRequiresGPUDoes this device requires a GPU? If true, you must provide a valid class for Gpu Class.
uint8bOperatingSystemInstalledIndicates whether the operating system is installed on the device.
FGameplayTagDeviceTagGameplay tag assigned from parent device actor.
EOperatingSystemDeviceStatePreviousStateRepresents the previous state of an operating system device.
EOperatingSystemDeviceStateCurrentStateRepresents the current state of the operating system device.
TObjectPtr< UOperatingSystem >ActiveOperatingSystemCurrent operating system that is active.
TObjectPtr< UOperatingSystemDeviceWidget >DeviceWidgetRepresents the on-screen widget for an operating system device. It is used to display information and interact with the device’s hardware and operating system.
TObjectPtr< UUserWidget >OnScreenWidgetThe on-screen widget associated with the operating system device that is currently displayed on the player screen.
TArray< TObjectPtr< UOperatingSystemBaseHardware > >HardwaresArray of operating system base hardware objects used to store hardware information related to the operating system device.
TWeakObjectPtr< AOperatingSystemDeviceActor >DeviceActorDevice Actor pointer that represents an operating system device.
TWeakObjectPtr< UOperatingSystemBiosWidget >BiosWidgetPointer to a weak reference of the BiosWidget which is used to interact with the BiosWidget instance in the operating system device.
TWeakObjectPtr< UOperatingSystemSaveGame >LoadGameInstanceHolds a weak reference to an instance of a saved game for an operating system. The type of the saved game is UOperatingSystemSaveGame. If the object is destroyed, the weak reference will automatically become null.

FTimerHandle TimerHandle_SessionEnd

Defined in OperatingSystemBaseDevice.h:60 Timer handle for the end of a session.

This variable represents the timer handle used to track the end of a session. It is used in the OnFinishOperatingSystemInstallation() method of the UOperatingSystemBaseDevice class. When the installation of the operating system finishes, the timer handle is cleared using GetWorld()->GetTimerManager().ClearTimer(TimerHandle_SessionEnd). This handle is associated with a timer set by the operating system device to manage the device state and perform actions such as restarting the device.


FText DeviceName

Defined in OperatingSystemBaseDevice.h:64 Device name of the operating system device.


TSoftClassPtr< UOperatingSystemDeviceWidget > DeviceWidgetClass

Defined in OperatingSystemBaseDevice.h:73 Class is used to store the reference to the widget class that will be used to display a specific device in the operating system.


TSoftClassPtr< UOperatingSystem > OperatingSystemClass

Defined in OperatingSystemBaseDevice.h:79 Specify the class pointer of an operating system device in the editor.


EOperatingSystemDeviceStartupType DeviceStartupType

Defined in OperatingSystemBaseDevice.h:83 Determine whether the operating system should follow the normal installation flow or should it be preinstalled or directly boot to desktop.


bool bOperatingSystemIsPreInstalled_DEPRECATED

Defined in OperatingSystemBaseDevice.h:92 DEPRECATED. Use Device Startup Type instead. Determine whether the operating system comes pre-installed on the device. If set to true, it indicates that the operating system is already present on the device. If set to false, it indicates that the operating system needs to be installed on the device.


FOperatingSystemRangeTime PowerOnTime

Defined in OperatingSystemBaseDevice.h:99 The PowerOnTime variable represents the range of time for which the operating system device needs to power on. This is a FOperatingSystemRangeTime object that provides a convenient way to store and manipulate the range of time values.


FOperatingSystemRangeTime SessionEndTime

Defined in OperatingSystemBaseDevice.h:103 Shutdown and restart time.


TSoftClassPtr< UOperatingSystemMBB > MotherboardClass

Defined in OperatingSystemBaseDevice.h:107 Motherboard class for which this device will be created.


uint8 bRequiresGPU

Defined in OperatingSystemBaseDevice.h:128 Does this device requires a GPU? If true, you must provide a valid class for Gpu Class.


uint8 bOperatingSystemInstalled

Defined in OperatingSystemBaseDevice.h:132 Indicates whether the operating system is installed on the device.


FGameplayTag DeviceTag

Defined in OperatingSystemBaseDevice.h:136 Gameplay tag assigned from parent device actor.


EOperatingSystemDeviceState PreviousState

Defined in OperatingSystemBaseDevice.h:148 Represents the previous state of an operating system device.

This variable is used to store the previous state of an operating system device. It is of type EOperatingSystemDeviceState, which is an enumeration that defines different states that the device can be in.

See also: EOperatingSystemDeviceState


EOperatingSystemDeviceState CurrentState

Defined in OperatingSystemBaseDevice.h:159 Represents the current state of the operating system device.

The CurrentState variable is an instance of the EOperatingSystemDeviceState enumeration, which defines the possible states that the operating system device can be in.

See also: EOperatingSystemDeviceState


TObjectPtr< UOperatingSystem > ActiveOperatingSystem

Defined in OperatingSystemBaseDevice.h:163 Current operating system that is active.


TObjectPtr< UOperatingSystemDeviceWidget > DeviceWidget

Defined in OperatingSystemBaseDevice.h:170 Represents the on-screen widget for an operating system device. It is used to display information and interact with the device’s hardware and operating system.


TObjectPtr< UUserWidget > OnScreenWidget

Defined in OperatingSystemBaseDevice.h:180 The on-screen widget associated with the operating system device that is currently displayed on the player screen.

It is a reference to an instance of the UUserWidget class, which is the base class for all user interface widgets in the game engine. The widget may contain interactive controls, display information, or provide functionality specific to the operating system device.


TArray< TObjectPtr< UOperatingSystemBaseHardware > > Hardwares

Defined in OperatingSystemBaseDevice.h:189 Array of operating system base hardware objects used to store hardware information related to the operating system device.

See also: UOperatingSystemBaseHardware


TWeakObjectPtr< AOperatingSystemDeviceActor > DeviceActor

Defined in OperatingSystemBaseDevice.h:199 Device Actor pointer that represents an operating system device.

This variable is a weak pointer to an object of class AOperatingSystemDeviceActor, which is an actor representing an operating system device. A weak pointer is used to prevent memory leaks and potential dangling references.


TWeakObjectPtr< UOperatingSystemBiosWidget > BiosWidget

Defined in OperatingSystemBaseDevice.h:205 Pointer to a weak reference of the BiosWidget which is used to interact with the BiosWidget instance in the operating system device.


TWeakObjectPtr< UOperatingSystemSaveGame > LoadGameInstance

Defined in OperatingSystemBaseDevice.h:214 Holds a weak reference to an instance of a saved game for an operating system. The type of the saved game is UOperatingSystemSaveGame. If the object is destroyed, the weak reference will automatically become null.

See also: UOperatingSystemSaveGame

ReturnNameDescription
voidChangeOnScreenWidgetAllows the user to change the on-screen widget of the operating system device. By providing a new widget, the current on-screen widget is replaced with the new one.
voidCheckHardwareChecks the hardware of the operating system base device. It ensures that all hardware components are valid and initializes them if necessary. If any errors occur during the hardware check, the method will return an error message via the OutError parameter.
boolUpdateDeviceStateUpdate the state of the operating system device. It takes the new state as a parameter and updates the device’s current state accordingly. If the new state is different from the current state, the method performs the necessary actions associated with the state change. These actions may include logging, hardware checks, on-screen widget changes, and event broadcasts. If the state is successfully updated, the method returns true; otherwise, it returns false.
voidOnDeviceCreated virtual inlineThis method is called when a device is created.
voidOnDeviceStartRunningCallback function called when the device starts running.
voidOnDeviceShutdownTriggers the device shutdown process.
voidOnDeviceRestartRestarts the operating system on the device.
voidDestroyDeviceAndRestartDestroyDeviceAndRestart

void ChangeOnScreenWidget(UUserWidget * NewOnScreenWidget = nullptr)

Defined in OperatingSystemBaseDevice.h:400 Allows the user to change the on-screen widget of the operating system device. By providing a new widget, the current on-screen widget is replaced with the new one.

  • NewOnScreenWidget The new on-screen widget to be set. If nullptr is provided, the current on-screen widget will be cleared.

void CheckHardware(FGenericError & OutError)

Defined in OperatingSystemBaseDevice.h:414 Checks the hardware of the operating system base device. It ensures that all hardware components are valid and initializes them if necessary. If any errors occur during the hardware check, the method will return an error message via the OutError parameter.

  • OutError A reference to a FGenericError object that will store any error messages if the hardware check fails.

bool UpdateDeviceState(const EOperatingSystemDeviceState & NewState, FGenericError & OutError)

Defined in OperatingSystemBaseDevice.h:435 Update the state of the operating system device. It takes the new state as a parameter and updates the device’s current state accordingly. If the new state is different from the current state, the method performs the necessary actions associated with the state change. These actions may include logging, hardware checks, on-screen widget changes, and event broadcasts. If the state is successfully updated, the method returns true; otherwise, it returns false.

  • NewState The new state of the device (EOperatingSystemDeviceState enum).

  • OutError (output) Any error message that occurred during the state change.

True if the state was successfully updated, false otherwise.

See also: EOperatingSystemDeviceState, FGenericError, CheckHardware, ChangeOnScreenWidget, OnDeviceStartRunning, OnDeviceRestart, OnDeviceShutdown, OnDeviceStateChanged


virtual inline

virtual inline void OnDeviceCreated(FGenericError & OutError)

Defined in OperatingSystemBaseDevice.h:445 This method is called when a device is created.

  • OutError The error object to populate if an error occurs during device creation.

void OnDeviceStartRunning()

Defined in OperatingSystemBaseDevice.h:459 Callback function called when the device starts running.

This function is called when the device starts running. It first checks if the active operating system instance is valid. If not, it creates a new operating system instance and assigns it to the ActiveOperatingSystem member variable. If there is any error during the creation of the operating system instance, the error is passed to the DeviceWidget’s OperatingSystemError function and the function returns.

After creating or validating the active operating system instance, it calls the StartOperatingSystem function, passing an OutError parameter. The StartOperatingSystem function is responsible for starting the operating system execution.


void OnDeviceShutdown()

Defined in OperatingSystemBaseDevice.h:468 Triggers the device shutdown process.

This method is called when the device is being shut down. It triggers the necessary actions to gracefully shut down the device, such as saving data and closing connections. It does not perform the actual power-off or hardware shutdown.


void OnDeviceRestart()

Defined in OperatingSystemBaseDevice.h:476 Restarts the operating system on the device.

This method is called to initiate a device restart. It performs the necessary operations to gracefully stop the current session, then restarts the operating system on the device.


void DestroyDeviceAndRestart()

Defined in OperatingSystemBaseDevice.h:487 DestroyDeviceAndRestart

This method destroys the device and restarts it. It internally calls the Internal_DestroyDevice() method to destroy the device and then calls the RestartDevice() method of the DeviceActor to restart the device.

ReturnNameDescription
voidInternal_SessionEnd
voidInternal_OnDeviceSessionEnd
voidInternal_DestroyDevice

void Internal_SessionEnd()

Defined in OperatingSystemBaseDevice.h:491


void Internal_OnDeviceSessionEnd(const bool bRestart)

Defined in OperatingSystemBaseDevice.h:492


void Internal_DestroyDevice()

Defined in OperatingSystemBaseDevice.h:493