X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_hudsetup_exit.qc;h=802ee96b55dc74bb6938b61253d118c438105197;hb=429e52163f53e75b848135f076b77c4eb43935ac;hp=7cf0ea6dab934c6e8d5b6b125e60e3d88688c966;hpb=37903827937b44f174275a75d2dab5301b8ab53e;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 7cf0ea6da..802ee96b5 100644 --- a/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc +++ b/qcsrc/menu/xonotic/dialog_hudsetup_exit.qc @@ -1,24 +1,48 @@ -#ifdef INTERFACE -CLASS(XonoticHUDExitDialog) EXTENDS(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.4) - ATTRIB(XonoticHUDExitDialog, rows, float, 18) - ATTRIB(XonoticHUDExitDialog, columns, float, 4) - 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; - float i; + int i; + hudskinlist = makeXonoticHUDSkinList(); me.TR(me); + me.TD(me, 1, 4, makeXonoticHeaderLabel(_("HUD skins"))); + me.TR(me); + 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; + me.TR(me); + 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:"))); me.TR(me); me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:"))); @@ -101,20 +125,22 @@ 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)); } -#endif