]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'drjaska/silent-respawn' into 'master'
authorDr. Jaska <drjaska83@gmail.com>
Sun, 7 Apr 2024 23:47:11 +0000 (23:47 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Sun, 7 Apr 2024 23:47:11 +0000 (23:47 +0000)
server side option for both (old) or individually silent or particleless (re)spawning

See merge request xonotic/xonotic-data.pk3dir!1218

29 files changed:
.tx/merge-base
_hud_common.cfg
common.de.po
common.de_CH.po
common.la.po
languages.txt
qcsrc/client/command/cl_cmd.qh
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/view.qc
qcsrc/common/gamemodes/gamemode/keyhunt/sv_keyhunt.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qh
qcsrc/common/scores.qh
qcsrc/common/util.qh
qcsrc/dpdefs/doc.md
qcsrc/dpdefs/menudefs.qh
qcsrc/dpdefs/upstream/csprogsdefs.qc
qcsrc/dpdefs/upstream/dpextensions.qc
qcsrc/dpdefs/upstream/menudefs.qc
qcsrc/lib/_all.inc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/mapvoting.qc
qcsrc/server/mapvoting.qh
qcsrc/server/scores.qc
qcsrc/server/world.qc
qcsrc/server/world.qh
xonotic-server.cfg

index d830393cfc435c7be3bd44c6d46cd8b1f34a5b1a..d47be2ddedf8c622dc278aeb74b76184c6ee0fbc 100644 (file)
@@ -1 +1 @@
-Tue Mar 26 07:22:58 AM CET 2024
+Wed Apr  3 07:22:55 AM CEST 2024
index 95f1e9758b0f10c48e20d3100e3adc23673e1172..954ffbd80885cc3774160376b614e13e3b943b06 100644 (file)
@@ -142,6 +142,7 @@ seta hud_panel_scoreboard_spectators_showping 1 "show ping of spectators"
 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"
index 7ce293dda23353fd4258f58df31fda853306070e..70a90e03a5aa21a366d303e0a199482a51e39943 100644 (file)
@@ -19,7 +19,7 @@
 # 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
@@ -35,7 +35,7 @@ msgstr ""
 "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"
@@ -1811,7 +1811,7 @@ msgstr "Die Anzahl der benötigten Frags, bevor das Spiel endet"
 
 #: qcsrc/common/minigames/cl_minigames.qc:287
 msgid "Spectators:"
-msgstr ""
+msgstr "Zuschauer:"
 
 #: qcsrc/common/minigames/cl_minigames.qc:424
 msgid "It's your turn"
index ad4004bb65ff22ee19ebf663bf9b21d1cd4fca6b..facd7469415fc3708693d6620415ec4348b53d68 100644 (file)
@@ -19,7 +19,7 @@
 # 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
@@ -35,7 +35,7 @@ msgstr ""
 "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"
@@ -1811,7 +1811,7 @@ msgstr "Die Anzahl der benötigten Frags, bevor das Spiel endet"
 
 #: qcsrc/common/minigames/cl_minigames.qc:287
 msgid "Spectators:"
-msgstr ""
+msgstr "Zuschauer:"
 
 #: qcsrc/common/minigames/cl_minigames.qc:424
 msgid "It's your turn"
index cb8d5b38842caff3cf4a128a2005f578cfc03e6e..728b41bc71258bdcc48b0429c53915642d41f860 100644 (file)
@@ -11,7 +11,7 @@ msgstr ""
 "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"
@@ -1770,7 +1770,7 @@ msgstr "Quotiens caedem facere necesse est ut ludus finiatur"
 
 #: qcsrc/common/minigames/cl_minigames.qc:287
 msgid "Spectators:"
-msgstr ""
+msgstr "Spectatores:"
 
 #: qcsrc/common/minigames/cl_minigames.qc:424
 msgid "It's your turn"
@@ -3625,12 +3625,12 @@ msgstr "^BG%s^K1 Hagaris missilia minima lusit%s%s"
 #: 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
@@ -5507,7 +5507,7 @@ msgstr "MROTADEORS"
 #: qcsrc/common/util.qc:1562
 #, c-format
 msgid "JOY%d"
-msgstr ""
+msgstr "GUBRNCL%d"
 
 #: qcsrc/common/util.qc:1565
 #, c-format
@@ -5517,7 +5517,7 @@ msgstr "AUX%d"
 #: 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
@@ -5536,17 +5536,17 @@ msgstr "X360_%s"
 #: 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
@@ -5581,12 +5581,12 @@ msgstr "DEXTER_UMERUS"
 #: 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
@@ -5632,7 +5632,7 @@ msgstr "DEXTER_POLLEX_DEXTR"
 #: 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
@@ -5657,7 +5657,7 @@ msgstr "DEXTRUM"
 #: qcsrc/common/util.qc:1610
 #, c-format
 msgid "MIDINOTE%d"
-msgstr ""
+msgstr "MIDISONUS%d"
 
 #: qcsrc/common/vehicles/cl_vehicles.qc:171
 #, c-format
@@ -6054,7 +6054,7 @@ msgstr "Ludi Codex Computatralis"
 
 #: qcsrc/menu/xonotic/credits.qc:113
 msgid "Marketing / PR"
-msgstr ""
+msgstr "Annuntiationes"
 
 #: qcsrc/menu/xonotic/credits.qc:119
 msgid "Legal"
@@ -6243,11 +6243,11 @@ msgstr "Ita"
 
 #: 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 ""
@@ -7065,23 +7065,23 @@ msgstr "Margo:"
 
 #: 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:"
@@ -8049,15 +8049,15 @@ msgstr "* assumere"
 
 #: 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"
@@ -8329,7 +8329,7 @@ msgstr "Saepe"
 
 #: 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?"
@@ -8702,11 +8702,11 @@ msgstr ""
 
 #: 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"
@@ -8779,7 +8779,7 @@ msgstr "Reticuli color ordinarius"
 
 #: 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"
@@ -8861,7 +8861,7 @@ msgstr "Litterae magnitudo:"
 
 #: 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"
@@ -9411,25 +9411,26 @@ msgstr "Muris motio secundum systema computatrale generale"
 
 #: 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"
@@ -9455,7 +9456,7 @@ msgstr "Semper"
 #: 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:"
@@ -9657,7 +9658,7 @@ msgstr "Genus:"
 
 #: 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:"
@@ -9798,7 +9799,7 @@ msgstr ""
 
 #: 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:"
@@ -9868,6 +9869,8 @@ msgid ""
 "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"
@@ -9920,31 +9923,34 @@ msgstr "Cum quo multiplicare distinctionem colorum in locis umbrosis"
 
 #: 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"
@@ -10068,7 +10074,7 @@ msgstr "Sinisne nomen tuum in statisticis nuntiari?"
 
 #: 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"
@@ -10216,7 +10222,7 @@ msgstr "index celer"
 
 #: 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"
@@ -10224,7 +10230,7 @@ msgstr "Creata ab utente"
 
 #: qcsrc/menu/xonotic/keybinder.qc:136
 msgid "Development"
-msgstr ""
+msgstr "Pro scriptore codicum"
 
 #: qcsrc/menu/xonotic/keybinder.qc:137
 msgid "sandbox menu"
@@ -10607,6 +10613,8 @@ msgid ""
 "^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"
index c95a926fdbb6717093973a0d6d65d40f27a80200..a4d94d583111c162c7f4ce22ed8f758ebb52eeab 100644 (file)
@@ -1,14 +1,14 @@
 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%
index 725baa408e9c0c47dd748a596e26a751e1b05683..13434ec05c995f4129dd5e5a9bdbff8d3b00e5e3 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-void Cmd_Scoreboard_SetFields(int);
+void Cmd_Scoreboard_SetFields(int argc);
 void Cmd_Scoreboard_Help();
 void ConsoleCommand_macro_init();
 
index 35227ffab524c63bb077dfb624b4005f19ed4032..ad86b270c8ef633ce9e46a9223b7fc6dfed5a6db 100644 (file)
@@ -43,10 +43,13 @@ const int MAX_SBT_FIELDS = MAX_SCORE;
 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;
@@ -75,6 +78,7 @@ float autocvar_hud_panel_scoreboard_table_bg_alpha = 0;
 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;
@@ -136,9 +140,9 @@ string Label_getInfo(string label, int mode)
                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)"));
