set menu_picmip_bypass 0 "bypass texture quality enforcement based on system resources, not recommended and may cause crashes!"
set menu_showboxes 0 "show item bounding boxes (debug)"
set menu_cvarlist_onlymodified 0 "show only modified cvars in the cvar list"
+set menu_force_on_disconnection 1 "force to show the menu this number of seconds after you get disconnected (0 to disable)"
r_textbrightness 0.2
r_textcontrast 0.8
int i = 0;
float w = 0;
- for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining; ++i)
+ for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining && i <= 16; ++i)
{
string s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
+ if (i == 16)
+ s = "...";
float f = draw_TextWidth(s, false, fontsize);
if (f > w) w = f;
}
p = menuTooltipOrigin;
p.x += SKINMARGIN_TOOLTIP_x / conwidth;
p.y += SKINMARGIN_TOOLTIP_y / conheight;
- for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining; p.y += fontsize.y)
+ int i = 0;
+ for (getWrappedLine_remaining = menuTooltipText; getWrappedLine_remaining && i <= 16; ++i, p.y += fontsize.y)
{
string s = getWrappedLine(SKINWIDTH_TOOLTIP, fontsize, draw_TextWidth_WithoutColors);
+ if (i == 16)
+ s = "...";
draw_Text(p, s, fontsize, SKINCOLOR_TOOLTIP, SKINALPHA_TOOLTIP * menuTooltipAlpha, false);
}
}
}
}
+float autocvar_menu_force_on_disconnection;
void m_draw(float width, float height)
{
- if (clientstate() == CS_DISCONNECTED) m_toggle(true);
+ if (autocvar_menu_force_on_disconnection > 0)
+ {
+ static float connected_time;
+ if (clientstate() == CS_DISCONNECTED)
+ {
+ if (connected_time && time - connected_time > autocvar_menu_force_on_disconnection)
+ {
+ m_toggle(true);
+ connected_time = 0;
+ }
+ }
+ else
+ connected_time = time;
+ }
+
m_gamestatus();
execute_next_frame();
draw_alpha *= menuAlpha;
- if (!Menu_Active)
- {
- // do not update mouse position
- // it prevents mouse jumping to '0 0 0' when menu is fading out
- }
- else if (menuMouseMode)
+ if (menuMouseMode)
{
- vector newMouse = globalToBox(getmousepos(), draw_shift, draw_scale);
- if (newMouse != '0 0 0' && newMouse != menuMousePos)
+ vector rawMousePos = getmousepos();
+ vector newMouse = globalToBox(rawMousePos, draw_shift, draw_scale);
+ if (rawMousePos != '0 0 0' && newMouse != menuMousePos)
{
menuMousePos = newMouse;
if (mouseButtonsPressed) main.mouseDrag(main, menuMousePos);
{
me.checked = val;
me.saveCvars(me);
+ if(me.linkedCheckBox)
+ me.linkedCheckBox.loadCvars(me.linkedCheckBox);
}
}
void XonoticCheckBox_loadCvars(entity me)
ATTRIB(XonoticCheckBox, alpha, float, SKINALPHA_TEXT)
ATTRIB(XonoticCheckBox, disabledAlpha, float, SKINALPHA_DISABLED)
+ ATTRIB(XonoticCheckBox, linkedCheckBox, entity, NULL)
ENDCLASS(XonoticCheckBox)
entity makeXonoticCheckBox_T(float, string, string, string);
entity makeXonoticCheckBox(float, string, string);
#include "cvarlist.qh"
#include "inputbox.qh"
+#include "../item/checkbox.qh"
#include "../item/container.qh"
#include "../item/checkbox.qh"
void XonoticAudioSettingsTab_fill(entity me)
{
- entity e, s;
+ entity e, e2, s;
entity audioApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
"snd_restart;"
"snd_attenuation_method_${menu_snd_attenuation_method};"
me.TR(me);
me.TD(me, 1, 3, makeXonoticCheckBox(0, "con_chatsound", _("Chat message sound")));
me.TR(me);
- me.hiddenMenuSoundsSlider = makeXonoticSlider_T(1, 1, 1, "menu_sounds",
- _("Play sounds when clicking or hovering over menu items"));
- me.TD(me, 1, 1.2, e = makeXonoticSliderCheckBox(0, 1, me.hiddenMenuSoundsSlider, _("Menu sounds")));
- e.tooltip = me.hiddenMenuSoundsSlider.tooltip;
- me.TD(me, 1, 1.8, e = makeXonoticSliderCheckBox(2, 0, me.hiddenMenuSoundsSlider, _("Focus sounds")));
- e.tooltip = me.hiddenMenuSoundsSlider.tooltip;
- setDependent(e, "menu_sounds", 1, 2);
+ me.TD(me, 1, 1.2, e = makeXonoticCheckBox_T(0, "menu_sounds", _("Menu sounds"),
+ _("Play sounds when clicking menu items")));
+ me.TD(me, 1, 1.2, e.linkedCheckBox = e2 = makeXonoticCheckBoxEx_T(2, 1, "menu_sounds", _("Focus sounds"),
+ _("Play sounds when hovering over menu items too")));
+ setDependent(e2, "menu_sounds", 1, 2);
me.TR(me);
me.TR(me);
me.TD(me, 1, 1, makeXonoticTextLabel(0, _("Time announcer:")));
{
Lazy l = Settings_from(i);
entity it = l.m_get();
- if (returns) returns(it.tooltip);
+ if (returns) returns(it.titleTooltip);
return it;
}
METHOD(SettingSource, reload, int(entity this, string filter)) { return Settings_COUNT; }
me.TR(me);
me.TDempty(me, 0.4);
me.TD(me, 1, 2.6, e = makeXonoticCheckBox_T(0, "notification_show_sprees_info_newline", _("Print on a seperate line"), "-"));
- setDependent(e, "notification_show_sprees", 1, 1);
+ setDependentAND(e, "notification_show_sprees", 1, 1, "notification_show_sprees_info", 1, 3);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx_T(2, 1, "notification_CHOICE_FRAG", _("Add extra frag information to centerprint when available"), "-"));
makeMulti(e, "notification_CHOICE_FRAGGED notification_CHOICE_TYPEFRAG notification_CHOICE_TYPEFRAGGED");
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gamemode Settings")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx_T(2, 1, "notification_CHOICE_CTF_CAPTURE_TIME_RED", _("Display capture times in Capture The Flag"), "-"));
- makeMulti(e, "notification_CHOICE_CTF_CAPTURE_TIME_BLUE notification_CHOICE_CTF_CAPTURE_BROKEN_RED notification_CHOICE_CTF_CAPTURE_BROKEN_BLUE notification_CHOICE_CTF_CAPTURE_UNBROKEN_RED notification_CHOICE_CTF_CAPTURE_UNBROKEN_BLUE ");
+ makeMulti(e, "notification_CHOICE_CTF_CAPTURE_TIME_BLUE notification_CHOICE_CTF_CAPTURE_TIME_YELLOW notification_CHOICE_CTF_CAPTURE_TIME_PINK notification_CHOICE_CTF_CAPTURE_BROKEN_RED notification_CHOICE_CTF_CAPTURE_BROKEN_BLUE notification_CHOICE_CTF_CAPTURE_BROKEN_YELLOW notification_CHOICE_CTF_CAPTURE_BROKEN_PINK notification_CHOICE_CTF_CAPTURE_UNBROKEN_RED notification_CHOICE_CTF_CAPTURE_UNBROKEN_BLUE notification_CHOICE_CTF_CAPTURE_UNBROKEN_YELLOW notification_CHOICE_CTF_CAPTURE_UNBROKEN_PINK");
e.sendCvars = true;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx_T(2, 1, "notification_CHOICE_CTF_PICKUP_ENEMY", _("Display name of flag stealer in Capture The Flag"), "-"));
- makeMulti(e, "notification_CHOICE_CTF_PICKUP_TEAM");
+ makeMulti(e, "notification_CHOICE_CTF_PICKUP_ENEMY_TEAM notification_CHOICE_CTF_PICKUP_ENEMY_NEUTRAL");
e.sendCvars = true;
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other")));
me.TR(me);
- me.TD(me, 1, 3, e = makeXonoticCheckBoxEx_T(4, 1, "con_notify", _("Display console messages in the top left corner"), "-"));
+ me.TD(me, 1, 3, e = makeXonoticCheckBoxEx_T(4, 0, "con_notify", _("Display console messages in the top left corner"), "-"));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx_T(2, 1, "notification_allow_chatboxprint", _("Display all info messages in the chatbox"), "-"));
me.TR(me);
METHOD(XonoticGameModelSettingsTab, fill, void(entity));
METHOD(XonoticGameModelSettingsTab, showNotify, void(entity));
ATTRIB(XonoticGameModelSettingsTab, title, string, _("Models"))
- ATTRIB(XonoticGameModelSettingsTab, tooltip, string, _("Customize how players and items are displayed in game"))
+ ATTRIB(XonoticGameModelSettingsTab, titleTooltip, string, _("Customize how players and items are displayed in game"))
ATTRIB(XonoticGameModelSettingsTab, intendedWidth, float, 0.9)
ATTRIB(XonoticGameModelSettingsTab, rows, float, 15.5)
ATTRIB(XonoticGameModelSettingsTab, columns, float, 5)
ATTRIB(XonoticTab, rowHeight, float, SKINFONTSIZE_NORMAL * SKINHEIGHT_NORMAL) // pixels
ATTRIB(XonoticTab, backgroundImage, string, string_null)
+
+ // using "titleTooltip" instead of "tooltip" so that
+ // the tooltip search function doesn't find it
+ // .tooltip should be set only in the item displaying the tab title
+ ATTRIB(XonoticTab, titleTooltip, string, string_null)
ENDCLASS(XonoticTab)