From d6f232192e74eff71608b47f2f6f35c78782c6e7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 18 Nov 2015 20:21:31 +0100 Subject: [PATCH] Display grid size sliders values in a nicer way (e.g. 0.005 -> 0.5%) and grey out the entire line when sliders are disabled (not just the sliders) --- qcsrc/menu/xonotic/dialog_hudsetup_exit.qc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc b/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc index a4ebbb2cf..bb83510a4 100644 --- a/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc +++ b/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc @@ -124,18 +124,21 @@ void XonoticHUDExitDialog_fill(entity me) me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Grid size:"))); + setDependent(e, "hud_configure_grid", 1, 1); me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("X:"))); + setDependent(e, "hud_configure_grid", 1, 1); me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_xsize")); for(i = 1; i <= 14; ++i) - e.addValue(e, strzone(ftos_decimals(i/200, 3)), strzone(ftos(i/200))); + e.addValue(e, strzone(sprintf("%.1f%%", i/2)), strzone(ftos(i/200))); e.configureXonoticTextSliderValues(e); - setDependent(e, "hud_configure_grid", 1, 1); + setDependent(e, "hud_configure_grid", 1, 1); me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("Y:"))); + setDependent(e, "hud_configure_grid", 1, 1); me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_ysize")); for(i = 1; i <= 14; ++i) - e.addValue(e, strzone(ftos_decimals(i/200, 3)), strzone(ftos(i/200))); + e.addValue(e, strzone(sprintf("%.1f%%", i/2)), strzone(ftos(i/200))); e.configureXonoticTextSliderValues(e); - setDependent(e, "hud_configure_grid", 1, 1); + setDependent(e, "hud_configure_grid", 1, 1); me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", 1)); -- 2.39.2