Opened 10 years ago
Closed 10 years ago
#2487 closed enhancement (duplicate)
[PATCH] Gather mod informations and configuration
Reported by: | Itms | Owned by: | Itms |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 17 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Based on my old #2118 patch, I propose this one, aimed at gathering mod data in a file at the root of the mod. The system should be general enough to suit every mod. Please give me feedback about it!
Attachments (3)
Change History (15)
by , 10 years ago
Attachment: | patch_moddata.patch added |
---|
comment:1 by , 10 years ago
Milestone: | Backlog → Alpha 17 |
---|
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Internationalization notes:
- As we spoke on IRC, extract the font tags outside:
sprintf(translate("[font=\"sans-bold-16\"]%(versionName)s: %(versionNickname)s[/font]\n\n")
to"[font=\"sans-bold-16\"]" + sprintf(translate(%(versionName)s: %(versionNickname)s") + "[font=\"sans-bold-16\"]"
- Add the following to the
messages.json
file to extract the keys of the INI file:{ "extractor": "ini", "filemasks": [ "config/public.cfg" ], "options": { "format": "none", "keywords": [ "title", "version.name", "version.nickname", "version.number" ] } },
- Translate those keywords in display strings. For example, change:
{versionName: Engine.ConfigDB_GetValue("mod", "version.name"), versionNickname: Engine.ConfigDB_GetValue("mod", "version.nickname")}
to{versionName: translate(Engine.ConfigDB_GetValue("mod", "version.name")), versionNickname: translate(Engine.ConfigDB_GetValue("mod", "version.nickname"))}
PS: I’m glad that we can get rid of those ugly keep/translate XML tags here.
comment:4 by , 10 years ago
Description: | modified (diff) |
---|
Updated the patch to use Gallaecio's improvements and cleaned up the organization of new files.
by , 10 years ago
Attachment: | patch_moddata.2.patch added |
---|
comment:5 by , 10 years ago
Cc: | added |
---|
by , 10 years ago
Attachment: | patch_moddata.3.patch added |
---|
comment:8 by , 10 years ago
What happens when multiple mods are loaded?
Is this still a valid ticket, or are there better approaches? I know you discussed with leper, but I didn't follow the discussions.
comment:9 by , 10 years ago
sander mentioned in another ticket that the same file in a mod can't be overriden more than once.
If this worked then - when loading multiple mods - the last loaded mod that provides a info.cfg would get used for the ingame mod information in the main menu.
comment:10 by , 10 years ago
Overriding a file in different mods works just fine (it uses the file in the last mounted mod) (or the last mounted mod that has the file).
comment:11 by , 10 years ago
Cc: | removed |
---|---|
Milestone: | Alpha 17 → Alpha 18 |
Pushing this for leper's eyes only. The attached patch is in any case invalid due to r15676 et al.
comment:12 by , 10 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 18 → Alpha 17 |
Resolution: | → duplicate |
Status: | new → closed |
Most of what this ticket tried to solve is done using the mod.json files now. Everything that is left can be done by adding some files to a mod (version display). Having a mod specific config file might be useful at some point, but will probably give some issues with having two mods which both need some settings, and should be done in another ticket.
In 15001: