|
Post by neppi on Feb 22, 2019 11:25:31 GMT -8
Mod interface for Sunrider Academy
This mod introduces a mod interface as shown in the following picture. This is due to better accessibility of standalone mods which have to be called with a command in the main menu otherwise (like the arccheat).
You can insert a mod button into that interface and determine which function it has. The code which has to be placed somewhere in your mod is a list consisting of 5 elements which then is added to the ac_mod_button_list which is called in the main menu. Heres the structure:
init python:
modname_button = ["*path of the button png*","*path of the hover button png*","*starting label*","*show screen*","*run function*"] ac_mod_button_list.append(modname_button)
Attention: Two of the last three elements must be False, as the button only supports ONE function. Example for a mod button starting a label:
init 10 python:
arccheat_button = ["mods/arccheat/mod_arccheat_base.png","mods/arccheat/mod_arccheat_hover.png","arc_cheat2",False,False] ac_mod_button_list.append(arccheat_button)
In the mod folder you will find a template for the mod button and its hover button. The arccheat mod button was created with the font Tw Cen MT in size 32, if you want to keep the style.
Install: Copy the game folder of the .zip into the Sunrider Academy folder. If everything works, you should see a new button in the main menu.
Compatible mods:
|
|
|
Post by triggersegfault on Apr 16, 2019 15:10:32 GMT -8
I've proposed some additions and changes to the Mod Interface to Neppi. This include:- Automatic button text instead of having to pass images for your buttons.
- Mod List viewport for scrolling (if there are ever enough mods for Sunrider Academy to warrant its usage).
- Passing actions directly instead of passing a label screen or function name.
- Addition an optional condition to your button so that it can be hidden from the list when needed.
- And lastly, support for multiple mods making use of config.label_callback without it getting messy by letting the Mod Interface dispatch callback events.
Guidelines have also been set in place for determining if the version of Mod Interface installed is the new proposed implementation, the original implementation, or if it's not installed. The new proposal is also designed to be backwards compatible with the original API, so that mods to not need to upgrade to support newer versions. The source code and full documentation on the API proposal can be found on the GitHub Repo. Obviously this should not be relied upon until the final implementation has been decided with both me and Neppi. Cheers!
|
|