s = "Unavailable";
color = '1 1 1';
}
- drawpic_aspect_skin(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows) + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, "weapon_complainbubble", eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows) - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows) + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, s, eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows) - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(wpnpos + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, "weapon_complainbubble", wpnsize - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(wpnpos + '1 1 0' * autocvar_hud_weaponicons_complainbubble_padding, s, wpnsize - '2 2 0' * autocvar_hud_weaponicons_complainbubble_padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
++row;
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticCheckBoxString) EXTENDS(CheckBox)
+ METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string))
+ METHOD(XonoticCheckBoxString, setChecked, void(entity, float))
+ ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
+ ATTRIB(XonoticCheckBoxString, image, string, SKINGFX_CHECKBOX)
+ ATTRIB(XonoticCheckBoxString, yesString, string, string_null)
+ ATTRIB(XonoticCheckBoxString, noString, string, string_null)
+
+ ATTRIB(XonoticCheckBoxString, color, vector, SKINCOLOR_CHECKBOX_N)
+ ATTRIB(XonoticCheckBoxString, colorC, vector, SKINCOLOR_CHECKBOX_C)
+ ATTRIB(XonoticCheckBoxString, colorF, vector, SKINCOLOR_CHECKBOX_F)
+ ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D)
+
+ ATTRIB(XonoticCheckBoxString, cvarName, string, string_null)
+ METHOD(XonoticCheckBoxString, loadCvars, void(entity))
+ METHOD(XonoticCheckBoxString, saveCvars, void(entity))
+
+ ATTRIB(XonoticCheckBoxString, alpha, float, SKINALPHA_TEXT)
+ ATTRIB(XonoticCheckBoxString, disabledAlpha, float, SKINALPHA_DISABLED)
+ENDCLASS(XonoticCheckBoxString)
+entity makeXonoticCheckBoxString(string, string, string, string);
+#endif
+
+#ifdef IMPLEMENTATION
+entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
+{
+ entity me;
+ me = spawnXonoticCheckBoxString();
+ me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
+ return me;
+}
+void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theYesValue, string theNoValue, string theCvar, string theText)
+{
+ me.yesString = theYesValue;
+ me.noString = theNoValue;
+ me.checked = 0;
+ if(theCvar)
+ {
+ me.cvarName = theCvar;
+ me.tooltip = getZonedTooltipForIdentifier(theCvar);
+ me.loadCvars(me);
+ }
+ me.configureCheckBox(me, theText, me.fontSize, me.image);
+}
+void XonoticCheckBoxString_setChecked(entity me, float foo)
+{
+ me.checked = !me.checked;
+ me.saveCvars(me);
+}
+void XonoticCheckBoxString_loadCvars(entity me)
+{
+ if not(me.cvarName)
+ return;
+
+ if(cvar_string(me.cvarName) == me.yesString)
+ me.checked = 1;
+}
+void XonoticCheckBoxString_saveCvars(entity me)
+{
+ if not(me.cvarName)
+ return;
+
+ if(me.checked)
+ cvar_set(me.cvarName, me.yesString);
+ else
+ cvar_set(me.cvarName, me.noString);
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticColorpickerString) EXTENDS(Image)
+ METHOD(XonoticColorpickerString, configureXonoticColorpickerString, void(entity, string))
+ METHOD(XonoticColorpickerString, mousePress, float(entity, vector))
+ METHOD(XonoticColorpickerString, mouseRelease, float(entity, vector))
+ METHOD(XonoticColorpickerString, mouseDrag, float(entity, vector))
+ ATTRIB(XonoticColorpickerString, cvarName, string, string_null)
+ ATTRIB(XonoticColorpickerString, prevcoords, vector, '0 0 0')
+ ATTRIB(XonoticColorpickerString, image, string, SKINGFX_COLORPICKER)
+ ATTRIB(XonoticColorpickerString, imagemargin, vector, SKINMARGIN_COLORPICKER)
+ ATTRIB(XonoticColorpickerString, focusable, float, 1)
+ METHOD(XonoticColorpickerString, draw, void(entity))
+ ATTRIB(XonoticColorpickerString, disabledAlpha, float, 0.3)
+ENDCLASS(XonoticColorpickerString)
+entity makeXonoticColorpickerString(string theCvar);
+#endif
+
+#ifdef IMPLEMENTATION
+entity makeXonoticColorpickerString(string theCvar)
+{
+ entity me;
+ me = spawnXonoticColorpickerString();
+ me.configureXonoticColorpickerString(me, theCvar);
+ return me;
+}
+
+void XonoticColorpickerString_configureXonoticColorpickerString(entity me, string theCvar)
+{
+ me.cvarName = theCvar;
+ me.configureImage(me, me.image);
+ me.prevcoords = '1 1 0';
+}
+
+float XonoticColorpickerString_mousePress(entity me, vector coords)
+{
+ me.mouseDrag(me, coords);
+ return 1;
+}
+
+float XonoticColorpickerString_mouseDrag(entity me, vector coords)
+{
+ if(me.disabled)
+ return 0;
+ vector margin;
+ margin = me.imagemargin;
+ if(coords_x >= margin_x)
+ if(coords_y >= margin_y)
+ if(coords_x <= 1 - margin_x)
+ if(coords_y <= 1 - margin_y)
+ {
+ cvar_set(me.cvarName, sprintf("%v", hslimage_color(coords, margin)));
+ me.prevcoords = coords;
+ }
+
+ return 1;
+}
+
+float XonoticColorpickerString_mouseRelease(entity me, vector coords)
+{
+ me.mouseDrag(me, coords);
+ return 1;
+}
+
+void XonoticColorpickerString_draw(entity me)
+{
+ float save;
+ save = draw_alpha;
+ if(me.disabled)
+ draw_alpha *= me.disabledAlpha;
+
+ SUPER(XonoticColorpickerString).draw(me);
+
+ if(me.disabled)
+ me.prevcoords = '1 1 0';
+ else
+ draw_Picture(me.imgOrigin + me.prevcoords - '0.05 0.125 0', strcat(me.src, "_selected"), '0.1 0.25 0', '1 1 1', 1);
+ draw_alpha = save;
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDEngineInfoDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDEngineInfoDialog, fill, void(entity))
+ ATTRIB(XonoticHUDEngineInfoDialog, title, string, "Engine Info Panel")
+ ATTRIB(XonoticHUDEngineInfoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDEngineInfoDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDEngineInfoDialog, rows, float, 15)
+ ATTRIB(XonoticHUDEngineInfoDialog, columns, float, 4)
+ ATTRIB(XonoticHUDEngineInfoDialog, name, string, "HUDengineinfo")
+ENDCLASS(XonoticHUDEngineInfoDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticHUDEngineInfoDialog_fill(entity me)
+{
+ entity e;
+ string panelname = "engineinfo";
+ float i;
+
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_engineinfo", "Enable panel"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background:"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
+ me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_", panelname, "_bg_color"))));
+ setDependentStringNotEqual(e, strzone(strcat("hud_", panelname, "_bg_color")), "");
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_", panelname, "_bg_color")), "Use default"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_border"))));
+ e.addValue(e, "Default", "");
+ e.addValue(e, "Disable", "0");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_alpha"))));
+ e.addValue(e, "Default", "");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_color_team"))));
+ e.addValue(e, "Default", "");
+ e.addValue(e, "Disable", "0");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.4);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_padding"))));
+ e.addValue(e, "Default", "");
+ for(i = 0; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Engine info:"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_engineinfo_framecounter_exponentialmovingaverage", "Use an averaging algorithm for fps"));
+}
+#endif
--- /dev/null
+#ifdef INTERFACE
+CLASS(XonoticHUDInfoMessagesDialog) EXTENDS(XonoticRootDialog)
+ METHOD(XonoticHUDInfoMessagesDialog, fill, void(entity))
+ ATTRIB(XonoticHUDInfoMessagesDialog, title, string, "Info Messages Panel")
+ ATTRIB(XonoticHUDInfoMessagesDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+ ATTRIB(XonoticHUDInfoMessagesDialog, intendedWidth, float, 0.4)
+ ATTRIB(XonoticHUDInfoMessagesDialog, rows, float, 15)
+ ATTRIB(XonoticHUDInfoMessagesDialog, columns, float, 4)
+ ATTRIB(XonoticHUDInfoMessagesDialog, name, string, "HUDinfomessages")
+ENDCLASS(XonoticHUDInfoMessagesDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticHUDInfoMessagesDialog_fill(entity me)
+{
+ entity e;
+ string panelname = "infomessages";
+ float i;
+
+ me.TR(me);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_infomessages", "Enable panel"));
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Background:"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
+ me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_", panelname, "_bg_color"))));
+ setDependentStringNotEqual(e, strzone(strcat("hud_", panelname, "_bg_color")), "");
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_", panelname, "_bg_color")), "Use default"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_border"))));
+ e.addValue(e, "Default", "");
+ e.addValue(e, "Disable", "0");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_alpha"))));
+ e.addValue(e, "Default", "");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_color_team"))));
+ e.addValue(e, "Default", "");
+ e.addValue(e, "Disable", "0");
+ for(i = 1; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TDempty(me, 0.4);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
+ me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_", panelname, "_bg_padding"))));
+ e.addValue(e, "Default", "");
+ for(i = 0; i <= 10; ++i)
+ e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
+ e.configureXonoticTextSliderValues(e);
+ me.TR(me);
+ me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Info messages:"));
+ me.TR(me);
+ me.TDempty(me, 0.2);
+ me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_infomessages_flip", "Flip align"));
+}
+#endif
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ i = spawnXonoticHUDEngineInfoDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ i = spawnXonoticHUDInfoMessagesDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
me.advancedDialog = i = spawnXonoticAdvancedDialog();
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);