From: FruitieX Date: Mon, 12 Jul 2010 13:15:23 +0000 (+0300) Subject: last updates before i apply the dialog layout on all the hud panel dialogs X-Git-Tag: xonotic-v0.1.0preview~362^2~44^2~7 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=9ffdbcb7f2e6c6f7cfd915892298acd07a6ce10a last updates before i apply the dialog layout on all the hud panel dialogs --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index ade4715113..28f7ba14e3 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1324,6 +1324,7 @@ con_notifyalign 0 // hud variables set _hud_configure 0 "1 = configure the HUD" +seta hud_configure_teamcolorforced 1 "1 = force display of team colors in configure mode" seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode" seta hud_configure_bg_minalpha 0.25 "minimum panel background alpha when in hud configure mode" seta hud_configure_grid 1 "snap to grid when moving/resizing panels" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 5c0253ebf2..ba29fb8119 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -13,6 +13,7 @@ var float autocvar_cl_gentle_messages; var float autocvar__menu_alpha; var float autocvar__hud_configure; +var float autocvar_hud_configure_teamcolorforced; var float autocvar_hud_configure_checkcollisions; var float autocvar_hud_configure_bg_minalpha; var float autocvar_hud_configure_grid; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 4e8e3440e0..132643ad59 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1236,7 +1236,7 @@ void HUD_Panel_Mouse() if(highlightedPanel != -1) highlightedPanel_prev = highlightedPanel; - mousepos = mousepos + getmousepos(); + mousepos = mousepos + getmousepos() * cvar("menu_mouse_speed"); mousepos_x = bound(0, mousepos_x, vid_conwidth); mousepos_y = bound(0, mousepos_y, vid_conheight); @@ -4661,10 +4661,13 @@ void HUD_Main (void) float f; vector color; - if(teamplay && autocvar_hud_dock_color_team) { + if((teamplay) && autocvar_hud_dock_color_team) { f = stof(getplayerkey(player_localentnum - 1, "colors")); color = colormapPaletteColor(mod(f, 16), 1) * autocvar_hud_dock_color_team; } + else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && autocvar_hud_dock_color_team) { + color = '1 0 0' * autocvar_hud_dock_color_team; + } else if(autocvar_hud_dock_color == "shirt") { f = stof(getplayerkey(player_localentnum - 1, "colors")); color = colormapPaletteColor(floor(f / 16), 0); diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 9401c9b8f4..63ee81a96b 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -117,8 +117,10 @@ if(!autocvar__hud_configure && panel_bg_str == "0") {\ // Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector. #define HUD_Panel_GetColor()\ -if(teamplay && panel_bg_color_team) {\ +if((teamplay) && panel_bg_color_team) {\ panel_bg_color = colormapPaletteColor(mod(stof(getplayerkey(player_localentnum - 1, "colors")), 16), 1) * panel_bg_color_team;\ +} else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team) {\ + panel_bg_color = '1 0 0' * panel_bg_color_team;\ } else {\ if(panel_bg_color_str == "") {\ panel_bg_color = autocvar_hud_bg_color;\ diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index e41ea80a44..33e861a6aa 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -41,6 +41,7 @@ #include "xonotic/slider.c" #include "xonotic/slider_resolution.c" #include "xonotic/checkbox.c" +#include "xonotic/checkbox_string.c" #include "xonotic/radiobutton.c" #include "xonotic/nexposee.c" #include "xonotic/rootdialog.c" diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c b/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c index 3278169ca4..04c8ed76ae 100644 --- a/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c +++ b/qcsrc/menu/xonotic/dialog_hudpanel_weaponicons.c @@ -24,14 +24,11 @@ void XonoticHUDWeaponIconsDialog_fill(entity me) me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:")); - me.TD(me, 3, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_", panelname, "_bg_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, 0.8, e = makeXonoticRadioButton(1, strzone(strcat("hud_", panelname, "_bg_color")), "", "Use default")); - me.TR(me); - me.TDempty(me, 0.2); - me.TD(me, 1, 0.8, e = makeXonoticRadioButton(1, strzone(strcat("hud_", panelname, "_bg_color")), strzone(cvar_string("hud_bg_color")), "Custom")); + 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:")); @@ -58,6 +55,9 @@ void XonoticHUDWeaponIconsDialog_fill(entity me) 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:")); @@ -80,13 +80,15 @@ void XonoticHUDWeaponIconsDialog_fill(entity me) me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_weaponicons_ammo", "Show Ammo")); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Ammo bar alpha:")); - me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_weaponicons_ammo_alpha")); + me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Ammo bar color:")); + me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_weaponicons_ammo_color")); setDependent(e, "hud_weaponicons_ammo", 1, 1); + me.TR(me); me.TR(me); me.TDempty(me, 0.2); - me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Ammo bar color:")); - me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_weaponicons_ammo_color")); + me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Ammo bar alpha:")); + me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_weaponicons_ammo_alpha")); + setDependent(e, "hud_weaponicons_ammo", 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)); }