Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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)

modCredits.diff (8.9 KB ) - added by sanderd17 8 years ago.

Download all attachments as: .zip

Change History (7)

by sanderd17, 8 years ago

Attachment: modCredits.diff added

comment:1 by Imarok, 8 years ago

Why not just changing the wide of the credits window if a button was added?

comment:2 by sanderd17, 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.

Last edited 8 years ago by sanderd17 (previous) (diff)

in reply to:  2 comment:3 by Imarok, 8 years ago

Replying to sanderd17:

And what if 5 buttons were added?

Then you could add a new column

comment:4 by elexis, 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 uses i in one place and g_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 using GetTextWidth (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:5 by sanderd17, 8 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 18281:

Make it easier for mods to add their own credits. Fixes #3986

comment:6 by sanderd17, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.