Menu: Fixed dialog alignments by changing strings to textfields

This commit is contained in:
Marco Cawthorne 2019-01-16 02:16:44 +01:00
parent 7597f23a9d
commit 280fa8d99a
6 changed files with 18 additions and 9 deletions

View file

@ -27,22 +27,27 @@ string Colors_RGB8_to_HEX(vector color)
switch (b) {
case 10:
a = "A";
break;
case 11:
a = "B";
break;
case 12:
a = "C";
break;
case 13:
a = "D";
break;
case 14:
a = "E";
break;
case 15:
a = "F";
break;
default:
a = ftos(b);
}
out = sprintf("%s%s", out, a);
}
return out;
}

View file

@ -31,6 +31,7 @@ int font_label;
int font_label_b;
int font_console;
int font_arial;
int font_label_p;
typedef struct {
void() m_init;

View file

@ -13,7 +13,8 @@ void m_init(void)
font_console = loadfont( "font", "", "12", -1 );
font_label = loadfont( "label", "gfx/shell/mssansserif.ttf", "10 12 14", -1 );
font_arial = loadfont( "label", "gfx/shell/arial.ttf", "14", -1 );
font_label_b = loadfont( "label_b", "gfx/shell/arialbd.ttf", "14 12 16", -1 );
font_label_b = loadfont( "label_b", "gfx/shell/arialbd.ttf", "14 12", -1 );
font_label_p = loadfont( "label_p", "gfx/shell/arialbd.ttf", "16", -1 );
localcmd("plug_load ffmpeg\n");
localcmd("con_textsize -12\n");

View file

@ -181,7 +181,7 @@ void menu_main_init(void)
main_btnQuitCancel.SetLength(68);
main_btnQuitCancel.SetExecute(btn_quit_cancel);
Widget_Add(main_dgQuit, main_btnQuitCancel);
/* Main Menu (Connected) */
fn_main2 = spawn(CWidget);
main_btn2Console = spawn(CMainButton);
@ -293,8 +293,10 @@ void menu_main_draw(void)
if (main_quitdialog) {
main_dgQuit.Draw();
WLabel_Static(203, 180, m_reslbl[IDS_MAIN_QUITPROMPT], 16, 16,
col_prompt_text, 1.0f, 0, font_label_b);
/*WLabel_Static(203, 180, m_reslbl[IDS_MAIN_QUITPROMPT], 16, 16,
col_prompt_text, 1.0f, 0, font_label_b);*/
WField_Static(162, 180, m_reslbl[IDS_MAIN_QUITPROMPT], 320, 260,
col_prompt_text, 1.0f, 2, font_label_p);
Widget_Draw(main_dgQuit);
}

View file

@ -192,10 +192,10 @@ void menu_multiplayer_draw(void)
inet_btnrefresh();
}
mp_dgConnect.Draw();
WLabel_Static(203, 180, m_reslbl[IDS_WON_LOGIN], 16, 16,
col_prompt_text, 1.0f, 0, font_label_b);
WLabel_Static(180, 280, sprintf(m_reslbl[IDS_QUICK_REQUEST],g_connecttimer), 12, 12,
col_prompt_title, 1.0f, 0, font_label);
WField_Static(162, 180, m_reslbl[IDS_WON_LOGIN], 320, 260,
col_prompt_text, 1.0f, 2, font_label_p);
WField_Static(162, 280, sprintf(m_reslbl[IDS_QUICK_REQUEST],g_connecttimer), 320, 260,
col_prompt_title, 1.0f, 2, font_label);
g_connecttimer -= frametime;
Master_ResortCache();
}

Binary file not shown.