]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move race splits from infomessage to their own hud panel
authorDes <xon@damianv.com.ar>
Wed, 11 Sep 2024 15:56:35 +0000 (12:56 -0300)
committerDes <xon@damianv.com.ar>
Wed, 11 Sep 2024 15:56:35 +0000 (12:56 -0300)
21 files changed:
_hud_common.cfg
_hud_descriptions.cfg
hud_luma.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/hud/hud.qh
qcsrc/client/hud/panel/_mod.inc
qcsrc/client/hud/panel/_mod.qh
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/racesplits.qc [new file with mode: 0644]
qcsrc/client/hud/panel/racesplits.qh [new file with mode: 0644]
qcsrc/common/_mod.inc
qcsrc/common/_mod.qh
qcsrc/menu/xonotic/_mod.inc
qcsrc/menu/xonotic/_mod.qh
qcsrc/menu/xonotic/dialog_hudpanel_racesplits.qc [new file with mode: 0644]
qcsrc/menu/xonotic/dialog_hudpanel_racesplits.qh [new file with mode: 0644]
qcsrc/menu/xonotic/mainwindow.qc

index 954ffbd80885cc3774160376b614e13e3b943b06..a270e56a8790ebf2d68afe225e1568e3b0801ef2 100644 (file)
@@ -32,6 +32,7 @@ seta hud_panel_timer            1 "enable this panel"
 seta hud_panel_radar            1 "enable this panel, 2 = also enable in non-teambased gamemodes"
 seta hud_panel_score            1 "enable this panel"
 seta hud_panel_racetimer        1 "enable this panel"
+seta hud_panel_racesplits       1 "enable this panel"
 seta hud_panel_vote             1 "enable this panel"
 seta hud_panel_modicons         1 "enable this panel"
 seta hud_panel_pressedkeys      1 "enable this panel, 1 = show only when spectating other players, 2 = show always"
@@ -63,6 +64,7 @@ seta hud_panel_timer_dynamichud            1 "apply the dynamic hud effects to t
 seta hud_panel_radar_dynamichud            1 "apply the dynamic hud effects to this panel"
 seta hud_panel_score_dynamichud            1 "apply the dynamic hud effects to this panel"
 seta hud_panel_racetimer_dynamichud        1 "apply the dynamic hud effects to this panel"
+seta hud_panel_racesplits_dynamichud        1 "apply the dynamic hud effects to this panel"
 seta hud_panel_vote_dynamichud             1 "apply the dynamic hud effects to this panel"
 seta hud_panel_modicons_dynamichud         1 "apply the dynamic hud effects to this panel"
 seta hud_panel_pressedkeys_dynamichud      1 "apply the dynamic hud effects to this panel"
index b1831264694caaaa858c95e834366e48bfcc8ed3..b306d2116266997744eff07bfb90108e64649a38 100644 (file)
@@ -177,6 +177,17 @@ seta hud_panel_racetimer_bg_alpha "" "if set to something else than \"\" = overr
 seta hud_panel_racetimer_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_racetimer_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
+seta hud_panel_racesplits_pos "" "position of this base of the panel"
+seta hud_panel_racesplits_size "" "size of this panel"
+seta hud_panel_racesplits_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_racesplits_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_racesplits_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_racesplits_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_racesplits_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_racesplits_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_racesplits_lines "" "amount of lines to show, max 50, font size will adapt accordingly"
+seta hud_panel_racesplits_flip "" "1 = align the items to the right"
+
 seta hud_panel_vote_pos "" "position of this base of the panel"
 seta hud_panel_vote_size "" "size of this panel"
 seta hud_panel_vote_alreadyvoted_alpha "" "alpha of the vote dialog after you have voted"
