Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
#include "OperatingSystemStore.h"
Public Member Functions | |
UOperatingSystemStore () | |
virtual FString | GetSaveSlotName () const override |
bool | SubmitRating (const TSoftClassPtr< UOperatingSystemBaseProgram > &TargetProgram, const FOperatingSystemStoreReviewUser &ReviewingUser) |
Public Member Functions inherited from UOperatingSystemBaseProgram | |
UOperatingSystemBaseProgram () | |
UOperatingSystemBaseProgram * | StartProgram (FGenericError &OutError) |
bool | IsRunning () const |
bool | CanAddToDesktop () const |
UOperatingSystem * | GetOperatingSystem () const |
UOperatingSystemProgramIconWidget * | CreateIconWidget () |
UOperatingSystemProgramIconWidget * | GetIconWidget () const |
void | OpenFile (UOperatingSystemFile *TargetFile, FGenericError &OutError) |
void | CloseProgram (const bool bIsFullClose, FGenericError &OutError) |
void | BringToFront (FGenericError &OutError) const |
UDraggableWindow * | GetParentWindow () const |
void | IsCompatibleWithOS (const TWeakObjectPtr< const UOperatingSystem > TestOS, FGenericError &OutError) const |
bool | CanSaveSettings () const |
void | SetParentPartition (TWeakObjectPtr< UOperatingSystemPartition > OwningPartition) |
void | OnProgramWindowStateChanged (const EOperatingSystemProgramViewState &NewState) const |
bool | IsWindowMaximized () const |
Checks whether the window of the operating system base program is maximized. | |
TOptional< FVector2D > | GetWindowPosition () const |
Retrieves the position of the window associated with the operating system program. | |
TWeakObjectPtr< UOperatingSystemPartition > | GetParentPartition () const |
Get the parent partition of the current operating system program. | |
TSoftClassPtr< UOperatingSystemProgramIconWidget > | GetIconWidgetClass () const |
Retrieves the class of the icon widget for the operating system program. | |
TSoftClassPtr< UOperatingSystemProgramWidget > | GetWidgetClass () const |
Retrieves the widget class associated with the operating system base program. This method returns the widget class that should be used to create the program widget for the specific program. | |
TSoftClassPtr< UOperatingSystemProgramSettings > | GetSettingsClass () const |
Get the settings class associated with this program. This method returns the class type of the settings object specific to this program. | |
TSoftClassPtr< UOperatingSystemProgramData > | GetDataClass () const |
Retrieves the data class associated with the program. | |
TSoftClassPtr< UOperatingSystemTaskbarButton > | GetTaskbarButtonClass () const |
Retrieves the taskbar button class associated with the program. | |
TWeakObjectPtr< UOperatingSystemProgramSettings > | GetSettings () const |
Get the settings object for the program. | |
TWeakObjectPtr< UOperatingSystemProgramData > | GetDataObj () const |
Retrieves the data object associated with the operating system program. | |
TWeakObjectPtr< UOperatingSystemTaskbarButton > | GetTaskbarButton () const |
Retrieves the taskbar button associated with the program. | |
UOperatingSystemProgramWidget * | GetProgramWidget () const |
Returns the program widget associated with the operating system program. | |
template<class T > | |
T * | GetSettings () const |
Get the settings object of type T. | |
template<class T > | |
T * | GetDataObj () const |
Returns the data object associated with the program. | |
FORCEINLINE FString | GetProgramName () const |
Returns the program name as a FString. | |
FORCEINLINE FName | GetIdentifier () const |
Returns the identifier of the program. The identifier serves as a unique identification for the program. | |
FORCEINLINE bool | IsSingleInstanceProgram () const |
Returns a boolean value indicating whether the program is a single instance program. A single instance program is a program that allows only one instance to run at a time. | |
FORCEINLINE bool | IsSystemInstalledProgram () const |
Returns a boolean value indicating whether the program is installed on the system. If the program is installed, it will return true; otherwise, it will return false. | |
FORCEINLINE uint32 | GetProcessID () const |
Retrieves the process ID of the current program. This method allows you to obtain the unique process ID of the program. | |
FORCEINLINE float | GetSpaceRequiredInMB () const |
Get the space required by the program in megabytes. This method returns the space required by the program in megabytes. | |
FORCEINLINE bool | ShouldRememberLastWindowPosition () const |
Indicates whether the program should remember the last window position. | |
OPERATINGSYSTEMSIMULATOR_API FORCEINLINE EOperatingSystemProgramCloseMethod | GetCloseMethod () const |
Returns the close method of the operating system program. | |
Static Public Member Functions | |
static float | GetAverageRating (const FOperatingSystemStoreProgramData &StoreProgramData) |
Static Public Member Functions inherited from UOperatingSystemBaseProgram | |
static UE_NODISCARD UOperatingSystemBaseProgram * | CreateProgram (TWeakObjectPtr< UOperatingSystem > OwningOS, const TSoftClassPtr< UOperatingSystemBaseProgram > &ProgramClass, FGenericError &OutError, const bool bInstalledWithOS=false) |
static OPERATINGSYSTEMSIMULATOR_API bool | IsStoreItemFree (const FOperatingSystemStoreProgramData &ProgramData) |
Protected Member Functions | |
virtual void | OnValidate (FGenericError &OutError) const override |
virtual void | OnStart (FGenericError &OutError) override |
Protected Member Functions inherited from UOperatingSystemBaseProgram | |
virtual OPERATINGSYSTEMSIMULATOR_API void | OnClose (FGenericError &OutError) |
Called when the program is requested to be closed. It can be overridden by derived classes to perform necessary cleanup operations before the program is closed. The function receives an FGenericError& object as a parameter, which can be used to report any error that occurred during the closing process. | |
virtual OPERATINGSYSTEMSIMULATOR_API void | OnOpenFile (UOperatingSystemFile *TargetFile, FGenericError &OutError) |
Called when a file is opened in the operating system program. It provides the target file that was opened, as well as an output error parameter for reporting any errors that occurred during the file opening process. | |
virtual OPERATINGSYSTEMSIMULATOR_API void | OnThemeChanged (UOperatingSystemSettingModule_Theme *ThemePayload) |
Virtual method called when the theme is changed. | |
void | K2_OnCreate () |
void | K2_OnInstall () |
FGenericError | K2_OnStart () |
void | K2_OnClose () |
void | K2_OnSettingsLoad (UOperatingSystemProgramSettings *LoadedSettings) |
void | K2_OnOpenFile (FGenericError &OutError) |
void | K2_OnValidate (FGenericError &OutError) const |
FString | K2_GetSaveSlotName () const |
Represents the operating system store programs collection.
UOperatingSystemStore::UOperatingSystemStore | ( | ) |
|
static |
Calculates the average rating from the given program data.
This function takes the review users data of a program from the operating system store, and returns the average rating of the program.
StoreProgramData | The program data containing the review users. |
|
overridevirtual |
Get the save slot name.
This function retrieves the save slot name for the operating system store. The save slot name is retrieved from the Identifier member variable of the class.
Reimplemented from UOperatingSystemBaseProgram.
|
overrideprotectedvirtual |
Executes when the operating system store starts.
This function is called when the operating system store starts. It internally tries to create a save file.
OutError | The generic error object to hold the error information in case of failures. |
Reimplemented from UOperatingSystemBaseProgram.
|
overrideprotectedvirtual |
Validates the operating system store.
This function checks if the store programs collection is null. If it is null, an error is assigned to the OutError parameter and the function returns. Otherwise, it loads the store programs collection and calls the Validate function on it, passing the OutError parameter.
OutError | The generic error object to hold the error information in case of validation failure. |
Reimplemented from UOperatingSystemBaseProgram.
bool UOperatingSystemStore::SubmitRating | ( | const TSoftClassPtr< UOperatingSystemBaseProgram > & | TargetProgram, |
const FOperatingSystemStoreReviewUser & | ReviewingUser ) |
Submits a rating for a target program by a reviewing user.
This function adds the reviewing user's rating to the target program's reviews. If the target program or the reviewing user is not valid, an error notification is added to the operating system and the function returns false. The average rating for the target program is updated based on all the reviews, and the updated store apps data is written to the save file.
TargetProgram | The target program to submit the rating for. |
ReviewingUser | The reviewing user providing the rating. |