@@ -146,6 +150,7 @@ string Label_getInfo(string label, int mode)
                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"));
@@ -839,7 +844,6 @@ void Cmd_Scoreboard_SetFields(int argc)
 
                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)
@@ -870,7 +874,6 @@ void Cmd_Scoreboard_SetFields(int argc)
                                        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)
@@ -903,7 +906,6 @@ void Cmd_Scoreboard_SetFields(int argc)
                        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"));
@@ -917,12 +919,10 @@ void Cmd_Scoreboard_SetFields(int argc)
                                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 '|'");
                        }
@@ -930,7 +930,6 @@ void Cmd_Scoreboard_SetFields(int argc)
                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 '|'");
@@ -938,7 +937,6 @@ void Cmd_Scoreboard_SetFields(int argc)
                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));
@@ -946,7 +944,6 @@ void Cmd_Scoreboard_SetFields(int argc)
                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));
@@ -954,6 +951,7 @@ void Cmd_Scoreboard_SetFields(int argc)
        }
 
        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)
@@ -1165,7 +1163,7 @@ float sbt_fixcolumnwidth_len;
 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;
@@ -1205,6 +1203,9 @@ string Scoreboard_FixColumnWidth(int i, string str)
        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;
@@ -1213,33 +1214,72 @@ string Scoreboard_FixColumnWidth(int i, string str)
                        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)