index 9aaaac6f7c5db29a2ad9902ec8394451d129d26a..ee85f0467e017773eb81ff1c5aeeb63a083118dd 100644 (file)
@@ -178,6 +178,17 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
+seta hud_panel_racesplits_pos "0.700000 0.190000"
+seta hud_panel_racesplits_size "0.250000 0.170000"
+seta hud_panel_racesplits_bg ""
+seta hud_panel_racesplits_bg_color ""
+seta hud_panel_racesplits_bg_color_team ""
+seta hud_panel_racesplits_bg_alpha ""
+seta hud_panel_racesplits_bg_border ""
+seta hud_panel_racesplits_bg_padding ""
+seta hud_panel_racesplits_lines "8"
+seta hud_panel_racesplits_flip "1"
+
 seta hud_panel_vote_pos "0.740000 0.690000"
 seta hud_panel_vote_size "0.190000 0.090000"
 seta hud_panel_vote_bg "border_default"
index 6bc988364184b9a5707e4c3a7a99f4cdb87f470f..af5c75191210f2a45f31d6d3230a5d62648e0558 100644 (file)
@@ -178,6 +178,17 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
+seta hud_panel_racesplits_pos "0.700000 0.190000"
+seta hud_panel_racesplits_size "0.250000 0.170000"
+seta hud_panel_racesplits_bg ""
+seta hud_panel_racesplits_bg_color ""
+seta hud_panel_racesplits_bg_color_team ""
+seta hud_panel_racesplits_bg_alpha ""
+seta hud_panel_racesplits_bg_border ""
+seta hud_panel_racesplits_bg_padding ""
+seta hud_panel_racesplits_lines "8"
+seta hud_panel_racesplits_flip "1"
+
 seta hud_panel_vote_pos "0.720000 0.670000"
 seta hud_panel_vote_size "0.190000 0.090000"
 seta hud_panel_vote_bg "border_default"
index c798b7564c527d35f4fb29c65cf6174ee703f0b2..44f643707c013bf9b060796eaac335ddd5273de7 100644 (file)
@@ -178,6 +178,17 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
+seta hud_panel_racesplits_pos "0.700000 0.190000"
+seta hud_panel_racesplits_size "0.250000 0.170000"
+seta hud_panel_racesplits_bg ""
+seta hud_panel_racesplits_bg_color ""
+seta hud_panel_racesplits_bg_color_team ""
+seta hud_panel_racesplits_bg_alpha ""
+seta hud_panel_racesplits_bg_border ""
+seta hud_panel_racesplits_bg_padding ""
+seta hud_panel_racesplits_lines "8"
+seta hud_panel_racesplits_flip "1"
+
 seta hud_panel_vote_pos "0.720000 0.890000"
 seta hud_panel_vote_size "0.170000 0.110000"
 seta hud_panel_vote_bg ""
index 7532b807f3081a9f3c7794a9e909365b0742c8fc..e5bc48492858803befd3638879704bc9abec5ee4 100644 (file)
@@ -178,6 +178,17 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
+seta hud_panel_racesplits_pos "0.700000 0.190000"
+seta hud_panel_racesplits_size "0.250000 0.170000"
+seta hud_panel_racesplits_bg ""
+seta hud_panel_racesplits_bg_color ""
+seta hud_panel_racesplits_bg_color_team ""
+seta hud_panel_racesplits_bg_alpha ""
+seta hud_panel_racesplits_bg_border ""
+seta hud_panel_racesplits_bg_padding ""
+seta hud_panel_racesplits_lines "8"
+seta hud_panel_racesplits_flip "1"
+
 seta hud_panel_vote_pos "0.720000 0.890000"
 seta hud_panel_vote_size "0.170000 0.110000"
 seta hud_panel_vote_bg ""
