Converting a GameOn Extension to a GameOn App

Overview
In this tutorial, we will convert our GameOn Extension into a GameOn App (for modern versions of GameOn).

What you’ll need:
GameOn Developer Toolkit (v201001) or later.
or any Coding IDE (we recommend Visual Studio Code)
GameOn Extension source code of the Extension you wish to convert.


Step One: Updating our library dependencies.

While this step isn’t necessary, we might as well do it. The name of our core libraries has been changed with the introduction of GameOn Apps. What was previously GameOn.LXCore and GameOnExt.LXCore can be changed. So for every code file that references these libraries, we will want to convert them to:

including RWE.GameOn.Core;
including RWE.GameOn.Core.Extensions;

Step Two: Updating our manifest.

Our manifest is set up for an extension, and we need to make significant changes here to convert our extension to an application. Here is an example of our manifest without any changes:

public Manifest new Manifest(this.manifest) 
{ 
    extension.Name.String  = "My First Extension";
    extension.Publisher.String  = "My Name Here";
   
    //the minimum possible version is 190902, when extensions were introduced
    extension.MinVer.String  = "190902";

    extension.VersionID.String  = "1.0";
    extension.Details.String  = "My really cool first extension that prints Hello World in the overlay";

    //EN-AU is the string for English-Australia
    extension.Locale.String  = "EN-AU";
}
extension.Dependencies(set)
{
   [
      RWE.GameOn.Core;
      RWE.GameOn.Core.Extensions;
      RWE.GameOn;
   ]
}

We will start by replacing all words that read “extension” with “Application” and updating the minimum version:

public Manifest new Manifest(this.manifest) 
{ 
    Application.Name.String  = "My First Extension";
    Application.Publisher.String  = "My Name Here";
   
    //the minimum possible version is 201001, when applications were introduced
    Application.MinVer.String  = "201001";

    Application.VersionID.String  = "1.0";
    Application.Details.String  = "My really cool first extension that prints Hello World in the overlay";

    //EN-AU is the string for English-Australia
    Application.Locale.String  = "EN-AU";
}
extension.Dependencies(set)
{
   [
      RWE.GameOn.Core;
      RWE.GameOn.Core.Extensions;
      RWE.GameOn;
   ]
}

Now we want to make sure we’re moving our settings. Previously, we would have an internal way of accessing the extension settings. Now, however, applications have their own dedicated settings tab in the settings page. If you don’t intend to have any user settings, skip this step!

Within the manifest, we should add the following code underneath the Locale:

Application.Settings.Enabled = true;

//The App Icon should be a white icon, sized 300x300 png with a transparent background
Application.Settings.Icon = "/app_icon.png";

//Describe what type of settings can they get to from the settings icon...
Application.Settings.AltTitle = "User preferences, account settings";

//Finally, the location where settings are stored...
Application.Settings.SettingsFile = "/application_settings.wwa";

Step Three: Adding an application page.

In earlier tutorials, we created a button event that opened a window to print the text “Hello World”. This happened within the In-Game Overlay. We can keep this code to open a window within the In-Game Overlay, however we can also add an App Window that can be accessed through GameOn without the in-game overlay. We can do this by adding the code to the starting code file. Our starting code file might look something like this:

public ExtensionData new ExtensionData(GameOnExtension)
{
    //Initialise extension
    new GameOnOverlayObject(MyFirstExtensionWooHoo)
    {
        OverlayExtensionsRegion.create(new(extensionaccesspoint))
        {
            icon.visibility="visible";         //visible for icon, hidden for text button
            icon.set="/icon.png";              //icon for the button
            alttitle.set="Click Me!";          //hover over tooltip text for button

            //create an activity on button press
            button.activity(new activity)
            {
                new GameOnOverlay.Window(MyWindow)
                {
                    WindowControls.Load();
                }
            }

            if GameOnOverlay.Suspended(true){
                GameOnExtension.State="paused";
            }
        }
    }

We will now add a section above the initialise extension code. This will look like the following:

//Initialise application page
    new GameOnApplication(MyApplicationName){
        ApplicationDashboardRegion.create(new(ApplicationAccessPoint))
        {
              ApplicationAccessPoint.Title = "My Application";

              //The App Icon should be a white icon, sized 300x300 png with a transparent background:
              ApplicationAccessPoint.Icon = "/app_icon.png";    
          
              //The page that opens when the application is launched can be a local or hosted HTML page if you'd like!
              ApplicationAccessPoint.Tab.Src = "application_start.html";

              //Colour scheme options include Green, Lime, Aqua, Teal, Blue, Cyan, Red, Orange, Yellow, Amber, Gold, Maroon, Purple, and more
              ApplicationAccessPoint.ColourScheme = Purple;
        }

Congrats! You now have a working GameOn Application. You should now see (when running in GameOn) that you have a purple application button in the App Dashboard that will launch the application page. You can also now see your settings in the settings menu under App Settings.

This is just a very quick guide on converting an existing extension to an application. We plan to have more advanced guides in the future.

Menu