#2622 closed enhancement (fixed)
[PATCH] Gui moddability - splitup of XML files and loading multiple scripts at once
Reported by: | sanderd17 | Owned by: | sanderd17 |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 17 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | leper | Patch: |
Description
For moddability, it's best to have small files. When changes to a file happens, conflicts are easier to resolve.
So instead of having one big XML file, with the entire in-game GUI, it would be better to have it split up in multiple files. With this patch, an object can have an "include" attribute, which contains a path to an XML file. And the children are loaded from that XML file rather than from the big GUI file.
In the patch, I prepared the diplomacy window in this way. Other portions should be split off too for sure.
The second part of the patch allows you to load all scripts in a directory at once. Instead of naming every one of them. This allows modders to just include extra scripts to modify behaviour.
This second part is also needed for victory conditions. Where we want mods being able to add extra victory conditions. So we need to load the entire directory of possible victory conditions, and execute the checks defined on them.
Attachments (3)
Change History (7)
by , 10 years ago
Attachment: | gui_moddability.diff added |
---|
by , 10 years ago
Attachment: | gui_moddability.2.diff added |
---|
comment:2 by , 10 years ago
Keywords: | review removed |
---|
by , 10 years ago
Attachment: | gui_mod_fix.patch added |
---|
Fixes issues. Refactors some of the code too. One TODO, dunno if that is worth fixing.
Fixed whitespace, added recursion check, don't reload the same script twice, added comments and warnings