index 80ab470df64411161bb78761cbc08ff6785da37d..2ec1d347a0d1225ec62b8fc81c474b041af433c4 100644 (file)
@@ -178,6 +178,17 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
+seta hud_panel_racesplits_pos "0.700000 0.190000"
+seta hud_panel_racesplits_size "0.250000 0.170000"
+seta hud_panel_racesplits_bg ""
+seta hud_panel_racesplits_bg_color ""
+seta hud_panel_racesplits_bg_color_team ""
+seta hud_panel_racesplits_bg_alpha ""
+seta hud_panel_racesplits_bg_border ""
+seta hud_panel_racesplits_bg_padding ""
+seta hud_panel_racesplits_lines "6"
+seta hud_panel_racesplits_flip "1"
+
 seta hud_panel_vote_pos "0.020000 0.650000"
 seta hud_panel_vote_size "0.230000 0.110000"
 seta hud_panel_vote_bg ""
index 2b8fe146577715ec77f3286ef4bf3bb9ca37b268..a404093025a785ba764f5b08accc731a81312022 100644 (file)
@@ -178,6 +178,17 @@ seta hud_panel_racetimer_bg_alpha ""
 seta hud_panel_racetimer_bg_border ""
 seta hud_panel_racetimer_bg_padding ""
 
+seta hud_panel_racesplits_pos "0.700000 0.190000"
+seta hud_panel_racesplits_size "0.250000 0.170000"
+seta hud_panel_racesplits_bg ""
+seta hud_panel_racesplits_bg_color ""
+seta hud_panel_racesplits_bg_color_team ""
+seta hud_panel_racesplits_bg_alpha ""
+seta hud_panel_racesplits_bg_border ""
+seta hud_panel_racesplits_bg_padding ""
+seta hud_panel_racesplits_lines "6"
+seta hud_panel_racesplits_flip "1"
+
 seta hud_panel_vote_pos "0.690000 0.750000"
 seta hud_panel_vote_size "0.300000 0.100000"
 seta hud_panel_vote_bg ""
