#3986 closed enhancement (fixed)
[PATCH] Make it easy for modders to extend the credits
Reported by: | sanderd17 | Owned by: | sanderd17 |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 21 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Itms | Patch: |
Description
In the patch below, the buttons have been placed in a vertical column, that may not look as nice (as it loses the nice symmetries of the dialog). But it allows the list of buttons to become a lot longer.
With the patch, modders can easily add their own credit files by adding the JSON files they want, and extending the g_PanelNames (which can be done with an extra single-line script).
It would be even nicer if the g_PanelNames array could be removed, and the Gui would have access to reading all JSON files in a directory.
Attachments (1)
Change History (7)
by , 8 years ago
Attachment: | modCredits.diff added |
---|
comment:1 by , 8 years ago
follow-up: 3 comment:2 by , 8 years ago
And what if 5 buttons were added?
It shouldn't be uncommon to have a few mods loaded, and every mod can add a few credit files.
But you're welcome to implement different proposals ofc.
comment:3 by , 8 years ago
comment:4 by , 8 years ago
- It's certainly useful to generate the buttons dynamically in the XML.
- newline after
button.size =...
and maybe after the early return too selectPanel
usesi
in one place andg_ActivePanel
in another should be consistent- The
g_PanelTexts
array -> object change is nice messages.json
is ready for the change already- Checked with
generateLongStringTranslations.py
and seems to be fine. However it is also unpredictable what categories mods add. The buttons could resized depending on their text size usingGetTextWidth
(or use the greatest textwidth found for all of them) and probably with a hardcoded maximum width. In case you'd give the individual buttons different sizes, they should be placed horizontally, otherwise vertical distribution is equivalent with regards to consumed screen space. - Tested, works. Green light from me with or without dynamic resizing way.
comment:6 by , 8 years ago
Keywords: | review removed |
---|
Why not just changing the wide of the credits window if a button was added?