I'm tooling around with GW, trying to make a completely separate environment to the normal GW, such that both could exist simultaneously and not conflict. This would be so that a mod could add a new game mode, while the original is still available and untouched, and there are benefits such as the mod wouldn't break with a gw update. If possible I want to touch zero files in the original galactic war: no shadowing, no hijacking of functions, etc. Ideally, the only scene to change would be the main menu to add a button to the new gw. All I've done so far is make a copy of the galactic war, renamed the directory, relinked all the links inside the new gw to itself, and added a button on the main menu to start it. Being a naive copy it loads saves from the same storage etc. If and when I get round to making a new game mode all that stuff will be replaced, so far I'm just testing how it works. The above works, until you finish a match, whereby it pops up the normal galactic war "return to galactic war" dialogue, then takes you to the normal galactic war. Is there a way to make it return to where I want it to, without touching the navToGW function in gw_game_over.js in the normal GW? I could hijack that function and save a variable in local storage to define which gw files to use, but that makes some assumptions about the original gw files, which may break in updates. It also leads to issues with having to change the original gw further to use or at least clear the local storage variable described, otherwise bad shut downs could lead to erroneously going back to the custom gw when you were playing the original. The original gw_game_over would also have to be hacked about with if that were to be customised in the custom gw. Ideally, connect_to_game.html would accept an optional additional field in the get request. Currently gw does this to start a match: Code: window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?action=start&mode=gw'; I'd like an optional additional field like this: Code: window.location.href = 'coui://ui/main/game/connect_to_game/connect_to_game.html?action=start&mode=gw&type=my_gw'; , which would use a galactic war defined in the directory "ui/main/game/my_gw", instead of "ui/main/game/galactic_war". When a gw match finishes, it would then automatically use the custom gw mode defined instead of the original. Can the devs consider adding this field so mods can add gw modes without painful breakages every update?
You could have your live_game_patch put a wrapper around handlers.server_state to swap out the url if it matches the standard gw_game_over one. The "url from server" bit is kind of messy given that the UI mostly runs locally.
That looks ideal, thank you. From the looks of it, we can easily create self-contained gw modes that definitely maybe won't break every patch