UOperatingSystemProgramSettings
#include <OperatingSystemSimulator/Public/Programs/OperatingSystemProgramSettings.h>class UOperatingSystemProgramSettingsDefined in OperatingSystemProgramSettings.h:23
Inherits:
USaveGameSubclassed by:UOperatingSystemVideoPlayerSettings
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemProgramSettings["UOperatingSystemProgramSettings"]
class USaveGame["USaveGame"]
USaveGame <|-- UOperatingSystemProgramSettings
class UOperatingSystemVideoPlayerSettings["UOperatingSystemVideoPlayerSettings"]
UOperatingSystemProgramSettings <|-- UOperatingSystemVideoPlayerSettings
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemProgramSettings["UOperatingSystemProgramSettings"]
class UOperatingSystemBaseProgram["UOperatingSystemBaseProgram"]
UOperatingSystemProgramSettings *-- UOperatingSystemBaseProgram
Class detail
Section titled “Class detail”---
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.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemProgramSettings | ||
bool | WasWindowMaximized const inline | Gets whether the window was maximized. |
TOptional< FVector2D > | GetLastWindowPosition const inline | Returns the last known window position. |
UOperatingSystemProgramSettings
Section titled “UOperatingSystemProgramSettings”UOperatingSystemProgramSettings()Defined in OperatingSystemProgramSettings.h:68
References
Section titled “References”CHECK_IN_BPIMPLEMENTED_IN_BP_LAMBDA
WasWindowMaximized
Section titled “WasWindowMaximized”const inline
inline bool WasWindowMaximized() constDefined in OperatingSystemProgramSettings.h:189 Gets whether the window was maximized.
This method returns a boolean value indicating whether the window was maximized.
Returns
Section titled “Returns”True if the window was maximized, false otherwise.
GetLastWindowPosition
Section titled “GetLastWindowPosition”const inline
inline TOptional< FVector2D > GetLastWindowPosition() constDefined 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.
Returns
Section titled “Returns”The last known window position, or an empty TOptional<FVector2D> object if the position is not set.
References
Section titled “References”Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemProgramSettings * | CreateSettings 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. |
T * | CreateSettings static inline | |
UOperatingSystemProgramSettings * | LoadSettings static | Load the settings for the given program. |
bool | SaveSettings static | Saves the settings for the specified operating system program. |
CreateSettings
Section titled “CreateSettings”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.
Parameters
Section titled “Parameters”-
OwningProgramThe owner UOperatingSystemBaseProgram. -
SettingsSoftClassThe soft reference to the class of UOperatingSystemProgramSettings. -
OutErrorThe reference to FGenericError for output error messages.
Returns
Section titled “Returns”A pointer to the created UOperatingSystemProgramSettings instance, or nullptr if there was an error.
Referenced by
Section titled “Referenced by”References
Section titled “References”MAKE_ERRORNEW_SOFT_OBJ
CreateSettings
Section titled “CreateSettings”static inline
template<class T> static inline T * CreateSettings(const TWeakObjectPtr< UOperatingSystemBaseProgram > OwningProgram, TSoftClassPtr< UOperatingSystemProgramSettings > SettingsSoftClass, FGenericError & OutError)Defined in OperatingSystemProgramSettings.h:87
References
Section titled “References”LoadSettings
Section titled “LoadSettings”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.
Parameters
Section titled “Parameters”OwningProgramThe program for which to load the settings.
Returns
Section titled “Returns”The loaded settings instance if the save game file exists, nullptr otherwise.
Referenced by
Section titled “Referenced by”SaveSettings
Section titled “SaveSettings”static
static bool SaveSettings(UOperatingSystemBaseProgram * TargetProgram)Defined in OperatingSystemProgramSettings.h:118 Saves the settings for the specified operating system program.
Parameters
Section titled “Parameters”TargetProgramThe operating system program whose settings should be saved.
Returns
Section titled “Returns”True if the settings were saved successfully, false otherwise.
See also: UOperatingSystemBaseProgram::CanSaveSettings()
See also: UOperatingSystemBaseProgram::GetSettings()
See also: UOperatingSystemSettings::Internal_SaveSettings()
Referenced by
Section titled “Referenced by”References
Section titled “References”Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
FName | Identifier | Represents the identifier of an object for debugging purposes. |
FString | SaveSlotName | FString variable is assigned the name of the save slot. |
int32 | UserIndex | 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 | The ParentProgram property represents the parent program of the OperatingSystemBaseProgram. The parent program can be assigned and accessed through this property. |
FVector2D | LastWindowPosition | |
uint8 | bWasWindowMaximized | |
uint8 | bHasBlueprintCanSave | |
uint8 | bHasBlueprintPreSave |
Identifier
Section titled “Identifier”FName IdentifierDefined in OperatingSystemProgramSettings.h:33 Represents the identifier of an object for debugging purposes.
SaveSlotName
Section titled “SaveSlotName”FString SaveSlotNameDefined in OperatingSystemProgramSettings.h:39 FString variable is assigned the name of the save slot.
Referenced by
Section titled “Referenced by”UserIndex
Section titled “UserIndex”int32 UserIndexDefined 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.
Referenced by
Section titled “Referenced by”ParentProgram
Section titled “ParentProgram”TWeakObjectPtr< UOperatingSystemBaseProgram > ParentProgramDefined 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
Referenced by
Section titled “Referenced by”LastWindowPosition
Section titled “LastWindowPosition”FVector2D LastWindowPositionDefined in OperatingSystemProgramSettings.h:58
Referenced by
Section titled “Referenced by”bWasWindowMaximized
Section titled “bWasWindowMaximized”uint8 bWasWindowMaximizedDefined in OperatingSystemProgramSettings.h:61
Referenced by
Section titled “Referenced by”bHasBlueprintCanSave
Section titled “bHasBlueprintCanSave”uint8 bHasBlueprintCanSaveDefined in OperatingSystemProgramSettings.h:63
Referenced by
Section titled “Referenced by”bHasBlueprintPreSave
Section titled “bHasBlueprintPreSave”uint8 bHasBlueprintPreSaveDefined in OperatingSystemProgramSettings.h:64
Referenced by
Section titled “Referenced by”Protected Methods
Section titled “Protected Methods”| Return | Name | Description |
|---|---|---|
bool | K2_CanSave const | Checks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality. |
void | K2_PreSave | Called to handle pre-saving the OperatingSystemProgramSettings. |
K2_CanSave
Section titled “K2_CanSave”const
bool K2_CanSave() constDefined 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.
Returns
Section titled “Returns”True if the program settings can be saved, false otherwise.
Referenced by
Section titled “Referenced by”K2_PreSave
Section titled “K2_PreSave”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
Referenced by
Section titled “Referenced by”Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
bool | Internal_CanSave const | Checks if the program settings can be saved. This function is implemented as a blueprint event, allowing subclasses to override the functionality. |
bool | Internal_SaveSettings | Saves the program settings to a save slot. |
void | Internal_SetSaveSlotName | Sets the save slot name for the operating system program settings. |
Internal_CanSave
Section titled “Internal_CanSave”const
bool Internal_CanSave() constDefined 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.
Returns
Section titled “Returns”True if the program settings can be saved, false otherwise.
Referenced by
Section titled “Referenced by”References
Section titled “References”bHasBlueprintCanSaveK2_CanSaveOS_LOG_ERRORParentProgram
Internal_SaveSettings
Section titled “Internal_SaveSettings”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.
Returns
Section titled “Returns”True if the settings were saved successfully, false otherwise.
References
Section titled “References”bHasBlueprintPreSavebWasWindowMaximizedInternal_CanSaveK2_PreSaveLastWindowPositionOS_LOG_ERRORParentProgramSaveSlotNameUserIndex
Internal_SetSaveSlotName
Section titled “Internal_SetSaveSlotName”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.