@@ -1258,9 +1298,20 @@ 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;
@@ -1278,10 +1329,27 @@ vector Scoreboard_DrawHeader(vector pos, vector rgb, bool other_players)
                                        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;
@@ -1331,7 +1399,7 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
                        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;
 
@@ -1367,7 +1435,7 @@ void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, i
                        }
 
                        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...
@@ -2240,6 +2308,8 @@ string Scoreboard_Fraglimit_Draw(float limit, bool is_leadlimit)
 
 void Scoreboard_Draw()
 {
+       bool sb_init_field_sizes = false;
+
        if(!autocvar__hud_configure)
        {
                if(!hud_draw_maximized) return;
@@ -2255,11 +2325,22 @@ void Scoreboard_Draw()
                                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 {
@@ -2309,6 +2390,10 @@ void Scoreboard_Draw()
        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;
@@ -2326,6 +2411,8 @@ void Scoreboard_Draw()
        // 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();
index 8a8e3f39d3e354cf3cf4cbf76d7401975c020fd5..40cb19f74057e249202a916f3fb156ff245826cf 100644 (file)
@@ -43,7 +43,7 @@
 // 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"));
 
@@ -198,6 +198,8 @@ void Shutdown()
 
        localcmd("\n-button12\n");
 
+       strfree(gametype_custom_name);
+
        deactivate_minigame();
        HUD_MinigameMenu_Close(NULL, NULL, NULL);
 
@@ -1092,6 +1094,7 @@ NET_HANDLE(ENT_CLIENT_SCORES_INFO, bool isnew)
 {
        make_pure(this);
        gametype = ReadRegistered(Gametypes);
+       strcpy(gametype_custom_name, ReadString());
        teamplay = _MapInfo_GetTeamPlayBool(gametype);
        HUD_ModIcons_SetFunc();
        FOREACH(Scores, true, {
index 7929a450e078d0a9bc339b3f583858e7aae3ab6d..34c8fc63be8bc5f08459b62e043275e0eccf6cc5 100644 (file)
@@ -30,6 +30,7 @@ string minimapname;
 
 bool postinit;
 entity gametype;
+string gametype_custom_name;
 // temporary hack
 #define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
 
index bf6e22c61c9cfd655b09a98ab879b0cddaca9f76..6a011d3f898738a289a0ccb7d8da35a50b0f2aab 100644 (file)
@@ -1550,7 +1550,7 @@ void View_UpdateFov()
        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);
 
index 0e79b58ebf6b40b96f2b28b2f4bf793f47f89b18..beb5cd7f40f6d75a459466a132ae27eb571e0a95 100644 (file)
@@ -90,7 +90,7 @@ void kh_ScoreRules(int teams)
         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);
@@ -607,7 +607,7 @@ void kh_LoserTeam(int loser_team, entity lostkey)  // runs when a player pushes
                        // 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);
 
index ea07659e340a078927c60ee163bb5f043fe57468..370fda29d0f599a9cf40d6905568df2e06b3576d 100644 (file)
@@ -1197,7 +1197,7 @@ bool Onslaught_CheckWinner()
        {
                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)
        {
@@ -2135,7 +2135,7 @@ void ons_ScoreRules()
        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);
        });
index 1f98522ba7db9f17054d12275bb91c260b7d1cc6..e2d5044a25782276d790fe6605652892c17f8553 100644 (file)
@@ -94,4 +94,4 @@ void havocbot_goalrating_items(entity this, float ratingscale, vector org, float
 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;
index 8f22b5c7525bcea5c80f01d594c9fc38a11660a7..f6df5d28ce52094f9e23cab6ca613d056576cfa8 100644 (file)
@@ -47,7 +47,7 @@ REGISTER_SP(KEEPAWAY_PICKUPS);
 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);
 
index 01933cb348323b7090b7b889c85ae2271d55e094..1a1ebdba7fb9593faebb5a13301fe0fc0c59c4e9 100644 (file)
@@ -143,6 +143,7 @@ string getWrappedLine_remaining;
 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);
index b49bb6f57ad72e7ab0ff6bed1b20925d6e26362a..fa44a529e310c96ab7ec29f0dace12ce1db8df6e 100644 (file)
@@ -17,7 +17,7 @@
 // 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();
@@ -30,7 +30,7 @@ entity CSQC_Ent_Spawn(int entnum);
 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:
index 036d87ff2fa8e7a213932d69fc66e84e30700a94..d738f9ede8ab478c0a86eac9bb130a636dcc047c 100644 (file)
@@ -18,8 +18,6 @@
 
 #undef spawn
 
-#define localcmd cmd
-
 int(string str, string sub, int startpos) _strstrofs = #221;
 #define strstrofs _strstrofs
 int(string str, int ofs) _str2chr = #222;
index e392bf8eab5403e94c179858f1a21a10457332a2..bc921c4579c9ac469aed16a2b8a2d7cd39b74db8 100644 (file)
@@ -42,13 +42,17 @@ float               trace_inopen;
 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;
index f7e5b08ecc4236d71ded36783ec7aba48e6b690f..8a4d93c48ac17423bf473e2e3c3af3ad46470c3b 100644 (file)
@@ -35,7 +35,7 @@ float(string s) checkextension = #99;
 //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
index b987491b7cf778c5ea33bcfb2f783851b5a60461..93bdff12d6fbe9a0a455f214651c3d59403d3140 100644 (file)
@@ -182,6 +182,7 @@ vector      vectoangles(vector v)           = #11;
 float  random(void)  = #12; // Returns a random number > 0 and < 1
 
 void   cmd(string command, ...) = #13;
+void localcmd(string command, ...) = #13;
 
 // cvar cmds
 
index 0bef0b6e0e944feebfe54c14fea8728a9bc6d295..d33bda1d1b71a881958053d6710bb835cabf0659 100644 (file)
@@ -285,16 +285,16 @@ MACRO_END
 #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);
index ab360bc35efbdd322667ce15fd65c3bd7641539e..bb6074517ebe517aa4d926fd84a237ffcb47430b 100644 (file)
@@ -778,7 +778,11 @@ void GameCommand_gametype(int request, int argc)
                                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");
 
index 995fd60029afdaf7a524a9ad0f28b74825aee91c..b9d19f611dfdd61f6beae00b05181161cd7872d6 100644 (file)
@@ -215,21 +215,6 @@ void MapVote_AddVotableMaps(int nmax, int smax)
                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;
@@ -277,8 +262,11 @@ void MapVote_Init()
        // 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)
@@ -399,7 +387,12 @@ bool MapVote_SendEntity(entity this, entity to, int sf)
                {
                        // 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
@@ -559,11 +552,16 @@ bool MapVote_CheckRules_2()
        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;
@@ -699,10 +697,10 @@ void MapVote_Think()
                {
                        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]);
@@ -761,8 +759,25 @@ void MapVote_Think()
        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;
 
@@ -804,7 +819,7 @@ bool GameTypeVote_Finished(int pos)
        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
@@ -872,7 +887,12 @@ bool GameTypeVote_Start()
        {
                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;
index 36578740c07fff735e11041ce9811d1284727484..f2515bdad099cb497ff7010b6cd84ba18310e75b 100644 (file)
@@ -30,7 +30,8 @@ void MapVote_Start();
 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);
index c067fac8a1287704818121767438d4072e30b776..40bbec64424689f94e11551dbbc6e3c4b284c969 100644 (file)
@@ -208,6 +208,10 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
        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));
index ad40a389543bcb5698d2abc2a0ddd1068e1f0557..b6fbe0d85f3796c649a639dabcf31b2a9cb11c53 100644 (file)
@@ -736,7 +736,8 @@ void InitGameplayMode()
 
        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("");
@@ -2645,7 +2646,7 @@ void Shutdown()
                MapInfo_Shutdown();
 
                strfree(sv_termsofservice_url_escaped);
-               strfree(gametype_custom_string);
+               strfree(loaded_gametype_custom_string);
        }
        else if(world_initialized == 0)
        {
index a7301dc799b1fa96bc5a3102d95bc71faa3bd167..6348c72f6072a5862fdcb0ede96c7b981f7d48f3 100644 (file)
@@ -49,7 +49,8 @@ float cvar_purechanges_count;
 string modname;
 
 string autocvar__sv_vote_gametype_custom;
-string gametype_custom_string;
+bool gametype_custom_enabled;
+string loaded_gametype_custom_string;
 
 string record_type;
 
index f4644e0481d0a31713cec010092266207c718737..e638577222b1cc279385114895fd6e4e8777e022 100644 (file)
@@ -51,7 +51,7 @@ set sv_timeout_number 2 "how many timeouts one player is allowed to call (gets r
 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"