seta hud_panel_quickmenu_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
seta hud_panel_quickmenu_bg_border "" "if set to something else than \"\" = override default size of border around the background"
seta hud_panel_quickmenu_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_quickmenu_align "text alignment: 0 left, 0.5 center, 1 right"
seta hud_panel_quickmenu_bg_alpha ""
seta hud_panel_quickmenu_bg_border ""
seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
menu_sync
seta hud_panel_quickmenu_bg_alpha ""
seta hud_panel_quickmenu_bg_border ""
seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
menu_sync
seta hud_panel_quickmenu_bg_alpha ""
seta hud_panel_quickmenu_bg_border ""
seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
menu_sync
seta hud_panel_quickmenu_bg_alpha ""
seta hud_panel_quickmenu_bg_border ""
seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "1"
menu_sync
seta hud_panel_quickmenu_bg_alpha ""
seta hud_panel_quickmenu_bg_border ""
seta hud_panel_quickmenu_bg_padding ""
+seta hud_panel_quickmenu_align "0"
menu_sync
float autocvar_hud_panel_weapons_timeout;
float autocvar_hud_panel_weapons_timeout_effect;
float autocvar_hud_panel_quickmenu;
+float autocvar_hud_panel_quickmenu_align;
float autocvar_hud_progressbar_alpha;
float autocvar_hud_showbinds;
float autocvar_hud_showbinds_limit;
const vector cursorsize = '32 32 0';
drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursorsize, '1 1 1', 0.8, DRAWFLAG_NORMAL);
}
+void HUD_QuickMenu_DrawEntry(vector pos, string s, vector fontsize)
+{
+ string entry;
+ float offset;
+ entry = textShortenToWidth(s, panel_size_x, fontsize, stringwidth_colors);
+ if (autocvar_hud_panel_quickmenu_align > 0)
+ {
+ offset = (panel_size_x - stringwidth_colors(entry, fontsize)) * min(autocvar_hud_panel_quickmenu_align, 1);
+ drawcolorcodedstring(pos + eX * offset, entry, fontsize, 1, DRAWFLAG_ADDITIVE);
+ }
+ else
+ drawcolorcodedstring(pos + eY * (panel_size_y - fontsize_y), entry, fontsize, 1, DRAWFLAG_ADDITIVE);
+}
void HUD_QuickMenu(void)
{
if(!autocvar__hud_configure)
float i;
vector fontsize;
- string entry, color;
+ string color;
fontsize = '1 1 0' * (panel_size_y / QUICKMENU_MAXLINES);
if (!QuickMenu_IsLastPage)
{
color = "^5";
- entry = textShortenToWidth(sprintf("%d: %s%s", 0, color, _("Continue...")), panel_size_x, fontsize, stringwidth_colors);
- drawcolorcodedstring(panel_pos + eY * (panel_size_y - fontsize_y), entry, fontsize, 1, DRAWFLAG_ADDITIVE);
+ HUD_QuickMenu_DrawEntry(panel_pos + eY * (panel_size_y - fontsize_y), sprintf("%d: %s%s", 0, color, _("Continue...")), fontsize);
}
else
panel_pos_y += ((QUICKMENU_MAXLINES - QuickMenu_Entries) * fontsize_y) / 2;
color = "^4";
else
color = "^3";
- entry = textShortenToWidth(sprintf("%d: %s%s", i, color, QuickMenu_Description[i]), panel_size_x, fontsize, stringwidth_colors);
- drawcolorcodedstring(panel_pos, entry, fontsize, 1, DRAWFLAG_ADDITIVE);
+ HUD_QuickMenu_DrawEntry(panel_pos, sprintf("%d: %s%s", i, color, QuickMenu_Description[i]), fontsize);
panel_pos_y += fontsize_y;
}
}
HUD_Write_PanelCvar_q("_fade_subsequent_minfontsize");
HUD_Write_PanelCvar_q("_fade_minfontsize");
break;
+ case HUD_PANEL_QUICKMENU:
+ HUD_Write_PanelCvar_q("_align");
+ break;
}
HUD_Write("\n");
}
string panelname = "quickmenu";
DIALOG_HUDPANEL_COMMON();
+
+ me.TR(me);
+ me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Text alignment:")));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_quickmenu_align", "0", _("Left")));
+ me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_quickmenu_align", "0.5", _("Center")));
+ me.TD(me, 1, 3.8/3, e = makeXonoticRadioButton(3, "hud_panel_quickmenu_align", "1", _("Right")));
}
#endif