Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
UOperatingSystemProgramSettings Class Reference

#include "OperatingSystemProgramSettings.h"

Inheritance diagram for UOperatingSystemProgramSettings:
[legend]
Collaboration diagram for UOperatingSystemProgramSettings:
[legend]

Public Member Functions

 UOperatingSystemProgramSettings ()
 
FORCEINLINE bool WasWindowMaximized () const
 Gets whether the window was maximized.
 
FORCEINLINE TOptional< FVector2D > GetLastWindowPosition () const
 Returns the last known window position.
 

Static Public Member Functions

static UOperatingSystemProgramSettingsCreateSettings (const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram, const TSoftClassPtr< UOperatingSystemProgramSettings > &SettingsSoftClass, FGenericError &OutError)
 
template<class T >
static T * CreateSettings (const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram, TSoftClassPtr< UOperatingSystemProgramSettings > SettingsSoftClass, FGenericError &OutError)
 
static UOperatingSystemProgramSettingsLoadSettings (const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram)
 
static bool SaveSettings (UOperatingSystemBaseProgram *TargetProgram)
 

Protected Member Functions

bool K2_CanSave () const
 
void K2_PreSave ()
 

Protected Attributes

FName Identifier
 
FString SaveSlotName
 
int32 UserIndex
 
TWeakObjectPtr< UOperatingSystemBaseProgramParentProgram
 
FVector2D LastWindowPosition
 
uint8 bWasWindowMaximized: 1
 
uint8 bHasBlueprintCanSave: 1
 
uint8 bHasBlueprintPreSave: 1
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UOperatingSystemProgramSettings()

UOperatingSystemProgramSettings::UOperatingSystemProgramSettings ( )

Member Function Documentation

◆ CreateSettings() [1/2]

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

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.

Parameters
OwningProgramThe owner UOperatingSystemBaseProgram.
SettingsSoftClassThe soft reference to the class of UOperatingSystemProgramSettings.
OutErrorThe reference to FGenericError for output error messages.
Returns
A pointer to the created UOperatingSystemProgramSettings instance, or nullptr if there was an error.

◆ CreateSettings() [2/2]

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

◆ GetLastWindowPosition()

FORCEINLINE TOptional< FVector2D > UOperatingSystemProgramSettings::GetLastWindowPosition ( ) const
inline

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.

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

◆ K2_CanSave()

bool UOperatingSystemProgramSettings::K2_CanSave ( ) const
protected

Checks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality.

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

◆ K2_PreSave()

void UOperatingSystemProgramSettings::K2_PreSave ( )
protected

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

◆ LoadSettings()

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

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.

Parameters
OwningProgramThe program for which to load the settings.
Returns
The loaded settings instance if the save game file exists, nullptr otherwise.

◆ SaveSettings()

bool UOperatingSystemProgramSettings::SaveSettings ( UOperatingSystemBaseProgram * TargetProgram)
static

Saves the settings for the specified operating system program.

Parameters
TargetProgramThe operating system program whose settings should be saved.
Returns
True if the settings were saved successfully, false otherwise.
See also
UOperatingSystemBaseProgram::CanSaveSettings()
UOperatingSystemBaseProgram::GetSettings()
UOperatingSystemSettings::Internal_SaveSettings()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WasWindowMaximized()

FORCEINLINE bool UOperatingSystemProgramSettings::WasWindowMaximized ( ) const
inline

Gets whether the window was maximized.

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

Returns
True if the window was maximized, false otherwise.

Member Data Documentation

◆ bHasBlueprintCanSave

uint8 UOperatingSystemProgramSettings::bHasBlueprintCanSave
protected

◆ bHasBlueprintPreSave

uint8 UOperatingSystemProgramSettings::bHasBlueprintPreSave
protected

◆ bWasWindowMaximized

uint8 UOperatingSystemProgramSettings::bWasWindowMaximized
protected

◆ Identifier

FName UOperatingSystemProgramSettings::Identifier
protected

Represents the identifier of an object for debugging purposes.

◆ LastWindowPosition

FVector2D UOperatingSystemProgramSettings::LastWindowPosition
protected

◆ ParentProgram

TWeakObjectPtr<UOperatingSystemBaseProgram> UOperatingSystemProgramSettings::ParentProgram
protected

The ParentProgram property represents the parent program of the OperatingSystemBaseProgram. The parent program can be assigned and accessed through this property.

See also
UOperatingSystemBaseProgram

◆ SaveSlotName

FString UOperatingSystemProgramSettings::SaveSlotName
protected

FString variable is assigned the name of the save slot.

◆ UserIndex

int32 UOperatingSystemProgramSettings::UserIndex
protected

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


The documentation for this class was generated from the following files: