LunaLua Concept - Improved Launcher

From PGE Wiki
Jump to: navigation, search

This is a concept description about the new launcher. Please note that this is not LunaLoader. The new SMBX Launcher is an extra application which should replace the old launcher window.

Features which are implemented

  • Loading custom HTML files in the Chromium engine
  • Via C++/JS bridge you can specify which episode you want to autoload. In addition you can also set the saveslot and the character you want to play.


Features I want to implement/change

  • Hardcoding a default template page for those Episodes, which don't come with a custom html page. Horikawa already provided such a template.
  • Hardcoding the control bar and embed the main html in an iframe.
  • Handling settings via JSON on per Episode basis.
    • Adding a field in the JSON Episode file for update checking
  • Launcher settings file
    • Added game check

Details: The Episode JSON file

{
    "general":
    {
        "main-page": "index.html",
        "update-check-website": "http://example.org/getVersion.php",
        "version-1": 0,
        "version-2": 7,
        "version-3": 9,
        "version-4": 1        
    },
    "custom":
    {
        "random-data": "Some random data"
    }
}

This JSON file must be called "episode.json" and must be in the episode folder.

The "general" JSON object will be parsed directly by the launcher.
The "custom" JSON object is accessible via Javascript.

The function Launcher.getEpisodeInfo(String episodeSubDir, String jsonFile) will be changed to Launcher.CurrentEpisode.getEpisodeInfo() and returns the currrent "custom" JSON object of the current loaded episode page.

Details: The Update Checker

The update checker can be manually called by Javascript.
The function "boolean Launcher.checkUpdate()" can be called an will return true if the current episode has an update.

The update webpage must return following result:

{
    "current-version":
    {
        "version-1": 0,
        "version-2": 7,
        "version-3": 9,
        "version-4": 1        
    }
}

If the format is invalid or the server can not be contacted then false is returned.

Details: Launcher settings

The launcher settings are stored in: {SMBX-Folder}/launcher/settings.json

The settings page has the following format:

{
    "game":
    {
        "update-check-website": "http://example.org/getVersion.php",
        "version-1": 0,
        "version-2": 7,
        "version-3": 9,
        "version-4": 1        
    }
}

Details: Game version check

Pretty same compared to the update checker on the "per-episode"-basis, but this time the whole game is checked.

The update webpage must return following result:

{
    "current-version":
    {
        "version-1": 0,
        "version-2": 7,
        "version-3": 9,
        "version-4": 1        
    },
    "update-message": "Please update your game!"
}

Details: Current Javascript reference

Complete JS Reference:

/*
 ************************
	   MAIN
 ************************
 Functions:
 Launcher.runSMBX()
 Launcher.runSMBXEditor()
 Launcher.loadEpisodeWebpage(String name)

 ************************
     Current Episode
 ************************

 Launcher.CurrentEpisode.getEpisodeInfo() // Will be reseted, when a new episode page is loaded.

 ************************
	Autostart
 ************************
 Properties:
 Launcher.Autostart.useAutostart = bool
 Launcher.Autostart.singleplayer = bool
 Launcher.Autostart.character1 = int
 Launcher.Autostart.character2 = int
 Launcher.Autostart.saveSlot = int
 */

Removed JS functions:

Launcher.Autostart.episodeName = String   //Because of "localizing" to the current episode.


Status

Planning