X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud_config.qc;h=acff2892da506f53bdef49d0bb8f77baa73735ea;hb=47d0cce0ac225e41d45701a0e8f38b39df9b53ef;hp=a53112bbd4b0495fe21483484b7818ebfd93c31c;hpb=a285cb5478e1034f42cf9cb29d205864183129aa;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index a53112bbd..acff2892d 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -80,6 +80,10 @@ void HUD_Panel_ExportCfg(string cfgname) HUD_Write_PanelCvar_q("_aspect"); HUD_Write_PanelCvar_q("_timeout"); HUD_Write_PanelCvar_q("_timeout_effect"); + HUD_Write_PanelCvar_q("_timeout_fadebgmin"); + HUD_Write_PanelCvar_q("_timeout_fadefgmin"); + HUD_Write_PanelCvar_q("_timeout_speed_in"); + HUD_Write_PanelCvar_q("_timeout_speed_out"); HUD_Write_PanelCvar_q("_onlyowned"); break; case HUD_PANEL_AMMO: @@ -138,6 +142,7 @@ void HUD_Panel_ExportCfg(string cfgname) HUD_Write_PanelCvar_q("_dom_layout"); break; case HUD_PANEL_PRESSEDKEYS: + HUD_Write_PanelCvar_q("_attack"); HUD_Write_PanelCvar_q("_aspect"); break; case HUD_PANEL_ENGINEINFO: @@ -634,8 +639,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) { string s; - // we only care for keyboard events - if(bInputType != 0 && bInputType != 1) + if(bInputType == 2) return false; if(!autocvar__hud_configure) @@ -645,13 +649,20 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) if(autocvar__menu_alpha) return true; + if(bInputType == 3) + { + mousepos_x = nPrimary; + mousepos_y = nSecondary; + return true; + } + // allow console bind to work string con_keys; float keys; con_keys = findkeysforcommand("toggleconsole", 0); keys = tokenize(con_keys); // findkeysforcommand returns data for this - float hit_con_bind, i; + float hit_con_bind = 0, i; for (i = 0; i < keys; ++i) { if(nPrimary == stof(argv(i))) @@ -743,8 +754,8 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) } tab_backward = (hudShiftState & S_SHIFT); - float k, level, start_pos_x; - vector candidate_pos; + float k, level = 0, start_pos_x; + vector candidate_pos = '0 0 0'; const float LEVELS_NUM = 4; float level_height = vid_conheight / LEVELS_NUM; :find_tab_panel @@ -895,7 +906,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary) float HUD_Panel_Check_Mouse_Pos(float allow_move) { - float i, j, border; + float i, j = 0, border; while(j < HUD_PANEL_NUM) { @@ -907,7 +918,7 @@ float HUD_Panel_Check_Mouse_Pos(float allow_move) border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize // move - if(allow_move && mousepos_x >= panel_pos_x && mousepos_y >= panel_pos_y && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= panel_pos_y + panel_size_y) + if(allow_move && mousepos_x > panel_pos_x && mousepos_y > panel_pos_y && mousepos_x < panel_pos_x + panel_size_x && mousepos_y < panel_pos_y + panel_size_y) { return 1; } @@ -962,7 +973,7 @@ void HUD_Panel_FirstInDrawQ(float id) panel_order[0] = id; // let's save them into the cvar by some strcat trickery - string s; + string s = ""; for(i = 0; i < HUD_PANEL_NUM; ++i) { s = strcat(s, ftos(panel_order[i]), " "); @@ -975,7 +986,7 @@ void HUD_Panel_FirstInDrawQ(float id) void HUD_Panel_Highlight(float allow_move) { - float i, j, border; + float i, j = 0, border; while(j < HUD_PANEL_NUM) { @@ -987,7 +998,7 @@ void HUD_Panel_Highlight(float allow_move) border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize // move - if(allow_move && mousepos_x >= panel_pos_x && mousepos_y >= panel_pos_y && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= panel_pos_y + panel_size_y) + if(allow_move && mousepos_x > panel_pos_x && mousepos_y > panel_pos_y && mousepos_x < panel_pos_x + panel_size_x && mousepos_y < panel_pos_y + panel_size_y) { highlightedPanel = i; HUD_Panel_FirstInDrawQ(i); @@ -1069,10 +1080,13 @@ void HUD_Panel_Mouse() if(autocvar__menu_alpha == 1) return; - mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; - - mousepos_x = bound(0, mousepos_x, vid_conwidth); - mousepos_y = bound(0, mousepos_y, vid_conheight); + if not(autocvar_hud_cursormode) + { + mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; + + mousepos_x = bound(0, mousepos_x, vid_conwidth); + mousepos_y = bound(0, mousepos_y, vid_conheight); + } if(mouseClicked) { @@ -1132,7 +1146,7 @@ void HUD_Panel_Mouse() HUD_Panel_SetPos(mousepos - panel_click_distance); else if(highlightedAction == 2) { - vector mySize; + vector mySize = '0 0 0'; if(resizeCorner == 1) { mySize_x = panel_click_resizeorigin_x - (mousepos_x - panel_click_distance_x); mySize_y = panel_click_resizeorigin_y - (mousepos_y - panel_click_distance_y);