Skip to content

Commit 0a04405

Browse files
author
dashodanger
committed
Font-related CTD fixes; restore "Custom Game Length"
1 parent ae2b02a commit 0a04405

File tree

4 files changed

+51
-37
lines changed

4 files changed

+51
-37
lines changed

modules/custom_game_length.lua

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
CUSTOM_GAME_LENGTH = {}
2+
3+
function CUSTOM_GAME_LENGTH.setup(self)
4+
5+
module_param_up(self)
6+
7+
end
8+
9+
OB_MODULES["length_params"] =
10+
{
11+
12+
name = "length_params",
13+
14+
label = _("Game Length Options"),
15+
16+
where = "experimental",
17+
game = {doom2=1,tnt=1,plutonia=1},
18+
priority = 5,
19+
20+
tooltip = _("Alter the amount of levels used with the Full Game length option. Will probably break something."),
21+
22+
hooks =
23+
{
24+
setup = CUSTOM_GAME_LENGTH.setup,
25+
},
26+
27+
options =
28+
{
29+
{
30+
name = "float_full_game_length",
31+
label = _("Full Game Length"),
32+
valuator = "slider",
33+
units = _(" Levels"),
34+
min = 1,
35+
max = 100,
36+
increment = 1,
37+
default = 32,
38+
tooltip = _("Sets the number of levels in a full game. May cause issues if this value does not match the original game."),
39+
priority = 101,
40+
},
41+
},
42+
}

source/m_theme.cc

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,6 @@ class UI_ThemeWin : public Fl_Window
500500
main_win->menu_bar->labelsize(FL_NORMAL_SIZE * .90);
501501
main_win->menu_bar->redraw();
502502
main_win->game_box->heading->labelsize(header_font_size);
503-
main_win->game_box->engine->labelsize(FL_NORMAL_SIZE);
504-
main_win->game_box->engine->textsize(FL_NORMAL_SIZE);
505-
main_win->game_box->engine->copy_label(" "
506-
" ");
507-
main_win->game_box->engine_help->copy_label("");
508-
main_win->game_box->engine_help->labelsize(FL_NORMAL_SIZE);
509503
main_win->game_box->game_help->labelsize(FL_NORMAL_SIZE);
510504
main_win->game_box->game_help->copy_label("");
511505
main_win->game_box->game->labelsize(FL_NORMAL_SIZE);
@@ -534,12 +528,10 @@ class UI_ThemeWin : public Fl_Window
534528
{
535529
main_win->game_box->child(x)->redraw();
536530
}
537-
main_win->game_box->engine->copy_label("Engine: ");
538531
main_win->game_box->game->copy_label("Game: ");
539532
main_win->game_box->port->copy_label("Port: ");
540533
main_win->game_box->length->copy_label("Length: ");
541534
main_win->game_box->theme->copy_label("Theme: ");
542-
main_win->game_box->engine_help->copy_label("?");
543535
main_win->game_box->port_help->copy_label("?");
544536
main_win->game_box->length_help->copy_label("?");
545537
main_win->game_box->game_help->copy_label("?");
@@ -622,12 +614,6 @@ class UI_ThemeWin : public Fl_Window
622614
main_win->menu_bar->textfont(font_style);
623615
main_win->menu_bar->redraw();
624616
main_win->game_box->heading->labelfont(font_style | FL_BOLD);
625-
main_win->game_box->engine->labelfont(font_style);
626-
main_win->game_box->engine->textfont(font_style);
627-
main_win->game_box->engine->copy_label(" "
628-
" ");
629-
main_win->game_box->engine_help->copy_label("");
630-
main_win->game_box->engine_help->labelfont(font_style);
631617
main_win->game_box->game_help->labelfont(font_style);
632618
main_win->game_box->game_help->copy_label("");
633619
main_win->game_box->game->labelfont(font_style);
@@ -656,12 +642,10 @@ class UI_ThemeWin : public Fl_Window
656642
{
657643
main_win->game_box->child(x)->redraw();
658644
}
659-
main_win->game_box->engine->copy_label("Engine: ");
660645
main_win->game_box->game->copy_label("Game: ");
661646
main_win->game_box->port->copy_label("Port: ");
662647
main_win->game_box->length->copy_label("Length: ");
663648
main_win->game_box->theme->copy_label("Theme: ");
664-
main_win->game_box->engine_help->copy_label("?");
665649
main_win->game_box->port_help->copy_label("?");
666650
main_win->game_box->length_help->copy_label("?");
667651
main_win->game_box->game_help->copy_label("?");
@@ -1221,8 +1205,6 @@ class UI_ThemeWin : public Fl_Window
12211205
main_win->menu_bar->textcolor(FONT_COLOR);
12221206
main_win->menu_bar->redraw();
12231207
main_win->game_box->heading->labelcolor(FONT_COLOR);
1224-
main_win->game_box->engine->labelcolor(FONT_COLOR);
1225-
main_win->game_box->engine_help->labelcolor(FONT_COLOR);
12261208
main_win->game_box->game->labelcolor(FONT_COLOR);
12271209
main_win->game_box->game_help->labelcolor(FONT_COLOR);
12281210
main_win->game_box->port->labelcolor(FONT_COLOR);
@@ -1322,7 +1304,6 @@ class UI_ThemeWin : public Fl_Window
13221304
{
13231305
FONT2_COLOR = fl_rgb_color(text2_red, text2_green, text2_blue);
13241306
}
1325-
main_win->game_box->engine->textcolor(FONT2_COLOR);
13261307
main_win->game_box->game->textcolor(FONT2_COLOR);
13271308
main_win->game_box->port->textcolor(FONT2_COLOR);
13281309
main_win->game_box->length->textcolor(FONT2_COLOR);
@@ -1441,7 +1422,6 @@ class UI_ThemeWin : public Fl_Window
14411422
main_win->color(GAP_COLOR, SELECTION);
14421423
main_win->menu_bar->selection_color(SELECTION);
14431424
main_win->redraw();
1444-
main_win->game_box->engine->selection_color(SELECTION);
14451425
main_win->game_box->game->selection_color(SELECTION);
14461426
main_win->game_box->port->selection_color(SELECTION);
14471427
main_win->game_box->length->selection_color(SELECTION);

