Skip to content

UOperatingSystemProgramSettings

#include <OperatingSystemSimulator/Public/Programs/OperatingSystemProgramSettings.h>
class UOperatingSystemProgramSettings

Defined in OperatingSystemProgramSettings.h:23

Inherits: USaveGame Subclassed by: UOperatingSystemVideoPlayerSettings

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemProgramSettings["UOperatingSystemProgramSettings"]
  class USaveGame["USaveGame"]
  USaveGame <|-- UOperatingSystemProgramSettings
  class UOperatingSystemVideoPlayerSettings["UOperatingSystemVideoPlayerSettings"]
  UOperatingSystemProgramSettings <|-- UOperatingSystemVideoPlayerSettings
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemProgramSettings["UOperatingSystemProgramSettings"]
  class UOperatingSystemBaseProgram["UOperatingSystemBaseProgram"]
  UOperatingSystemProgramSettings *-- UOperatingSystemBaseProgram
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemProgramSettings {
    +UOperatingSystemProgramSettings()
    +WasWindowMaximized() const bool
    +GetLastWindowPosition() const TOptional< FVector2D >
    +CreateSettings(const TWeakObjectPtr< UOperatingSystemBaseP UOperatingSystemProgramSettings() *
    +CreateSettings(const TWeakObjectPtr< UOperatingSystemBaseP T *
    +LoadSettings(const TWeakObjectPtr< UOperatingSystemBaseP UOperatingSystemProgramSettings() *
    +SaveSettings(UOperatingSystemBaseProgram *TargetProgram) bool
    +Identifier : FName
    +SaveSlotName : FString
    +UserIndex : int32
    +ParentProgram : TWeakObjectPtr< UOperatingSystemBaseProg
    +LastWindowPosition : FVector2D
    +bWasWindowMaximized : uint8
    +bHasBlueprintCanSave : uint8
    +bHasBlueprintPreSave : uint8
    +K2_CanSave() const bool
    +K2_PreSave()
    +Internal_CanSave() const bool
    +Internal_SaveSettings() bool
    +Internal_SetSaveSlotName()
  }

This class represents the settings of an operating system program.

UOperatingSystemProgramSettings is an abstract class that inherits from USaveGame. It provides functionality for creating, loading, and saving program settings. The class contains protected properties for storing program specific settings and debug information It also includes static methods for creating and loading program settings, as well as a blueprint event for determining whether the program can be saved.

ReturnNameDescription
UOperatingSystemProgramSettings
boolWasWindowMaximized const inlineGets whether the window was maximized.
TOptional< FVector2D >GetLastWindowPosition const inlineReturns the last known window position.

UOperatingSystemProgramSettings()

Defined in OperatingSystemProgramSettings.h:68

  • CHECK_IN_BP
  • IMPLEMENTED_IN_BP_LAMBDA

const inline

inline bool WasWindowMaximized() const

Defined in OperatingSystemProgramSettings.h:189 Gets whether the window was maximized.

This method returns a boolean value indicating whether the window was maximized.

True if the window was maximized, false otherwise.


const inline

inline TOptional< FVector2D > GetLastWindowPosition() const

Defined in OperatingSystemProgramSettings.h:199 Returns the last known window position.

If the last known window position is zero or almost zero, this method will return an empty TOptional<FVector2D> object.

The last known window position, or an empty TOptional<FVector2D> object if the position is not set.

ReturnNameDescription
UOperatingSystemProgramSettings *CreateSettings staticCreates a new instance of UOperatingSystemProgramSettings. This method is used to create a new instance of UOperatingSystemProgramSettings with the given parameters. The OwningProgram must have a valid identifier, otherwise an error will be returned. The created UOperatingSystemProgramSettings will have the OwningProgram set as the parent program, the identifier set to the OwningProgram’s identifier and the save slot name set.
T *CreateSettings static inline
UOperatingSystemProgramSettings *LoadSettings staticLoad the settings for the given program.
boolSaveSettings staticSaves the settings for the specified operating system program.

static

static UOperatingSystemProgramSettings * CreateSettings(const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram, const TSoftClassPtr< UOperatingSystemProgramSettings > & SettingsSoftClass, FGenericError & OutError)

Defined in OperatingSystemProgramSettings.h:83 Creates a new instance of UOperatingSystemProgramSettings. This method is used to create a new instance of UOperatingSystemProgramSettings with the given parameters. The OwningProgram must have a valid identifier, otherwise an error will be returned. The created UOperatingSystemProgramSettings will have the OwningProgram set as the parent program, the identifier set to the OwningProgram’s identifier and the save slot name set.

A pointer to the created UOperatingSystemProgramSettings instance, or nullptr if there was an error.

  • MAKE_ERROR
  • NEW_SOFT_OBJ

static inline

template<class T> static inline T * CreateSettings(const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram, TSoftClassPtr< UOperatingSystemProgramSettings > SettingsSoftClass, FGenericError & OutError)

Defined in OperatingSystemProgramSettings.h:87


static

static UOperatingSystemProgramSettings * LoadSettings(const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram)

Defined in OperatingSystemProgramSettings.h:105 Load the settings for the given program.

This function loads the settings for the specified program. It creates an instance of the program’s settings class and sets the necessary properties. If the save game file exists, it loads the settings from the file and returns the loaded instance. Otherwise, it returns nullptr.

  • OwningProgram The program for which to load the settings.

The loaded settings instance if the save game file exists, nullptr otherwise.


static

static bool SaveSettings(UOperatingSystemBaseProgram * TargetProgram)

Defined in OperatingSystemProgramSettings.h:118 Saves the settings for the specified operating system program.

  • TargetProgram The operating system program whose settings should be saved.

True if the settings were saved successfully, false otherwise.

See also: UOperatingSystemBaseProgram::CanSaveSettings()

See also: UOperatingSystemBaseProgram::GetSettings()

See also: UOperatingSystemSettings::Internal_SaveSettings()

ReturnNameDescription
FNameIdentifierRepresents the identifier of an object for debugging purposes.
FStringSaveSlotNameFString variable is assigned the name of the save slot.
int32UserIndexThis property represents the User Index used for debug purposes. It is visible only in instances and belongs to the Debug category.
TWeakObjectPtr< UOperatingSystemBaseProgram >ParentProgramThe ParentProgram property represents the parent program of the OperatingSystemBaseProgram. The parent program can be assigned and accessed through this property.
FVector2DLastWindowPosition
uint8bWasWindowMaximized
uint8bHasBlueprintCanSave
uint8bHasBlueprintPreSave

FName Identifier

Defined in OperatingSystemProgramSettings.h:33 Represents the identifier of an object for debugging purposes.


FString SaveSlotName

Defined in OperatingSystemProgramSettings.h:39 FString variable is assigned the name of the save slot.


int32 UserIndex

Defined in OperatingSystemProgramSettings.h:46 This property represents the User Index used for debug purposes. It is visible only in instances and belongs to the Debug category.


TWeakObjectPtr< UOperatingSystemBaseProgram > ParentProgram

Defined in OperatingSystemProgramSettings.h:55 The ParentProgram property represents the parent program of the OperatingSystemBaseProgram. The parent program can be assigned and accessed through this property.

See also: UOperatingSystemBaseProgram


FVector2D LastWindowPosition

Defined in OperatingSystemProgramSettings.h:58


uint8 bWasWindowMaximized

Defined in OperatingSystemProgramSettings.h:61


uint8 bHasBlueprintCanSave

Defined in OperatingSystemProgramSettings.h:63


uint8 bHasBlueprintPreSave

Defined in OperatingSystemProgramSettings.h:64

ReturnNameDescription
boolK2_CanSave constChecks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality.
voidK2_PreSaveCalled to handle pre-saving the OperatingSystemProgramSettings.

const

bool K2_CanSave() const

Defined in OperatingSystemProgramSettings.h:166 Checks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality.

True if the program settings can be saved, false otherwise.


void K2_PreSave()

Defined in OperatingSystemProgramSettings.h:178 Called to handle pre-saving the OperatingSystemProgramSettings.

This function is an implementable event that can be overridden in Blueprint to perform any necessary operations before the OperatingSystemProgramSettings is saved.

See also: K2_PostSave

ReturnNameDescription
boolInternal_CanSave constChecks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality.
boolInternal_SaveSettingsSaves the program settings to a save slot.
voidInternal_SetSaveSlotNameSets the save slot name for the operating system program settings.

const

bool Internal_CanSave() const

Defined in OperatingSystemProgramSettings.h:128 Checks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality.

True if the program settings can be saved, false otherwise.


bool Internal_SaveSettings()

Defined in OperatingSystemProgramSettings.h:147 Saves the program settings to a save slot.

This function saves the program settings to a save slot. It first checks if the program can be saved by calling the Internal_CanSave() method. If the program cannot be saved, an error message is logged and false is returned.

It then sets the properties bWasWindowMaximized and LastWindowPosition based on the window state and whether the program should remember the last window position.

If the program has a blueprint pre-save event, it is called by invoking the K2_PreSave() method.

Finally, it calls the UGameplayStatics::SaveGameToSlot() method to save the settings object to the specified save slot.

True if the settings were saved successfully, false otherwise.


void Internal_SetSaveSlotName()

Defined in OperatingSystemProgramSettings.h:157 Sets the save slot name for the operating system program settings.

This method is called internally to set the save slot name for the program settings. The save slot name is obtained from the parent program’s save slot name.