Jump to content

Modding pregame page in 0 A.D. 28


Mentula
 Share

Recommended Posts

Hi devs and modders,

In 0 A.D. 27 and before it was possible to mod the pregame page by adding scripts to the gui/pregame folder. Example of applications are: adding items to the main menu; running startup scripts.

Since commit 0fcc4f5fc5 the gui/pregame directory is not loaded anymore, in favour of loading the mainmenu.js file only. It is not clear how mod scripts can run in this page after this change.

 It is not an option to override mainmenu.js, mainmenu.xml, page_pregame.xml or other files. This will of course break the compatibility with other mods, as only the last loaded mod will execute the code.

Maybe @phosit, do you have an idea? I am pinging you as the author of the change.

Thanks.

  • Like 1
Link to comment
Share on other sites

20 minutes ago, Stan` said:

Can't you add a file like autociv like so ~mainmenu.js to extend it ?

That's the point. If the directory gui/pregame was loaded by the xml - like it was before:

<script directory="gui/pregame/"/>

then one could create a file named mainmenu~MyMod.js and do all sort of scripting therein (for example making proxies of existing functions).

But this is not the case anymore for the pregame page. At first glance, this is the only page which changed behaviour. To make a comparison, session.xml is still loading the entire directory gui/session:

<script directory="gui/session/"/>

 

32 minutes ago, Stan&#x60; said:

Nice to see you're still active!

I wish I was! :) New release, new work for porting mods. I played my last game in 2023, but 0 A.D. is always in my heart. :heart:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...