if(nPrimary == K_CTRL)
{
- if (bInputType == 1)
+ if (bInputType == 1) //ctrl has been released
{
if (tab_panel != -1)
{
- //switch to selected panel when ctrl has been released
+ //switch to selected panel
+ highlightedPanel = tab_panel;
highlightedPanel_prev = tab_panel;
HUD_Panel_FirstInDrawQ(highlightedPanel_prev);
}
+ tab_panel = -1;
+ reset_tab_panels();
}
- //reset on press AND on release
- tab_panel = -1;
- reset_tab_panels();
}
if(nPrimary == K_MOUSE1)
return true;
}
}
- else if(nPrimary == K_TAB && hudShiftState & S_CTRL) //TODO: move this case down
+ else if(nPrimary == K_ESCAPE)
{
if (bInputType == 1)
return true;
+ menu_enabled = 1;
+ menu_enabled_time = time;
+ localcmd("menu_showhudexit\n");
+ }
+ else if(nPrimary == K_TAB && hudShiftState & S_CTRL) // select and highlight another panel
+ {
+ if (bInputType == 1 || mouseClicked)
+ return true;
//FIXME: if a panel is highlighted, has the same pos_x and lays in the same level
//of other panels then next consecutive ctrl-tab will select the highlighted panel too
tab_panels[tab_panel] = tab_panel;
}
- else if(nPrimary == K_ESCAPE)
- {
- if (bInputType == 1)
- return true;
- menu_enabled = 1;
- menu_enabled_time = time;
- localcmd("menu_showhudexit\n");
- }
else if(nPrimary == K_SPACE && hudShiftState & S_CTRL) // enable/disable highlighted panel or dock
{
if (bInputType == 1 || mouseClicked)
return true;
if (highlightedPanel_prev != -1)
+ {
+ HUD_Panel_GetName(highlightedPanel_prev);
cvar_set(strcat("hud_panel_", panel_name), ftos(!(panel_enabled)));
+ }
else
cvar_set(strcat("hud_dock"), (autocvar_hud_dock == "") ? "dock" : "");
}
if (highlightedPanel_prev != -1)
{
+ HUD_Panel_UpdatePosSizeForId(highlightedPanel_prev);
panel_size_copied = panel_size;
highlightedPanel_copied = highlightedPanel_prev;
}
highlightedPanel_backup = highlightedPanel_prev;
s = strcat(ftos(tmp_size_x/vid_conwidth), " ", ftos(tmp_size_y/vid_conheight));
+ HUD_Panel_GetName(highlightedPanel_prev);
cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
}
else if(nPrimary == 'z' && hudShiftState & S_CTRL) // undo last action
if(mouseClicked)
{
+ if (tab_panel != -1)
+ {
+ //stop ctrl-tab selection
+ tab_panel = -1;
+ reset_tab_panels();
+ }
if(prevMouseClicked == 0)
{
HUD_Panel_Highlight(); // sets highlightedPanel, highlightedAction, panel_click_distance, panel_click_resizeorigin
void HUD_VoteWindow(void)
{
- uid2name_dialog = 0;
if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
{
vote_active = 1;
- vote_called_vote = strzone(strcat("^2Name ^7instead of \"^1Unregistered player\"", " ^7in stats"));
- uid2name_dialog = 1;
+ if (autocvar__hud_configure)
+ {
+ vote_yescount = 0;
+ vote_nocount = 0;
+ print("^1You have to answer before entering hud configure mode\n");
+ cvar_set("_hud_configure", "0");
+ }
+ vote_called_vote = strzone("^2Name ^7instead of \"^1Unregistered player^7\" in stats");
+ uid2name_dialog = 1;
}
if(!autocvar_hud_panel_vote && !autocvar__hud_configure)