Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6438 from Goober5000/mod_string_tweak
Browse files Browse the repository at this point in the history
allow the mod title and version to be displayed independently
  • Loading branch information
Goober5000 authored Dec 9, 2024
2 parents de5421d + c0ca5ff commit 25a04fc
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions code/menuui/mainhallmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1824,12 +1824,20 @@ void main_hall_blit_version()
*/
void main_hall_blit_mod()
{
if ((!Mod_title.empty()) && (!Mod_version.empty())) {

if (!Mod_title.empty() || !Mod_version.empty()) {
int w, h;
SCP_string mod_string;

// build the string

if (!Mod_title.empty())
mod_string = Mod_title;

// format the version string
auto mod_string = Mod_title + " " + Mod_version;
if (!Mod_title.empty() && !Mod_version.empty())
mod_string += " ";

if (!Mod_version.empty())
mod_string += Mod_version;

int old_font = font::get_current_fontnum();
font::set_font(Main_hall->font);
Expand All @@ -1842,7 +1850,6 @@ void main_hall_blit_mod()
gr_string(5, gr_screen.max_h_unscaled_zoomed - (h * 3 + 6), mod_string.c_str(), GR_RESIZE_MENU_ZOOMED);

font::set_font(old_font);

}
}

Expand Down

0 comments on commit 25a04fc

Please sign in to comment.