Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Tomo on October 24, 2009, 11:31:54 am

Title: Patch to display currently selected Mod
Post by: Tomo on October 24, 2009, 11:31:54 am
It's often useful have a reminder of which Mod you've got selected, and when debugging it's nice to know whether your modlist got processed in the order you expected.
(Inspired by the Portej's thread suggesting that we look at how data gets loaded again)

This is particularly useful if you prefer to use a different Pilot file depending

Attached is a small .patch file that shows the currently selected Mod in the Pilot Selection and Mainhall screen.
(Built against r5620)

In Release it only shows the first tag after -mod, in Debug it shows the full list.

[attachment deleted by admin]
Title: Re: Patch to display currently selected Mod
Post by: Zacam on October 24, 2009, 05:50:26 pm
Does exactly as advertised on the tin.

Nice job.
Title: Re: Patch to display currently selected Mod
Post by: Goober5000 on October 24, 2009, 07:14:00 pm
It would be better to show the full mod list even in release builds.  There's no guarantee that a bug will only pop up in the first mod on the list.
Title: Re: Patch to display currently selected Mod
Post by: Zacam on October 24, 2009, 09:52:04 pm
Okay. Fatal Flaw here. We may just want it to parse the mod name from the mod.ini rather than the primary/secondary list fields.

Reason for this is for SVN testing the MediaVPs, they are not in VP format, and it barfs once the directory listing strings hit's the character limit.
Title: Re: Patch to display currently selected Mod
Post by: The E on October 25, 2009, 07:06:02 am
Same goes for Blue Planet. We use a similar setup for our svn folders.
Title: Re: Patch to display currently selected Mod
Post by: Tomo on October 26, 2009, 03:04:58 am
Ooops - I missed out the max_size sanity check.
I'm obviously too used to Delphi silently preventing buffer overflows in the string types.
*mutters* char is not string, char is not string...

@Goober:
Could be. I trimmed it in Release builds as the list is often long.

@ Zacam, The_E:
I specifically avoided opening mod.ini because FS2Open actually never touches it - it's only used by the Launcher to build the command line.

I suppose that takes us back to the stuff raised by Portej.

As a start to that, would it make sense for FS2Open to handle the Mod.Ini stuff itself, with the Launcher merely pointing FS2 at it?
For backwards compatibility:
FS2 counts -mod command line terms.
- If there is only one Mod term, process Mod.Ini to find the rest.
- Otherwise, process the additional terms.

Patch attached that corrects the issue.
This is also built against 5620, so revert to SVN before applying.

[attachment deleted by admin]
Title: Re: Patch to display currently selected Mod
Post by: portej05 on October 26, 2009, 03:09:32 am
Tomo, use std::string.
Title: Re: Patch to display currently selected Mod
Post by: Goober5000 on October 26, 2009, 09:02:38 pm
I suspect the most useful format for displaying -mod information is, unfortunately, what we see in fs2_open.log.

Perhaps a change in strategy is in order.  What if we added a hotkey that displayed the -mod information in a gigantic popup window?