Skip to main content

New Program

Programs in Operating System are just Blueprint classes created in Content Browser. Programs can either be created in C++ or Blueprints. They define the basics of a program (or an app) like it's name, description, supported Operating Systems, version number, icon and many more.

To create a new program, right click inside Content Browser and select Blueprint Class. From the resulting dialog box, search for Operating System Program and select Operating System Base Program from the search result.

screenshot

Select and give it a name you like. (The Blueprint name you give in Content Browser is irrelevant). Now open the Blueprint and you will be greeted with an empty graph view. Close it and open again and you will now see what is called the data-view.

screenshot

Let's go through the properties:

Program
NameName of the program
AuthorCompany or individual who created the program. Typically used to display on Store.
DescriptionA simple description for this program. Typically used to display on Store.
IdentifierA unique identifier. This should not be shared and each program MUST have unique identifier.
VersionProgram version
Supported Operating SystemsGameplay Tag container that determines what type of Operating System should support. If empty, all Operating Systems are supported.
Min Operating System VersionIf enabled, Operating System should be running at-least this version number for this program to run.
Icon ObjectA UI material or texture that defines an Icon for this program.
Space Required in MBHow much space does this program consume after installation (specified in MB size).
Save MethodDetermines when this program should save.
Settings ClassOptional class to save anything regarding this program.
Data ClassOptional class to manipulate any data for this program.
Requires DataIf true, validate this program has a valid data class set and it should be constructable. It means when you run the program, you will have a data obj guaranteed for this program.
Add to DesktopAdd this program icon to the desktop after install.
Create NotificationShows a toast notification after installing this program.
Single Instance OnlyIf true, only one instance of this program can run at any given time.
Create Settings Before StartingCreates the settings object before starting this program.

Store Settings:

Program Store
Store Display NameOverrides the name to show on Store. If left blank, Name property of the program is used.
Store TypeSpecifies the category of the program. Like Entertainment, Utilities, Finance and so on.
Store PricePrice to display on Store. 0 makes free.

Widget Settings:

Program Widgets
Icon Widget ClassWidget That Shows The Icon Of This Program. Pre-Defined To Wbp_programicon But You Can Modify It Or Set Your Own.
Widget ClassThe Main Widget That Represents This Program. This Is What Users Will See And Interact With The Most.
Override Window ClassOptional Draggable Window Class To Use For This Program. E.g: /OperatingSystemContent/Shared/Blueprints/Programs/WebBrowser/BP_Prog_WebBrowser
Taskbar Button ClassWidget that shows the taskbar button for this program.

Window Settings:

Program Window
Remember Last Window PositionIf true, window position will be saved and restored automatically. This option is disabled until you set a valid Save Method and Settings Class.
Allow DraggingIf true, user will be able to drag the window of this program.
Allow ResizingIf true, user can resize the window by clicking and dragging at the bottom right corner of the program window.
Override Window SizeIf enabled, you can set an absolute value of the size you want this program to be when starting. If disabled, the plugin will decide the starting size automatically.
Minimum Window ResizeSpecifies the minimum width and maximize height this program is allowed to resize. If both X and Y are 0, no limit is imposed.
Start Window StateDefines the starting window state.

Every program goes through a validation check before it is created. For those who prefer C++, you can override the OnValidate function. For example: Imagine you have a TSoftClassPtr in your custom program and you need to make sure it is set always. In order to validate, add the following in your header:

virtual void OnValidate(FGenericError& OutError) const override;

Then in your cpp file, implement like this:

void UMyCustomProgram::OnValidate(FGenericError& OutError) const
{
if (MySoftClassPtr.IsNull())
{
OutError = MAKE_ERROR("ERROR", FString::Printf(TEXT("%s validation error: Soft class pointer missing."), *Name.ToString()));
}
}

That's all. You don't have to call Super::OnValidate (unless you have deep inheritance). Just make sure you set OutError property using the MAKE_ERROR macro. This single override will make sure the program is not created unless the required conditions are met.

For Blueprint users, you simply override the On Validate Blueprint event.

screenshot

Inside this function do the logic and in any case if you want the validation to fail, you must use Create Generic Error node and return it.

screenshot