server side option for both (old) or individually silent or particleless (re)spawning
See merge request xonotic/xonotic-data.pk3dir!1218
-Tue Mar 26 07:22:58 AM CET 2024
+Wed Apr 3 07:22:55 AM CEST 2024
seta hud_panel_scoreboard_spectators_aligned 0 "align spectators in columns"
seta hud_panel_scoreboard_spectators_position 1 "spectator list position (0 = before accuracy and itemstats, 1 = before rankings, 2 = after rankings, 3 = after map stats)"
seta hud_panel_scoreboard_minwidth 0.6 "minimum width of the scoreboard"
+seta hud_panel_scoreboard_table_fieldtitle_maxwidth 0.07 "max width of a field title; if the title is longer it will be shown compressed"
seta hud_panel_scoreboard_team_size_position 0 "where to show the team size (0 = do not show, 1 = left of scoreboard, 2 = right of scoreboard), will move team scores to the other side if necessary"
seta hud_panel_scoreboard_ping_best 0 "use best_color for this ping"
seta hud_panel_scoreboard_ping_medium 70 "use medium_color for this ping"
# Larson März <larson@protonmail.ch>, 2016
# Larson März <larson@protonmail.ch>, 2016
# afba88cf42cbdff57149d4a6d53a94f9, 2018
-# Mirio <opivy@hotmail.de>, 2014-2017,2019-2023
+# Mirio <opivy@hotmail.de>, 2014-2017,2019-2024
# Robert Katzinsky <hbmctextures.unknown@gmail.com>, 2020
# divVerent <divVerent@gmail.com>, 2011
# Sless <sless@gmx.net>, 2014
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-24 07:22+0100\n"
"PO-Revision-Date: 2013-09-12 16:53+0000\n"
-"Last-Translator: Yepoleb <huberg18@gmail.com>, 2013\n"
+"Last-Translator: Mirio <opivy@hotmail.de>, 2014-2017,2019-2024\n"
"Language-Team: German (http://app.transifex.com/team-xonotic/xonotic/"
"language/de/)\n"
"Language: de\n"
#: qcsrc/common/minigames/cl_minigames.qc:287
msgid "Spectators:"
-msgstr ""
+msgstr "Zuschauer:"
#: qcsrc/common/minigames/cl_minigames.qc:424
msgid "It's your turn"
# Larson März <larson@protonmail.ch>, 2016
# Larson März <larson@protonmail.ch>, 2016
# afba88cf42cbdff57149d4a6d53a94f9, 2018
-# Mirio <opivy@hotmail.de>, 2014-2017,2019-2023
+# Mirio <opivy@hotmail.de>, 2014-2017,2019-2024
# Robert Katzinsky <hbmctextures.unknown@gmail.com>, 2020
# divVerent <divVerent@gmail.com>, 2011
# Sless <sless@gmx.net>, 2014
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-24 07:22+0100\n"
"PO-Revision-Date: 2013-09-12 16:53+0000\n"
-"Last-Translator: Yepoleb <huberg18@gmail.com>, 2013\n"
+"Last-Translator: Mirio <opivy@hotmail.de>, 2014-2017,2019-2024\n"
"Language-Team: German (http://app.transifex.com/team-xonotic/xonotic/"
"language/de/)\n"
"Language: de\n"
#: qcsrc/common/minigames/cl_minigames.qc:287
msgid "Spectators:"
-msgstr ""
+msgstr "Zuschauer:"
#: qcsrc/common/minigames/cl_minigames.qc:424
msgid "It's your turn"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-24 07:22+0100\n"
"PO-Revision-Date: 2013-09-12 16:53+0000\n"
-"Last-Translator: oblector o, 2022\n"
+"Last-Translator: oblector o, 2022-2024\n"
"Language-Team: Latin (http://app.transifex.com/team-xonotic/xonotic/language/"
"la/)\n"
"Language: la\n"
#: qcsrc/common/minigames/cl_minigames.qc:287
msgid "Spectators:"
-msgstr ""
+msgstr "Spectatores:"
#: qcsrc/common/minigames/cl_minigames.qc:424
msgid "It's your turn"
#: qcsrc/common/notifications/all.inc:484
#, c-format
msgid "^BG%s%s^K1 was cut down with ^BG%s^K1's HLAC%s%s"
-msgstr ""
+msgstr "^BG%s%s^K1, HLAT ^BG%s^K1, occisus est%s%s"
#: qcsrc/common/notifications/all.inc:485
#, c-format
msgid "^BG%s^K1 got a little jumpy with their HLAC%s%s"
-msgstr ""
+msgstr "^BG%s^K1 suo HLAT nimis saliens fuit%s%s"
#: qcsrc/common/notifications/all.inc:486
#, c-format
#: qcsrc/common/util.qc:1562
#, c-format
msgid "JOY%d"
-msgstr ""
+msgstr "GUBRNCL%d"
#: qcsrc/common/util.qc:1565
#, c-format
#: qcsrc/common/util.qc:1572
#, c-format
msgid "DPAD_UP"
-msgstr ""
+msgstr "DCRUX_SURS"
#: qcsrc/common/util.qc:1572 qcsrc/common/util.qc:1573
#: qcsrc/common/util.qc:1574 qcsrc/common/util.qc:1575
#: qcsrc/common/util.qc:1573
#, c-format
msgid "DPAD_DOWN"
-msgstr ""
+msgstr "DCRUX_DEORS"
#: qcsrc/common/util.qc:1574
#, c-format
msgid "DPAD_LEFT"
-msgstr ""
+msgstr "DCRUX_SINIS"
#: qcsrc/common/util.qc:1575
#, c-format
msgid "DPAD_RIGHT"
-msgstr ""
+msgstr "DCRUX_DEXTR"
#: qcsrc/common/util.qc:1576
#, c-format
#: qcsrc/common/util.qc:1582
#, c-format
msgid "LEFT_TRIGGER"
-msgstr ""
+msgstr "SINISTER_EMISS"
#: qcsrc/common/util.qc:1583
#, c-format
msgid "RIGHT_TRIGGER"
-msgstr ""
+msgstr "DEXTER_EMISS"
#: qcsrc/common/util.qc:1584
#, c-format
#: qcsrc/common/util.qc:1603 qcsrc/common/util.qc:1604
#, c-format
msgid "JOY_%s"
-msgstr ""
+msgstr "GUBRNCL_%s"
#: qcsrc/common/util.qc:1601
#, c-format
#: qcsrc/common/util.qc:1610
#, c-format
msgid "MIDINOTE%d"
-msgstr ""
+msgstr "MIDISONUS%d"
#: qcsrc/common/vehicles/cl_vehicles.qc:171
#, c-format
#: qcsrc/menu/xonotic/credits.qc:113
msgid "Marketing / PR"
-msgstr ""
+msgstr "Annuntiationes"
#: qcsrc/menu/xonotic/credits.qc:119
msgid "Legal"
#: qcsrc/menu/xonotic/dialog_credits.qh:7
msgid "Credits"
-msgstr ""
+msgstr "Auctores"
#: qcsrc/menu/xonotic/dialog_credits.qh:8
msgid "The Xonotic credits"
-msgstr ""
+msgstr "Xonotici auctores"
#: qcsrc/menu/xonotic/dialog_firstrun.qc:44
msgid ""
#: qcsrc/menu/xonotic/dialog_hudsetup_exit.qc:93
msgid "HUD Dock:"
-msgstr ""
+msgstr "Margo Picta:"
#: qcsrc/menu/xonotic/dialog_hudsetup_exit.qc:95
msgid "DOCK^Disabled"
-msgstr ""
+msgstr "Nulla"
#: qcsrc/menu/xonotic/dialog_hudsetup_exit.qc:96
msgid "DOCK^Small"
-msgstr ""
+msgstr "Parva"
#: qcsrc/menu/xonotic/dialog_hudsetup_exit.qc:97
msgid "DOCK^Medium"
-msgstr ""
+msgstr "Media"
#: qcsrc/menu/xonotic/dialog_hudsetup_exit.qc:98
msgid "DOCK^Large"
-msgstr ""
+msgstr "Magna"
#: qcsrc/menu/xonotic/dialog_hudsetup_exit.qc:121
msgid "Grid settings:"
#: qcsrc/menu/xonotic/dialog_sandboxtools.qc:78
msgid "* object info"
-msgstr ""
+msgstr "* rei notae"
#: qcsrc/menu/xonotic/dialog_sandboxtools.qc:79
msgid "* mesh info"
-msgstr ""
+msgstr "* structurae notae"
#: qcsrc/menu/xonotic/dialog_sandboxtools.qc:80
msgid "* attachment info"
-msgstr ""
+msgstr "* iunctionis notae"
#: qcsrc/menu/xonotic/dialog_sandboxtools.qc:81
msgid "Show help"
#: qcsrc/menu/xonotic/dialog_settings_audio.qc:188
msgid "Debug info about sounds"
-msgstr ""
+msgstr "Sonorum notae pro investigatoribus"
#: qcsrc/menu/xonotic/dialog_settings_bindings_reset.qc:11
msgid "Are you sure you want to reset all key bindings?"
#: qcsrc/menu/xonotic/dialog_settings_effects.qc:230
msgid "Motion blur strength - 0.4 recommended"
-msgstr ""
+msgstr "Quanta confusio colorum - 0.4 suadetur"
#: qcsrc/menu/xonotic/dialog_settings_effects.qc:231
msgid "Motion blur:"
-msgstr ""
+msgstr "Confundere colores cum moves:"
#: qcsrc/menu/xonotic/dialog_settings_effects.qc:237
msgid "Particles"
#: qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc:122
msgid "Smooth effects of crosshairs"
-msgstr ""
+msgstr "Lenes motiones reticulorum"
#: qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc:125
msgid "Perform hit tests for the crosshair"
#: qcsrc/menu/xonotic/dialog_settings_game_hud.qc:83
msgid "Edge offset:"
-msgstr ""
+msgstr "A margine distare:"
#: qcsrc/menu/xonotic/dialog_settings_game_hud.qc:91
msgid "Fade when near the crosshair"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:75
msgid "Enable built in mouse acceleration"
-msgstr ""
+msgstr "Murem accelerare secundum ludi codicem"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:79
#: qcsrc/menu/xonotic/dialog_settings_input.qc:83
#: qcsrc/menu/xonotic/dialog_settings_input.qc:86
msgid "Disable system mouse acceleration"
-msgstr ""
+msgstr "Non accelerare murem secundum systema generale"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:80
msgid "Make use of DGA mouse input"
-msgstr ""
+msgstr "Uti muris codice DGA"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:94
msgid "Pressing \"enter console\" key also closes it"
-msgstr ""
+msgstr "\"Iussorum locum intrare\" premere ut eo exeas quoque"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:95
msgid "Allow the console toggling bind to also close the console"
msgstr ""
+"Una clavis habet duas actiones oppositas, intrare et exire iussorum loco"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:97
msgid "Automatically repeat jumping if holding jump"
#: qcsrc/menu/xonotic/dialog_settings_input.qc:115
#: qcsrc/menu/xonotic/dialog_settings_input.qc:120
msgid "Use joystick input"
-msgstr ""
+msgstr "Uti gubernaculo"
#: qcsrc/menu/xonotic/dialog_settings_input_userbind.qc:31
msgid "Command when pressed:"
#: qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc:53
msgid "Value:"
-msgstr ""
+msgstr "Valor:"
#: qcsrc/menu/xonotic/dialog_settings_misc_cvars.qc:70
msgid "Description:"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:64
msgid "High-quality frame buffer"
-msgstr ""
+msgstr "Subtiliores picturae in calculationum spatio"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:72
msgid "Antialiasing:"
"Eliminate overdraw by rendering a depth-only version of the scene before the "
"normal rendering starts"
msgstr ""
+"Vitat pingere super picturam, per artificium quod est primo pingere formas "
+"modo secundum distantias ante picturam ordinariam"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:105
msgid "DF^Disabled"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:135
msgid "Saturation:"
-msgstr ""
+msgstr "Evidentia colorum:"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:139
msgid ""
"Saturation adjustment (0 = grayscale, 1 = normal, 2 = oversaturated), "
"requires GLSL color control"
msgstr ""
+"Evidentia colorum mutare (0 = cinerei, 1 = ordinarii, 2 = nimis evidentes), "
+"necesse est dominium colorum GLSL"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:144
msgid "LIT^Ambient:"
-msgstr ""
+msgstr "Sola parietesque"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:146
msgid ""
"Ambient lighting, if set too high it tends to make light on maps look dull "
"and flat"
msgstr ""
+"Illuminatio solorum parietumque, quae si nimis elevatur, fit hebes et plana"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:148
msgid "Intensity:"
-msgstr ""
+msgstr "Intensitas:"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:150
msgid "Global rendering brightness"
-msgstr ""
+msgstr "Nitor picturae generalis"
#: qcsrc/menu/xonotic/dialog_settings_video.qc:153
msgid "Wait for GPU to finish each frame"
#: qcsrc/menu/xonotic/dialog_uid2name.qc:12
msgid "Answering \"No\" you will appear as \"Anonymous player\""
-msgstr "Si non sines, scribetur \"Lusor Anonymus\""
+msgstr "Si non sinis, scribetur \"Lusor Anonymus\""
#: qcsrc/menu/xonotic/gametypelist.qc:88
msgid "teamplay"
#: qcsrc/menu/xonotic/keybinder.qc:126
msgid "scoreboard user interface"
-msgstr ""
+msgstr "rationarii index pro utente"
#: qcsrc/menu/xonotic/keybinder.qc:129
msgid "User defined"
#: qcsrc/menu/xonotic/keybinder.qc:136
msgid "Development"
-msgstr ""
+msgstr "Pro scriptore codicum"
#: qcsrc/menu/xonotic/keybinder.qc:137
msgid "sandbox menu"
"^1ERROR: Texture compression is required but not supported.\n"
"^1Expect visual problems."
msgstr ""
+"^1ERROR: breviare texturas postulatur sed computatrum ineptum est.\n"
+"^1Exspecta vitia in imagine."
#: qcsrc/menu/xonotic/util.qc:772
msgid "Use default"
ast "Asturian" "Asturianu" 73%
id_ID "Indonesian" "Bahasa Indonesia" 40%
-de "German" "Deutsch" 99%
-de_CH "German (Switzerland)" "Deutsch (Schweiz)" 99%
+de "German" "Deutsch" 100%
+de_CH "German (Switzerland)" "Deutsch (Schweiz)" 100%
en "English" "English" 100%
en_AU "English (Australia)" "English (Australia)" 69%
es "Spanish" "Español" 99%
fr "French" "Français" 100%
ga "Irish" "Irish" 29%
it "Italian" "Italiano" 99%
-la "Latin" "Lingua Latina" 97%
+la "Latin" "Lingua Latina" 99%
hu "Hungarian" "Magyar" 44%
nl "Dutch" "Nederlands" 62%
pl "Polish" "Polski" 79%
#pragma once
-void Cmd_Scoreboard_SetFields(int);
+void Cmd_Scoreboard_SetFields(int argc);
void Cmd_Scoreboard_Help();
void ConsoleCommand_macro_init();
PlayerScoreField sbt_field[MAX_SBT_FIELDS + 1];
float sbt_field_size[MAX_SBT_FIELDS + 1];
string sbt_field_title[MAX_SBT_FIELDS + 1];
+float sbt_field_title_condense_factor[MAX_SBT_FIELDS + 1];
+float sbt_field_title_width[MAX_SBT_FIELDS + 1];
int sbt_num_fields;
+float sbt_field_title_maxwidth;
+float sbt_field_title_maxwidth_factor;
string autocvar_hud_fontsize;
-string hud_fontsize_str;
float max_namesize;
float sbt_bg_alpha;
float autocvar_hud_panel_scoreboard_table_bg_scale = 0.25;
float autocvar_hud_panel_scoreboard_table_fg_alpha = 0.9;
float autocvar_hud_panel_scoreboard_table_fg_alpha_self = 1;
+float autocvar_hud_panel_scoreboard_table_fieldtitle_maxwidth = 0.07;
bool autocvar_hud_panel_scoreboard_table_highlight = true;
float autocvar_hud_panel_scoreboard_table_highlight_alpha = 0.2;
float autocvar_hud_panel_scoreboard_table_highlight_alpha_self = 0.4;
SCO_LABEL(_("SCO^caps"), "caps", " ", _("How often a flag (CTF) or a key (KeyHunt) was captured"));
SCO_LABEL(_("SCO^captime"), "captime", " ", _("Time of fastest capture (CTF)"));
SCO_LABEL(_("SCO^deaths"), "deaths", " ", _("Number of deaths"));
- SCO_LABEL(_("SCO^destroyed"), "destroyed", " ", _("Number of keys destroyed by pushing them into void"));
- SCO_LABEL(_("SCO^damage"), "dmg", " ", _("The total damage done"));
- SCO_LABEL(_("SCO^dmgtaken"), "dmgtaken", " ", _("The total damage taken"));
+ SCO_LABEL(_("SCO^destructions"), "destructions", " ", _("Number of keys destroyed by pushing them into void"));
+ SCO_LABEL(_("SCO^damage dealt"), "dmg", " ", _("The total damage dealt"));
+ SCO_LABEL(_("SCO^damage taken"), "dmgtaken", " ", _("The total damage taken"));
SCO_LABEL(_("SCO^drops"), "drops", " ", _("Number of flag drops"));
SCO_LABEL(_("SCO^elo"), "elo", " ", _("Player ELO"));
SCO_LABEL(_("SCO^fastest"), "fastest", " ", _("Time of fastest lap (Race/CTS)"));
SCO_LABEL(_("SCO^fckills"), "fckills", " ", _("Number of flag carrier kills"));
SCO_LABEL(_("SCO^fps"), "fps", " ", _("FPS"));
SCO_LABEL(_("SCO^frags"), "frags", " ", _("Number of kills minus suicides"));
+ SCO_LABEL(_("SCO^generators"), "generators", " ", _("Number of generators destroyed"));
SCO_LABEL(_("SCO^goals"), "goals", " ", _("Number of goals scored"));
SCO_LABEL(_("SCO^hunts"), "hunts", " ", _("Number of hunts (Survival)"));
SCO_LABEL(_("SCO^kckills"), "kckills", " ", _("Number of keys carrier kills"));
str = strtolower(str);
strcpy(sbt_field_title[sbt_num_fields], TranslateScoresLabel(str));
- sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
PlayerScoreField j;
switch(str)
LOG_INFOF("^1Error:^7 Unknown score field: '%s'", str);
strfree(sbt_field_title[sbt_num_fields]);
- sbt_field_size[sbt_num_fields] = 0;
continue;
LABEL(found)
for(i = sbt_num_fields; i > 0; --i)
{
sbt_field_title[i] = sbt_field_title[i-1];
- sbt_field_size[i] = sbt_field_size[i-1];
sbt_field[i] = sbt_field[i-1];
}
sbt_field_title[0] = strzone(TranslateScoresLabel("name"));
for(i = sbt_num_fields; i > 1; --i)
{
sbt_field_title[i] = sbt_field_title[i-1];
- sbt_field_size[i] = sbt_field_size[i-1];
sbt_field[i] = sbt_field[i-1];
}
sbt_field_title[1] = strzone("|");
sbt_field[1] = SP_SEPARATOR;
- sbt_field_size[1] = stringwidth("|", false, hud_fontsize);
++sbt_num_fields;
LOG_INFO("fixed missing field '|'");
}
else if(!have_separator)
{
strcpy(sbt_field_title[sbt_num_fields], "|");
- sbt_field_size[sbt_num_fields] = stringwidth("|", false, hud_fontsize);
sbt_field[sbt_num_fields] = SP_SEPARATOR;
++sbt_num_fields;
LOG_INFO("fixed missing field '|'");
if(!have_secondary)
{
strcpy(sbt_field_title[sbt_num_fields], TranslateScoresLabel(scores_label(ps_secondary)));
- sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
sbt_field[sbt_num_fields] = ps_secondary;
++sbt_num_fields;
LOG_INFOF("fixed missing field '%s'", scores_label(ps_secondary));
if(!have_primary)
{
strcpy(sbt_field_title[sbt_num_fields], TranslateScoresLabel(scores_label(ps_primary)));
- sbt_field_size[sbt_num_fields] = stringwidth(sbt_field_title[sbt_num_fields], false, hud_fontsize);
sbt_field[sbt_num_fields] = ps_primary;
++sbt_num_fields;
LOG_INFOF("fixed missing field '%s'", scores_label(ps_primary));
}
sbt_field[sbt_num_fields] = SP_END;
+ sbt_field_size[0] = 0; // tells Scoreboard_Draw to initialize all field sizes
}
string Scoreboard_AddPlayerId(string pl_name, entity pl)
float sbt_fixcolumnwidth_iconlen;
float sbt_fixcolumnwidth_marginlen;
-string Scoreboard_FixColumnWidth(int i, string str)
+string Scoreboard_FixColumnWidth(int i, string str, bool init)
{
TC(int, i);
float f;
else
sbt_fixcolumnwidth_marginlen = 0;
+ if (init)
+ sbt_field_title_width[i] = stringwidth(sbt_field_title[i], false, hud_fontsize);
+
if(sbt_field[i] == SP_NAME) // name gets all remaining space
{
int j;
if(j != i)
if (sbt_field[i] != SP_SEPARATOR)
remaining_space += sbt_field_size[j] + hud_fontsize.x;
- sbt_field_size[i] = panel_size.x - remaining_space;
+ sbt_field_size[i] = max(sbt_field_title_width[i], panel_size.x - remaining_space);
if (sbt_fixcolumnwidth_iconlen != 0)
remaining_space += sbt_fixcolumnwidth_marginlen + sbt_fixcolumnwidth_iconlen * hud_fontsize.x;
- float namesize = panel_size.x - remaining_space;
+ float namesize = max(sbt_field_title_width[i], panel_size.x - remaining_space);
str = textShortenToWidth(str, namesize, hud_fontsize, stringwidth_colors);
sbt_fixcolumnwidth_len = stringwidth(str, true, hud_fontsize);
- max_namesize = vid_conwidth - remaining_space;
+ max_namesize = max(sbt_field_title_width[i], vid_conwidth - remaining_space);
}
else
+ {
+ if (init)
+ {
+ sbt_field_size[i] = sbt_field_title_width[i];
+ float title_maxwidth = sbt_field_title_maxwidth * sbt_field_title_maxwidth_factor;
+ if (sbt_field_size[i] && sbt_field_size[i] > title_maxwidth)
+ sbt_field_size[i] = title_maxwidth;
+ }
sbt_fixcolumnwidth_len = stringwidth(str, false, hud_fontsize);
+ }
f = sbt_fixcolumnwidth_len + sbt_fixcolumnwidth_marginlen + sbt_fixcolumnwidth_iconlen * hud_fontsize.x;
if(sbt_field_size[i] < f)
sbt_field_size[i] = f;
+ sbt_field_title_condense_factor[i] = 0;
+ if (sbt_field_title_width[i] > sbt_field_size[i])
+ {
+ float real_maxwidth = sbt_field_size[i];
+ float title_maxwidth = sbt_field_title_maxwidth * sbt_field_title_maxwidth_factor;
+ if (sbt_field_title_width[i] > title_maxwidth)
+ real_maxwidth = max(sbt_field_size[i], title_maxwidth);
+ sbt_field_title_condense_factor[i] = real_maxwidth / sbt_field_title_width[i];
+ }
+
return str;
}
-void Scoreboard_initFieldSizes()
+void Scoreboard_initFieldSizes(bool compress_more)
{
+ if (compress_more)
+ {
+ sbt_field_title_maxwidth_factor -= 0.05;
+ if (sbt_field_title_maxwidth * sbt_field_title_maxwidth_factor < 0.01 * vid_conwidth)
+ {
+ sbt_field_title_maxwidth_factor = (0.01 * vid_conwidth) / sbt_field_title_maxwidth;
+ return;
+ }
+ }
+ else
+ sbt_field_title_maxwidth_factor = 1;
+ int name_index = 0;
for(int i = 0; i < sbt_num_fields; ++i)
{
- sbt_field_size[i] = stringwidth(sbt_field_title[i], false, hud_fontsize);
- Scoreboard_FixColumnWidth(i, "");
+ if (sbt_field[i] == SP_NAME)
+ {
+ name_index = i;
+ continue;
+ }
+
+ Scoreboard_FixColumnWidth(i, "", true);
}
+
+ // update name field size in the end as it takes remaining space
+ Scoreboard_FixColumnWidth(name_index, "", true);
}
vector Scoreboard_DrawHeader(vector pos, vector rgb, bool other_players)
if (sbt_highlight)
if (i % 2)
drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL);
+ vector prev_drawfontscale = drawfontscale;
+ if (sbt_field_title_condense_factor[i])
+ drawfontscale.x *= sbt_field_title_condense_factor[i];
drawstring(pos + text_offset, sbt_field_title[i], hud_fontsize, rgb * 1.5, sbt_fg_alpha, DRAWFLAG_NORMAL);
+ if (sbt_field_title_condense_factor[i])
+ {
+ drawfontscale.x *= sbt_field_title_condense_factor[i];
+ drawfontscale = prev_drawfontscale;
+ }
pos.x += column_dim.x;
}
+
+ float left_columns_end = pos.x - hud_fontsize.x;
+
if(sbt_field[i] == SP_SEPARATOR)
{
pos.x = panel_pos.x + panel_size.x - hud_fontsize.x * 0.5;
drawfill(pos - eX * hud_fontsize.x * 0.5, column_dim, '0 0 0', sbt_highlight_alpha, DRAWFLAG_NORMAL);
}
- text_offset.x = sbt_field_size[i] - stringwidth(sbt_field_title[i], false, hud_fontsize);
+ vector prev_drawfontscale = drawfontscale;
+ float titlewidth = stringwidth(sbt_field_title[i], false, hud_fontsize);
+ if (sbt_field_title_condense_factor[i])
+ {
+ drawfontscale.x *= sbt_field_title_condense_factor[i];
+ text_offset.x = sbt_field_size[i] - titlewidth * sbt_field_title_condense_factor[i];
+ }
+ else
+ text_offset.x = sbt_field_size[i] - titlewidth;
drawstring(pos + text_offset, sbt_field_title[i], hud_fontsize, rgb * 1.5, sbt_fg_alpha, DRAWFLAG_NORMAL);
+ if (sbt_field_title_condense_factor[i])
+ {
+ drawfontscale.x *= sbt_field_title_condense_factor[i];
+ drawfontscale = prev_drawfontscale;
+ }
pos.x -= hud_fontsize.x;
}
+
+ float right_columns_start = pos.x + hud_fontsize.x * 0.5;
+ if (left_columns_end > right_columns_start)
+ Scoreboard_initFieldSizes(true);
}
pos.x = panel_pos.x;
continue;
}
str = Scoreboard_GetField(pl, field, autocvar_hud_panel_scoreboard_scores_per_round);
- str = Scoreboard_FixColumnWidth(i, str);
+ str = Scoreboard_FixColumnWidth(i, str, false);
pos.x += sbt_field_size[i] + hud_fontsize.x;
}
str = Scoreboard_GetField(pl, field, autocvar_hud_panel_scoreboard_scores_per_round);
- str = Scoreboard_FixColumnWidth(i, str);
+ str = Scoreboard_FixColumnWidth(i, str, false);
if(field == SP_NAME) {
tmp.x = sbt_fixcolumnwidth_len; // left or right aligned? let's put it right...
void Scoreboard_Draw()
{
+ bool sb_init_field_sizes = false;
+
if(!autocvar__hud_configure)
{
if(!hud_draw_maximized) return;
scoreboard_fade_alpha = min(1, scoreboard_fade_alpha + frametime * scoreboard_fadeinspeed);
else
scoreboard_fade_alpha = 1;
+
+ static string hud_fontsize_str;
if(hud_fontsize_str != autocvar_hud_fontsize)
{
hud_fontsize = HUD_GetFontsize("hud_fontsize");
- Scoreboard_initFieldSizes();
strcpy(hud_fontsize_str, autocvar_hud_fontsize);
+ sb_init_field_sizes = true;
+ }
+
+ static float scoreboard_table_fieldtitle_maxwidth_prev;
+ if (scoreboard_table_fieldtitle_maxwidth_prev != autocvar_hud_panel_scoreboard_table_fieldtitle_maxwidth)
+ {
+ scoreboard_table_fieldtitle_maxwidth_prev = autocvar_hud_panel_scoreboard_table_fieldtitle_maxwidth;
+ sbt_field_title_maxwidth = bound(0.01, autocvar_hud_panel_scoreboard_table_fieldtitle_maxwidth, 0.1);
+ sbt_field_title_maxwidth *= vid_conwidth;
+ sb_init_field_sizes = true;
}
}
else {
panel_pos.x = scoreboard_left;
panel_size.x = fixed_scoreboard_width;
+ // field sizes can be initialized now after panel_size.x calculation
+ if (!sbt_field_size[0] || sb_init_field_sizes)
+ Scoreboard_initFieldSizes(false);
+
Scoreboard_UpdatePlayerTeams();
scoreboard_top = panel_pos.y;
// Game Info: Game Type
if (scoreboard_ui_enabled == 2)
str = _("Team Selection");
+ else if (gametype_custom_name != "")
+ str = gametype_custom_name;
else
str = MapInfo_Type_ToText(gametype);
draw_beginBoldFont();
// CSQC_Init : Called every time the CSQC code is initialized (essentially at map load)
// Useful for precaching things
-void CSQC_Init()
+void CSQC_Init(float apilevel, string enginename, float engineversion)
{
prvm_language = strzone(cvar_string("prvm_language"));
localcmd("\n-button12\n");
+ strfree(gametype_custom_name);
+
deactivate_minigame();
HUD_MinigameMenu_Close(NULL, NULL, NULL);
{
make_pure(this);
gametype = ReadRegistered(Gametypes);
+ strcpy(gametype_custom_name, ReadString());
teamplay = _MapInfo_GetTeamPlayBool(gametype);
HUD_ModIcons_SetFunc();
FOREACH(Scores, true, {
bool postinit;
entity gametype;
+string gametype_custom_name;
// temporary hack
#define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
setproperty(VF_FOV, fov);
}
-void CSQC_UpdateView(entity this, float w, float h)
+void CSQC_UpdateView(entity this, float w, float h, bool notmenu)
{
TC(int, w); TC(int, h);
field_team(ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
field(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
field(SP_KH_PUSHES, "pushes", 0);
- field(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER);
+ field(SP_KH_DESTRUCTIONS, "destructions", SFL_LOWER_IS_BETTER);
field(SP_KH_PICKUPS, "pickups", 0);
field(SP_KH_KCKILLS, "kckills", 0);
field(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER);
// don't actually GIVE them the -nn points, just log
if(lostkey.kh_previous_owner.playerid == lostkey.kh_previous_owner_playerid)
- GameRules_scoring_add(lostkey.kh_previous_owner, KH_DESTROYS, 1);
+ GameRules_scoring_add(lostkey.kh_previous_owner, KH_DESTRUCTIONS, 1);
DistributeEvenly_Init(autocvar_g_balance_keyhunt_score_destroyed, keys * of + players);
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, APP_TEAM_NUM(winner_team, CENTER_ROUND_TEAM_WIN));
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, APP_TEAM_NUM(winner_team, INFO_ROUND_TEAM_WIN));
- TeamScore_AddToTeam(winner_team, ST_ONS_CAPS, +1);
+ TeamScore_AddToTeam(winner_team, ST_ONS_GENS, +1);
}
else if(winner_team == -1)
{
int teams = TeamBalance_GetAllowedTeams(balance);
TeamBalance_Destroy(balance);
GameRules_scoring(teams, SFL_SORT_PRIO_PRIMARY, 0, {
- field_team(ST_ONS_CAPS, "destroyed", SFL_SORT_PRIO_PRIMARY);
+ field_team(ST_ONS_GENS, "generators", SFL_SORT_PRIO_PRIMARY);
field(SP_ONS_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
field(SP_ONS_TAKES, "takes", 0);
});
void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius);
// score rule declarations
-const int ST_ONS_CAPS = 1;
+const int ST_ONS_GENS = 1;
REGISTER_SP(KH_CAPS);
REGISTER_SP(KH_KCKILLS);
REGISTER_SP(KH_LOSSES);
-REGISTER_SP(KH_DESTROYS);
+REGISTER_SP(KH_DESTRUCTIONS);
REGISTER_SP(KH_PUSHES);
REGISTER_SP(KH_PICKUPS);
string getWrappedLine(float w, vector size, textLengthUpToWidth_widthFunction_t tw);
string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw);
+// FIXME can't use Gametype gt because Gitlab compilation unit test fails
float isGametypeInFilter(entity gt, float tp, float ts, string pattern);
vector solve_shotdirection(vector myorg, vector myvel, vector eorg, vector evel, float spd, float newton_style);
// 3 = mousemove absolute, x, y (DP_CSQC)
bool CSQC_InputEvent(int eventtype, int x, int y);
-void CSQC_UpdateView(int width, int height);
+void CSQC_UpdateView(int vid_width, int vid_height, bool notmenu);
// catch commands registered with registercommand
bool CSQC_ConsoleCommand(string cmd);
bool CSQC_Parse_TempEntity();
void CSQC_Ent_Update(bool isnew);
void CSQC_Ent_Remove();
-void CSQC_Init();
+void CSQC_Init(float apilevel, string enginename, float engineversion);
void CSQC_Shutdown();
// input:
#undef spawn
-#define localcmd cmd
-
int(string str, string sub, int startpos) _strstrofs = #221;
#define strstrofs _strstrofs
int(string str, int ofs) _str2chr = #222;
float trace_inwater;
//
-// required prog functions
+// prog functions called by engine
//
-void() CSQC_Init;
-void() CSQC_Shutdown;
-float(float f, float t, float n) CSQC_InputEvent;
-void(float w, float h) CSQC_UpdateView;
-float(string s) CSQC_ConsoleCommand;
+void CSQC_Init(float apilevel, string enginename, float engineversion);
+void CSQC_Shutdown();
+float CSQC_InputEvent(float evtype, float scanx, float chary);
+void CSQC_UpdateView(float vid_width, float vid_height, float notmenu); // required for EXT_CSQC (preferred)
+float CSQC_ConsoleCommand(string cmdstr);
+#ifdef CSQC_SIMPLE // hud-only CSQC
+ void CSQC_DrawHud(vector virtsize, float showscores); // required for CSQC_SIMPLE (fallback)
+ void CSQC_DrawScores(vector virtsize, float showscores);
+#endif
//these fields are read and set by the default player physics
vector pmove_org;
//field definitions:
.float buttonchat;
//description:
-//true if the player is currently chatting (in messagemode, menus or console)
+//true if the player is currently chatting (in messagemode, menus or console) or if their game window is not active.
//DP_BUTTONUSE
//idea: id Software
float random(void) = #12; // Returns a random number > 0 and < 1
void cmd(string command, ...) = #13;
+void localcmd(string command, ...) = #13;
// cvar cmds
#endif
#ifdef CSQC
- void _CSQC_Init();
- void CSQC_Init() { if (_CSQC_Init) _CSQC_Init(); }
+ void _CSQC_Init(float apilevel, string enginename, float engineversion);
+ void CSQC_Init(float apilevel, string enginename, float engineversion) { if (_CSQC_Init) _CSQC_Init(apilevel, enginename, engineversion); }
#define CSQC_Init _CSQC_Init
void _CSQC_Shutdown();
void CSQC_Shutdown() { if (_CSQC_Shutdown) _CSQC_Shutdown(); }
#define CSQC_Shutdown _CSQC_Shutdown
- void _CSQC_UpdateView(entity this, float w, float h);
- void CSQC_UpdateView(float w, float h) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h); }
+ void _CSQC_UpdateView(entity this, float w, float h, bool notmenu);
+ void CSQC_UpdateView(float w, float h, bool notmenu) { ENGINE_EVENT(); if (_CSQC_UpdateView) _CSQC_UpdateView(this, w, h, notmenu); }
#define CSQC_UpdateView _CSQC_UpdateView
bool _CSQC_InputEvent(int inputType, float nPrimary, float nSecondary);
Gametype t = MapInfo_Type_FromString(s, false, false);
if (t)
- GameTypeVote_SetGametype(t);
+ {
+ // don't execute gametype hooks because they can change active
+ // gametype rules if executed during the game
+ GameTypeVote_SetGametype(t, "", false);
+ }
else
bprint("Failed to switch to ", s, ": this game type does not exist!\n");
MapVote_AddVotable(GetNextMap(), false);
}
-bool GameTypeVote_SetGametype(Gametype type);
-
-// gametype_name can be the name of a custom gametype based on Gametype type
-void GameTypeVote_ApplyGameType(Gametype type, string gametype_name)
-{
- if (gametype_name == "")
- gametype_name = MapInfo_Type_ToString(type);
-
- localcmd("sv_vote_gametype_hook_all\n");
- localcmd("sv_vote_gametype_hook_", gametype_name, "\n");
-
- if (!GameTypeVote_SetGametype(type))
- LOG_TRACE("Selected gametype is not supported by any map");
-}
-
string voted_gametype_string;
Gametype voted_gametype;
Gametype match_gametype;
// In this case apply back match_gametype here so that the "restart" command, if called,
// properly restarts the map applying the current game type.
// Applying voted_gametype before map vote start is needed to properly initialize map vote.
+ string gametype_custom_string = "";
+ if (gametype_custom_enabled)
+ gametype_custom_string = loaded_gametype_custom_string;
if (match_gametype)
- GameTypeVote_ApplyGameType(match_gametype, gametype_custom_string);
+ GameTypeVote_SetGametype(match_gametype, gametype_custom_string, true);
}
void MapVote_SendPicture(entity to, int id)
{
// map vote but gametype has been chosen via voting screen
WriteByte(MSG_ENTITY, BIT(1)); // gametypevote_flags
- WriteString(MSG_ENTITY, MapInfo_Type_ToText(voted_gametype));
+ string voted_gametype_name;
+ if (voted_gametype_string == MapInfo_Type_ToString(voted_gametype))
+ voted_gametype_name = MapInfo_Type_ToText(voted_gametype);
+ else
+ voted_gametype_name = cvar_string(strcat("sv_vote_gametype_", voted_gametype_string, "_name"));
+ WriteString(MSG_ENTITY, voted_gametype_name);
}
else
WriteByte(MSG_ENTITY, 0); // map vote
RandomSelection_Init();
currentPlace = 0;
currentVotes = -1;
+ string current_gametype_string;
+ if (gametype_custom_enabled)
+ current_gametype_string = loaded_gametype_custom_string;
+ else
+ current_gametype_string = MapInfo_Type_ToString(MapInfo_CurrentGametype());
for(i = 0; i < mapvote_count_real; ++i)
if ( mapvote_maps_flags[i] & GTV_AVAILABLE )
{
RandomSelection_AddFloat(i, 1, mapvote_selections[i]);
- if ( gametypevote && mapvote_maps[i] == MapInfo_Type_ToString(MapInfo_CurrentGametype()) )
+ if ( gametypevote && mapvote_maps[i] == current_gametype_string )
{
currentVotes = mapvote_selections[i];
currentPlace = i;
{
if (voted_gametype)
{
- // clear match_gametype so that GameTypeVote_ApplyGameType
+ // clear match_gametype so that GameTypeVote_SetGametype
// prints the game type switch message
match_gametype = NULL;
- GameTypeVote_ApplyGameType(voted_gametype, voted_gametype_string);
+ GameTypeVote_SetGametype(voted_gametype, voted_gametype_string, true);
}
Map_Goto_SetStr(mapvote_maps[mapvote_winner]);
MapVote_Tick();
}
-bool GameTypeVote_SetGametype(Gametype type)
+// if gametype_string is "" then gametype_string is inferred from Gametype type
+// otherwise gametype_string is the string (short name) of a custom gametype
+bool GameTypeVote_SetGametype(Gametype type, string gametype_string, bool call_hooks)
{
+ if (!call_hooks)
+ {
+ // custom gametype is disabled because gametype hooks can't be executed
+ gametype_custom_enabled = false;
+ }
+ else
+ {
+ if (gametype_string == "")
+ gametype_string = MapInfo_Type_ToString(type);
+ gametype_custom_enabled = (gametype_string != MapInfo_Type_ToString(type));
+
+ localcmd("sv_vote_gametype_hook_all\n");
+ localcmd("sv_vote_gametype_hook_", gametype_string, "\n");
+ }
+
if (MapInfo_CurrentGametype() == type)
return true;
voted_gametype = GameTypeVote_Type_FromString(mapvote_maps[pos]);
strcpy(voted_gametype_string, mapvote_maps[pos]);
- GameTypeVote_ApplyGameType(voted_gametype, voted_gametype_string);
+ GameTypeVote_SetGametype(voted_gametype, voted_gametype_string, true);
// save to a cvar so it can be applied back when gametype is temporary
// changed on gametype vote end of the next game
{
if ( mapvote_count > 0 )
strunzone(mapvote_maps[0]);
- mapvote_maps[0] = strzone(MapInfo_Type_ToString(MapInfo_CurrentGametype()));
+ string current_gametype_string;
+ if (gametype_custom_enabled)
+ current_gametype_string = loaded_gametype_custom_string;
+ else
+ current_gametype_string = MapInfo_Type_ToString(MapInfo_CurrentGametype());
+ mapvote_maps[0] = strzone(current_gametype_string);
//GameTypeVote_Finished(0);
MapVote_Finished(0);
return false;
void MapVote_Spawn();
void MapVote_Think();
void MapVote_SendPicture(entity to, int id);
-bool GameTypeVote_SetGametype(entity type);
+// FIXME can't use Gametype type because Gitlab compilation unit test fails
+bool GameTypeVote_SetGametype(entity type, string gametype_string, bool call_hooks);
float GameTypeVote_Start();
float GameTypeVote_Finished(int pos);
string GameTypeVote_MapInfo_FixName(string m);
float i;
WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
WriteRegistered(Gametypes, MSG_ENTITY, MapInfo_LoadedGametype);
+ string gt_name = "";
+ if (loaded_gametype_custom_string != "")
+ gt_name = cvar_string(strcat("sv_vote_gametype_", loaded_gametype_custom_string, "_name"));
+ WriteString(MSG_ENTITY, gt_name);
FOREACH(Scores, true, {
WriteString(MSG_ENTITY, scores_label(it));
WriteByte(MSG_ENTITY, scores_flags(it));
MapInfo_ClearTemps();
- strcpy(gametype_custom_string, autocvar__sv_vote_gametype_custom);
+ strcpy(loaded_gametype_custom_string, autocvar__sv_vote_gametype_custom);
+ gametype_custom_enabled = (loaded_gametype_custom_string != "");
cvar_set("_sv_vote_gametype_custom", ""); // clear it immediately so it can't get stuck
cache_mutatormsg = strzone("");
MapInfo_Shutdown();
strfree(sv_termsofservice_url_escaped);
- strfree(gametype_custom_string);
+ strfree(loaded_gametype_custom_string);
}
else if(world_initialized == 0)
{
string modname;
string autocvar__sv_vote_gametype_custom;
-string gametype_custom_string;
+bool gametype_custom_enabled;
+string loaded_gametype_custom_string;
string record_type;
set sv_timeout_leadtime 4 "how long the players will be informed that a timeout was called before it starts, in seconds"
set sv_timeout_resumetime 3 "how long the remaining timeout-time will be after a player called the timein command"
-set sv_autopause 1 "Single player or listen server: pause while all clients have the menu, console or chat open. Dedicated server: pause after starting a map if the server is empty and unpause when the first player joins the empty server."
+seta sv_autopause 1 "Single player or listen server: pause while all clients have the menu, console or chat open. Dedicated server: pause after starting a map if the server is empty and unpause when the first player joins the empty server."
set g_telefrags 1 "telefragging, i.e. killing someone who stands in the way of someone who is teleporting"
set g_telefrags_teamplay 1 "never telefrag team mates"