X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_hudsetup_exit.qc;h=6cfcef251ca9afa6afed9ef541c6776650ea05b8;hb=HEAD;hp=bb83510a402be567c6f0c59029e86f69a5031666;hpb=d6f232192e74eff71608b47f2f6f35c78782c6e7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc b/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc index bb83510a4..6cfcef251 100644 --- a/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc +++ b/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc @@ -1,20 +1,14 @@ -#ifndef DIALOG_HUDSETUP_EXIT_H -#define DIALOG_HUDSETUP_EXIT_H -#include "rootdialog.qc" -CLASS(XonoticHUDExitDialog, XonoticRootDialog) - METHOD(XonoticHUDExitDialog, fill, void(entity)); - ATTRIB(XonoticHUDExitDialog, title, string, _("Panel HUD Setup")) - ATTRIB(XonoticHUDExitDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT) - ATTRIB(XonoticHUDExitDialog, intendedWidth, float, 0.8) - ATTRIB(XonoticHUDExitDialog, rows, float, 18) - ATTRIB(XonoticHUDExitDialog, columns, float, 8.2) - ATTRIB(XonoticHUDExitDialog, name, string, "HUDExit") - ATTRIB(XonoticHUDExitDialog, requiresConnection, float, true) -ENDCLASS(XonoticHUDExitDialog) +#include "dialog_hudsetup_exit.qh" -#endif +#include "textlabel.qh" +#include "button.qh" +#include "textslider.qh" +#include "inputbox.qh" +#include "hudskinlist.qh" +#include "colorpicker_string.qh" +#include "checkbox.qh" +#include "commandbutton.qh" -#ifdef IMPLEMENTATION void XonoticHUDExitDialog_fill(entity me) { entity e; @@ -24,22 +18,29 @@ void XonoticHUDExitDialog_fill(entity me) me.TR(me); me.TD(me, 1, 4, makeXonoticHeaderLabel(_("HUD skins"))); me.TR(me); - me.TD(me, 1, 0.9, e = makeXonoticButton(_("Refresh"), '0 0 0')); - e.onClick = HUDSkinList_Refresh_Click; - e.onClickEntity = hudskinlist; - me.TDempty(me, 0.1); - me.TD(me, 1, 1, e = makeXonoticTextLabel(1, _("Filter:"))); - me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null)); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.7, e = makeXonoticTextLabel(0.5, _("Filter:"))); + me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null)); e.onChange = HUDSkinList_Filter_Change; e.onChangeEntity = hudskinlist; - hudskinlist.controlledTextbox = e; me.TR(me); - me.TD(me, 13.5, 4, hudskinlist); - me.gotoRC(me, me.rows - 2.5, 0); - me.TDempty(me, 0.75); - me.TD(me, 1, 2.5, e = makeXonoticButton(_("Set skin"), '0 0 0')); + me.TD(me, 12, 4, hudskinlist); + me.gotoRC(me, me.rows - 4, 0); + me.TDempty(me, 0.2); + me.TD(me, 1, 1.4, e = makeXonoticButton(_("Refresh"), '0 0 0')); + e.onClick = HUDSkinList_Refresh_Click; + e.onClickEntity = hudskinlist; + me.TD(me, 1, 2.2, e = makeXonoticButton(_("Set skin"), '0 0 0')); e.onClick = SetHUDSkin_Click; e.onClickEntity = hudskinlist; + me.gotoRC(me, me.rows - 2.5, 0); + me.TD(me, 1, 2, e = makeXonoticButton_T(_("Save current skin"), '0 0 0', + "Note: HUD skins are saved in data/data/ directory and can be manually renamed/deleted from there")); + e.onClick = SaveHUDSkin_Click; + e.onClickEntity = hudskinlist; + me.TD(me, 1, 2, e = makeXonoticInputBox(0, string_null)); + e.onChange = HUDSkinList_SavedName_Change; + e.onChangeEntity = hudskinlist; me.gotoRC(me, 0, 4.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Panel background defaults:"))); @@ -117,10 +118,8 @@ void XonoticHUDExitDialog_fill(entity me) e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10))); e.configureXonoticTextSliderValues(e); me.TR(me); - me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Grid settings:"))); - me.TR(me); - me.TDempty(me, 0.2); - me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_configure_grid", _("Snap panels to grid"))); + me.TD(me, 1, 1.4, makeXonoticTextLabel(0, _("Grid settings:"))); + me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "hud_configure_grid", _("Snap panels to grid"))); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Grid size:"))); @@ -139,8 +138,12 @@ void XonoticHUDExitDialog_fill(entity me) e.addValue(e, strzone(sprintf("%.1f%%", i/2)), strzone(ftos(i/200))); e.configureXonoticTextSliderValues(e); setDependent(e, "hud_configure_grid", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + string vertical_lines_cvarname = "hud_configure_vertical_lines"; + me.TD(me, 1, 3.6, e = makeXonoticCheckBoxEx_T(0.5, 0, vertical_lines_cvarname, _("Center line"), + sprintf(_("Show a vertical centerline to help align panels. It's possible to show more vertical lines by editing %s in the console"), vertical_lines_cvarname))); me.gotoRC(me, me.rows - 1, 0); - me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", 1)); + me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", COMMANDBUTTON_CLOSE)); } -#endif