source/main.cc

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,12 @@ void Main::PopulateFontMap()
519519
{
520520

521521
#ifdef __APPLE__
522-
font_menu_items.push_back({"Sans <Default>", 0});
523-
font_menu_items.push_back({"Courier <Internal>", 4});
524-
font_menu_items.push_back({"Times <Internal>", 8});
525-
font_menu_items.push_back({"Screen <Internal>", 13});
522+
font_menu_items.push_back({"Helvetica <Internal>", FL_HELVETICA});
523+
font_menu_items.push_back({"Courier <Internal>", FL_COURIER});
524+
font_menu_items.push_back({"Times <Internal>", FL_TIMES});
525+
font_menu_items.push_back({"Screen <Internal>", FL_SCREEN});
526526
#else
527527

528-
// TODO - If feasible, find a better way to automate this/crawl for
529-
// *.ttf files
530-
531528
// Load bundled fonts. Fonts without a bold variant are essentially
532529
// loaded twice in a row so that calls for a bold variant don't
533530
// accidentally change fonts
@@ -537,7 +534,7 @@ void Main::PopulateFontMap()
537534
// modified in some fashion, and the OFL 1.1 license dictates that
538535
// modified versions cannot display their Reserved Name to users
539536

540-
int current_free_font = 16;
537+
int current_free_font = FL_ZAPF_DINGBATS+1;
541538

542539
if (LoadInternalFont("./theme/fonts/SourceSansPro/SourceSansPro-Regular.ttf", current_free_font,
543540
"Source Sans Pro"))
@@ -550,10 +547,10 @@ void Main::PopulateFontMap()
550547
}
551548
}
552549

553-
font_menu_items.push_back({"Sans <Internal>", 0});
554-
font_menu_items.push_back({"Courier <Internal>", 4});
555-
font_menu_items.push_back({"Times <Internal>", 8});
556-
font_menu_items.push_back({"Screen <Internal>", 13});
550+
font_menu_items.push_back({"Helvetica <Internal>", FL_HELVETICA});
551+
font_menu_items.push_back({"Courier <Internal>", FL_COURIER});
552+
font_menu_items.push_back({"Times <Internal>", FL_TIMES});
553+
font_menu_items.push_back({"Screen <Internal>", FL_SCREEN});
557554

558555
if (LoadInternalFont("./theme/fonts/Avenixel/Avenixel-Regular.ttf", current_free_font, "Avenixel"))
559556
{
@@ -629,7 +626,6 @@ void Main::PopulateFontMap()
629626
}
630627
#endif
631628
}
632-
// lossy conversion, size_t?
633629
num_fonts = static_cast<int>(font_menu_items.size());
634630
}
635631

source/ui_game.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class UI_Game : public Fl_Group
3131
{
3232
public:
3333
Fl_Box *heading;
34-
UI_RChoiceMenu *engine;
35-
UI_HelpLink *engine_help;
3634
UI_RChoiceMenu *game;
3735
UI_HelpLink *game_help;
3836
UI_RChoiceMenu *port;
@@ -60,12 +58,10 @@ class UI_Game : public Fl_Group
6058
void SetAbortButton(bool abort);
6159

6260
private:
63-
static void callback_Engine(Fl_Widget *, void *);
6461
static void callback_Game(Fl_Widget *, void *);
6562
static void callback_Port(Fl_Widget *, void *);
6663
static void callback_Length(Fl_Widget *, void *);
6764
static void callback_Theme(Fl_Widget *, void *);
68-
static void callback_EngineHelp(Fl_Widget *, void *);
6965
static void callback_GameHelp(Fl_Widget *, void *);
7066
static void callback_PortHelp(Fl_Widget *, void *);
7167
static void callback_LengthHelp(Fl_Widget *, void *);

0 commit comments

Comments
 (0)