index d1daf419760a13ebd4dab8c22b0049eecb3b711c..c22064ea02846684c554dc7d85a6b6b21b125755 100644 (file)
@@ -260,6 +260,7 @@ REGISTER_HUD_PANEL(TIMER,           HUD_Timer,          PANEL_CONFIG_MAIN | PANE
 REGISTER_HUD_PANEL(RADAR,           HUD_Radar,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RADAR
 REGISTER_HUD_PANEL(SCORE,           HUD_Score,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // SCORE
 REGISTER_HUD_PANEL(RACETIMER,       HUD_RaceTimer,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RACETIMER
+REGISTER_HUD_PANEL(RACESPLITS,      HUD_RaceSplits,     PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RACESPLITS
 REGISTER_HUD_PANEL(VOTE,            HUD_Vote,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE
 REGISTER_HUD_PANEL(MODICONS,        HUD_ModIcons,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // MODICONS
 REGISTER_HUD_PANEL(PRESSEDKEYS,     HUD_PressedKeys,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PRESSEDKEYS
index 9f6c7fb5c4e9dd63322a07ee3be2cc5b73c6df88..07919b6e7d5204f27ced37d2584e8146de43be03 100644 (file)
@@ -13,6 +13,7 @@
 #include <client/hud/panel/powerups.qc>
 #include <client/hud/panel/pressedkeys.qc>
 #include <client/hud/panel/quickmenu.qc>
+#include <client/hud/panel/racesplits.qc>
 #include <client/hud/panel/racetimer.qc>
 #include <client/hud/panel/radar.qc>
 #include <client/hud/panel/score.qc>
index 4f901379e8e46618242acd1aba3a6a614002a24e..6b9b563ad969fdf37f7309368c0a8ad14bcbc463 100644 (file)
@@ -13,6 +13,7 @@
 #include <client/hud/panel/powerups.qh>
 #include <client/hud/panel/pressedkeys.qh>
 #include <client/hud/panel/quickmenu.qh>
+#include <client/hud/panel/racesplits.qh>
 #include <client/hud/panel/racetimer.qh>
 #include <client/hud/panel/radar.qh>
 #include <client/hud/panel/score.qh>
index 5866271ef97c6944f64fd22aaece9099bc765190..2774d64983b31eec4325821072f0014c74ac0831 100644 (file)
@@ -1,6 +1,4 @@
 #include "infomessages.qh"
-#include "racetimer.qh" // for race_checkpoint_splits
-#include <common/gamemodes/gamemode/race/race.qh> // for ISGAMETYPE(RACE)
 
 #include <client/draw.qh>
 #include <common/ent_cs.qh>
@@ -230,37 +228,6 @@ void HUD_InfoMessages()
                                InfoMessage(s);
                        }
                }
-               if(autocvar_cl_race_checkpoint_splits_hud && !spectatee_status) {
-                       int lines[6];
-                       int ln = 5;
-                       // show up to race_nextcheckpoint (not including) or everything
-                       // if you are before start (0 or 254)
-                       // (except race_laptime != 0 for race, means next is
-                       // start+finish so don't show previous lap finish)
-                       int i;
-                       if (race_checkpoint != 0 && race_checkpoint != 254)
-                       { // middle of run/race
-                               i = race_checkpoint;
-                       }
-                       else if (ISGAMETYPE(RACE) && race_nextcheckpoint == 0)
-                       { // before start, but on race, so don't keep old finish visible
-                               i = 253;
-                       }
-                       else
-                       { // before start, not on race (cts), keep old run cps visible
-                               i = 255;
-                       }
-                       for (; ln >= 0 && i >= 0; --i)
-                       {
-                               if (race_checkpoint_splits[i])
-                               {
-                                       lines[ln] = i;
-                                       --ln;
-                               }
-                       }
-                       for (int j = 0; j < 6; ++j)
-                               InfoMessage(race_checkpoint_splits[lines[j]]);
-               }
        }
        else
        {
diff --git a/qcsrc/client/hud/panel/racesplits.qc b/qcsrc/client/hud/panel/racesplits.qc
new file mode 100644 (file)
index 0000000..7a62ae5
--- /dev/null
@@ -0,0 +1,110 @@
+#include "racesplits.qh"
+#include "racetimer.qh" // for race_checkpoint_splits
+#include <common/gamemodes/gamemode/race/race.qh> // for ISGAMETYPE(RACE)
+
+#include <client/draw.qh>
+#include <common/ent_cs.qh>
+
+
+void HUD_RaceSplits_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_racesplits_flip");
+}
+
+vector RaceSplits_drawstring(string s, vector pos, vector sz, float a, vector fontsize)
+{
+       getWrappedLine_remaining = s;
+       float offset = 0;
+       while(getWrappedLine_remaining)
+       {
+               s = getWrappedLine(sz.x - offset, fontsize, stringwidth_colors);
+               if(autocvar_hud_panel_racesplits_flip)
+                       offset = sz.x - stringwidth_colors(s, fontsize) - offset;
+               drawcolorcodedstring(pos + eX * offset, s, fontsize, a, DRAWFLAG_NORMAL);
+               pos.y += fontsize.y;
+               offset = fontsize.x;
+       }
+       pos.y += fontsize.y * 0.25;
+       return pos;
+}
+
+#define RaceSplit(s) MACRO_BEGIN \
+       pos = RaceSplits_drawstring(s, pos, mySize,  panel_fg_alpha, fontsize); \
+MACRO_END
+
+void HUD_RaceSplits()
+{
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_racesplits) return;
+       }
+
+       HUD_Panel_LoadCvars();
+       vector pos, mySize;
+       pos = panel_pos;
+       mySize = panel_size;
+
+       if (autocvar_hud_panel_racesplits_dynamichud)
+               HUD_Scale_Enable();
+       else
+               HUD_Scale_Disable();
+       HUD_Panel_DrawBg();
+       if(panel_bg_padding)
+       {
+               pos += '1 1 0' * panel_bg_padding;
+               mySize -= '2 2 0' * panel_bg_padding;
+       }
+
+       #define HUD_RACESPLITS_MAX_NRLINES 50 // feels like twice more than enough
+       int nrlines = autocvar_hud_panel_racesplits_lines <= HUD_RACESPLITS_MAX_NRLINES ? autocvar_hud_panel_racesplits_lines : HUD_RACESPLITS_MAX_NRLINES;
+       vector fontsize = '0.8 1 0' * (mySize.y / (nrlines+2));
+       string s;
+       if(!autocvar__hud_configure)
+       {
+               if(spectatee_status)
+               {
+               //      RaceSplit(_("Splits not supported while spectating"));
+               }
+
+               if(autocvar_cl_race_checkpoint_splits_hud && !spectatee_status)
+               {
+                       int mlines[HUD_RACESPLITS_MAX_NRLINES];
+                       int ln = nrlines -1;
+                       // show up to race_nextcheckpoint (not including) or everything
+                       // if you are before start (0 or 254)
+                       // (except race_laptime != 0 for race, means next is
+                       // start+finish so don't show previous lap finish)
+                       int i;
+                       if (race_checkpoint != 0 && race_checkpoint != 254)
+                       { // middle of run/race
+                               i = race_checkpoint;
+                       }
+                       else if (ISGAMETYPE(RACE) && race_nextcheckpoint == 0)
+                       { // before start, but on race, so don't keep old finish visible
+                               i = 253;
+                       }
+                       else
+                       { // before start, not on race (cts), keep old run cps visible
+                               i = 255;
+                       }
+                       for (; ln >= 0 && i >= 0; --i)
+                       {
+                               if (race_checkpoint_splits[i])
+                               {
+                                       mlines[ln] = i;
+                                       --ln;
+                               }
+                       }
+                       for (int j = 0; j < nrlines; ++j)
+                               RaceSplit(race_checkpoint_splits[mlines[j]]);
+               }
+       }
+       else
+       {
+               string col[4]; col[0] = "^7"; col[1] = "^1"; col[2] = "^3"; col[3] = "^2";
+               for (int j = 0; j < nrlines; ++j)
+                       // strcat to use same string as racetimer does, ugly but it's just for hud_configure
+                       RaceSplit(sprintf(strcat("%s",_("Intermediate %d"),"..."), col[j%4], j+1));
+       }
+}
diff --git a/qcsrc/client/hud/panel/racesplits.qh b/qcsrc/client/hud/panel/racesplits.qh
new file mode 100644 (file)
index 0000000..6f4f5b8
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma once
+#include "../panel.qh"
+
+bool autocvar_hud_panel_racesplits;
+bool autocvar_hud_panel_racesplits_dynamichud = false;
+bool autocvar_hud_panel_racesplits_flip;
+int autocvar_hud_panel_racesplits_lines;
+
index 4a45c1edb0123b87fa606dbf2d1d916a62df9717..c63e54d75ce19d9edbb71f406dce56a70efb03f2 100644 (file)
@@ -3,6 +3,7 @@
 #include <common/animdecide.qc>
 #include <common/campaign_file.qc>
 #include <common/campaign_setup.qc>
+#include <common/checkextension.qc>
 #include <common/ent_cs.qc>
 #include <common/mapinfo.qc>
 #include <common/net_notice.qc>
index f8461f41e2d2148b4ed5f856cbc8360332ca68f0..b0303432e9a9a42f7bc6a54395dd7ebf7d6b8ba2 100644 (file)
@@ -3,6 +3,7 @@
 #include <common/animdecide.qh>
 #include <common/campaign_file.qh>
 #include <common/campaign_setup.qh>
+#include <common/checkextension.qh>
 #include <common/ent_cs.qh>
 #include <common/mapinfo.qh>
 #include <common/net_notice.qh>
index 96287299d70af00054664583d628a686fef5b549..e9b17130e3b14235fc8b3cfe64d8c3cbbcc1a165 100644 (file)
@@ -35,6 +35,7 @@
 #include <menu/xonotic/dialog_hudpanel_powerups.qc>
 #include <menu/xonotic/dialog_hudpanel_pressedkeys.qc>
 #include <menu/xonotic/dialog_hudpanel_quickmenu.qc>
+#include <menu/xonotic/dialog_hudpanel_racesplits.qc>
 #include <menu/xonotic/dialog_hudpanel_racetimer.qc>
 #include <menu/xonotic/dialog_hudpanel_radar.qc>
 #include <menu/xonotic/dialog_hudpanel_score.qc>
index c8941bbd6eda7b6f7e326303ffcdceb9e56265d2..5d05cc219bc4b1125c4f8c241758dbc8616b6069 100644 (file)
@@ -35,6 +35,7 @@
 #include <menu/xonotic/dialog_hudpanel_powerups.qh>
 #include <menu/xonotic/dialog_hudpanel_pressedkeys.qh>
 #include <menu/xonotic/dialog_hudpanel_quickmenu.qh>
+#include <menu/xonotic/dialog_hudpanel_racesplits.qh>
 #include <menu/xonotic/dialog_hudpanel_racetimer.qh>
 #include <menu/xonotic/dialog_hudpanel_radar.qh>
 #include <menu/xonotic/dialog_hudpanel_score.qh>
diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_racesplits.qc b/qcsrc/menu/xonotic/dialog_hudpanel_racesplits.qc
new file mode 100644 (file)
index 0000000..bbaa192
--- /dev/null
@@ -0,0 +1,25 @@
+#include "dialog_hudpanel_racesplits.qh"
+
+#include "textlabel.qh"
+#include "checkbox.qh"
+#include "slider.qh"
+
+void XonoticHUDRaceSplitsDialog_fill(entity me)
+{
+       entity e;
+       string panelname = "racesplits";
+
+       dialog_hudpanel_main_checkbox(me, panelname);
+
+       dialog_hudpanel_main_settings(me, panelname);
+
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Race Splits:")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_racesplits_flip", _("Flip align")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Splits to keep on screen:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticSlider(1, 50, 1, "hud_panel_racesplits_lines"));
+}
diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_racesplits.qh b/qcsrc/menu/xonotic/dialog_hudpanel_racesplits.qh
new file mode 100644 (file)
index 0000000..99d8378
--- /dev/null
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "rootdialog.qh"
+CLASS(XonoticHUDRaceSplitsDialog, XonoticRootDialog)
+       METHOD(XonoticHUDRaceSplitsDialog, fill, void(entity));
+       ATTRIB(XonoticHUDRaceSplitsDialog, title, string, _("Race Splits Panel"));
+       ATTRIB(XonoticHUDRaceSplitsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT);
+       ATTRIB(XonoticHUDRaceSplitsDialog, intendedWidth, float, 0.4);
+       ATTRIB(XonoticHUDRaceSplitsDialog, rows, float, 15.5);
+       ATTRIB(XonoticHUDRaceSplitsDialog, columns, float, 4);
+       ATTRIB(XonoticHUDRaceSplitsDialog, name, string, "HUDracesplits");
+       ATTRIB(XonoticHUDRaceSplitsDialog, requiresConnection, float, true);
+ENDCLASS(XonoticHUDRaceSplitsDialog)
index 039d3452fd0038762f728159950f26807c1ee9ae..f9ce604154b165303e5b6f043e684b57d6557808 100644 (file)
@@ -15,6 +15,7 @@
 #include "dialog_hudpanel_powerups.qh"
 #include "dialog_hudpanel_pressedkeys.qh"
 #include "dialog_hudpanel_racetimer.qh"
+#include "dialog_hudpanel_racesplits.qh"
 #include "dialog_hudpanel_radar.qh"
 #include "dialog_hudpanel_score.qh"
 #include "dialog_hudpanel_timer.qh"
@@ -135,6 +136,10 @@ void MainWindow_configureMainWindow(entity me)
        i.configureDialog(i);
        me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+       i = NEW(XonoticHUDRaceSplitsDialog);
+       i.configureDialog(i);
+       me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
        i = NEW(XonoticHUDRadarDialog);
        i.configureDialog(i);
        me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);