]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
HUD: allow panels to define in their own files their own saved cvars
authorterencehill <piuntn@gmail.com>
Thu, 21 May 2020 20:46:43 +0000 (22:46 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 21 May 2020 20:46:43 +0000 (22:46 +0200)
25 files changed:
qcsrc/client/hud/hud.qh
qcsrc/client/hud/hud_config.qc
qcsrc/client/hud/hud_config.qh
qcsrc/client/hud/panel/ammo.qc
qcsrc/client/hud/panel/centerprint.qc
qcsrc/client/hud/panel/chat.qc
qcsrc/client/hud/panel/engineinfo.qc
qcsrc/client/hud/panel/healtharmor.qc
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/hud/panel/notify.qc
qcsrc/client/hud/panel/physics.qc
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/pressedkeys.qc
qcsrc/client/hud/panel/quickmenu.qc
qcsrc/client/hud/panel/racetimer.qc
qcsrc/client/hud/panel/radar.qc
qcsrc/client/hud/panel/score.qc
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/timer.qc
qcsrc/client/hud/panel/vote.qc
qcsrc/client/hud/panel/weapons.qc
qcsrc/client/mapvoting.qc
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/mutators/mutator/itemstime/itemstime.qc

index d05b04090018a3432bf9b7821bb7077c31d8e9e3..58f46b8af98c164ac71147b93caab8708dc48ecc 100644 (file)
@@ -14,16 +14,21 @@ REGISTRY(hud_panels, BITS(6))
 #define hud_panels_from(i) _hud_panels_from(i, NULL)
 REGISTER_REGISTRY(hud_panels)
 
-#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \
+#define _REGISTER_HUD_PANEL(id, draw_func, export_func, configflags, showflags) \
        void draw_func(); \
+       void export_func(entity panel, int fh); \
        REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \
                this.panel_id = this.m_id; \
                this.panel_draw = draw_func; \
+               this.panel_export = export_func; \
                this.panel_name = strzone(strtolower(#id)); \
                this.panel_configflags = configflags; \
                this.panel_showflags = showflags; \
        }
 
+#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \
+       _REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, configflags, showflags)
+
 #define HUD_PANEL(NAME) HUD_PANEL_##NAME
 
 // draw the background/borders
@@ -149,6 +154,7 @@ float panel_bg_padding;
 string panel_bg_padding_str;
 
 classfield(HUDPanel) .void() panel_draw;
+classfield(HUDPanel) .void(entity panel, int fh) panel_export;
 
 // chat panel can be reduced / moved while the mapvote is active
 // let know the mapvote panel about chat pos and size
index e23647fb3fb6dd919047b77e9695d386f7d98f6b..6858a84b2194e3f67c364b43d526f8cd24ace911 100644 (file)
@@ -7,9 +7,6 @@
 #include <client/miscfunctions.qh>
 #include <client/view.qh>
 
-#define HUD_Write(s) fputs(fh, s)
-#define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
-#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
 // Save the config
 void HUD_Panel_ExportCfg(string cfgname)
 {
@@ -75,167 +72,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                        HUD_Write_PanelCvar("_bg_alpha");
                        HUD_Write_PanelCvar("_bg_border");
                        HUD_Write_PanelCvar("_bg_padding");
-                       switch(panel) {
-                               case HUD_PANEL_WEAPONS:
-                                       HUD_Write_Cvar("hud_panel_weapons_accuracy");
-                                       HUD_Write_Cvar("hud_panel_weapons_label");
-                                       HUD_Write_Cvar("hud_panel_weapons_label_scale");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_padding");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_time");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_fadetime");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_outofammo");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_donthave");
-                                       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_unavailable");
-                                       HUD_Write_Cvar("hud_panel_weapons_ammo");
-                                       HUD_Write_Cvar("hud_panel_weapons_ammo_color");
-                                       HUD_Write_Cvar("hud_panel_weapons_ammo_alpha");
-                                       HUD_Write_Cvar("hud_panel_weapons_aspect");
-                                       HUD_Write_Cvar("hud_panel_weapons_timeout");
-                                       HUD_Write_Cvar("hud_panel_weapons_timeout_effect");
-                                       HUD_Write_Cvar("hud_panel_weapons_timeout_fadebgmin");
-                                       HUD_Write_Cvar("hud_panel_weapons_timeout_fadefgmin");
-                                       HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in");
-                                       HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out");
-                                       HUD_Write_Cvar("hud_panel_weapons_onlyowned");
-                                       HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha");
-                                       HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale");
-                                       HUD_Write_Cvar("hud_panel_weapons_selection_radius");
-                                       HUD_Write_Cvar("hud_panel_weapons_selection_speed");
-                                       break;
-                               case HUD_PANEL_AMMO:
-                                       HUD_Write_Cvar("hud_panel_ammo_onlycurrent");
-                                       HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha");
-                                       HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale");
-                                       HUD_Write_Cvar("hud_panel_ammo_iconalign");
-                                       HUD_Write_Cvar("hud_panel_ammo_progressbar");
-                                       HUD_Write_Cvar("hud_panel_ammo_progressbar_name");
-                                       HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset");
-                                       HUD_Write_Cvar("hud_panel_ammo_text");
-                                       break;
-                               case HUD_PANEL_POWERUPS:
-                                       HUD_Write_Cvar("hud_panel_powerups_iconalign");
-                                       HUD_Write_Cvar("hud_panel_powerups_baralign");
-                                       HUD_Write_Cvar("hud_panel_powerups_progressbar");
-                                       HUD_Write_Cvar("hud_panel_powerups_text");
-                                       break;
-                               case HUD_PANEL_HEALTHARMOR:
-                                       HUD_Write_Cvar("hud_panel_healtharmor_combined");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_flip");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_iconalign");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_baralign");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_health");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_armor");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx_smooth");
-                                       HUD_Write_Cvar("hud_panel_healtharmor_text");
-                                       break;
-                               case HUD_PANEL_NOTIFY:
-                                       HUD_Write_Cvar("hud_panel_notify_flip");
-                                       HUD_Write_Cvar("hud_panel_notify_fontsize");
-                                       HUD_Write_Cvar("hud_panel_notify_time");
-                                       HUD_Write_Cvar("hud_panel_notify_fadetime");
-                                       HUD_Write_Cvar("hud_panel_notify_icon_aspect");
-                                       break;
-                               case HUD_PANEL_TIMER:
-                                       break;
-                               case HUD_PANEL_RADAR:
-                                       HUD_Write_Cvar("hud_panel_radar_foreground_alpha");
-                                       HUD_Write_Cvar("hud_panel_radar_rotation");
-                                       HUD_Write_Cvar("hud_panel_radar_zoommode");
-                                       HUD_Write_Cvar("hud_panel_radar_scale");
-                                       HUD_Write_Cvar("hud_panel_radar_maximized_scale");
-                                       HUD_Write_Cvar("hud_panel_radar_maximized_size");
-                                       HUD_Write_Cvar("hud_panel_radar_maximized_rotation");
-                                       HUD_Write_Cvar("hud_panel_radar_maximized_zoommode");
-                                       break;
-                               case HUD_PANEL_SCORE:
-                                       HUD_Write_Cvar("hud_panel_score_rankings");
-                                       break;
-                               case HUD_PANEL_VOTE:
-                                       HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha");
-                                       break;
-                               case HUD_PANEL_MODICONS:
-                                       HUD_Write_Cvar("hud_panel_modicons_ca_layout");
-                                       HUD_Write_Cvar("hud_panel_modicons_dom_layout");
-                                       HUD_Write_Cvar("hud_panel_modicons_freezetag_layout");
-                                       break;
-                               case HUD_PANEL_PRESSEDKEYS:
-                                       HUD_Write_Cvar("hud_panel_pressedkeys_aspect");
-                                       HUD_Write_Cvar("hud_panel_pressedkeys_attack");
-                                       break;
-                               case HUD_PANEL_ENGINEINFO:
-                                       HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time");
-                                       HUD_Write_Cvar("hud_panel_engineinfo_framecounter_decimals");
-                                       break;
-                               case HUD_PANEL_INFOMESSAGES:
-                                       HUD_Write_Cvar("hud_panel_infomessages_flip");
-                                       break;
-                               case HUD_PANEL_PHYSICS:
-                                       HUD_Write_Cvar("hud_panel_physics_speed_unit_show");
-                                       HUD_Write_Cvar("hud_panel_physics_speed_max");
-                                       HUD_Write_Cvar("hud_panel_physics_speed_vertical");
-                                       HUD_Write_Cvar("hud_panel_physics_topspeed");
-                                       HUD_Write_Cvar("hud_panel_physics_topspeed_time");
-                                       HUD_Write_Cvar("hud_panel_physics_acceleration_max");
-                                       HUD_Write_Cvar("hud_panel_physics_acceleration_vertical");
-                                       HUD_Write_Cvar("hud_panel_physics_flip");
-                                       HUD_Write_Cvar("hud_panel_physics_baralign");
-                                       HUD_Write_Cvar("hud_panel_physics_progressbar");
-                                       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode");
-                                       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale");
-                                       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear");
-                                       HUD_Write_Cvar("hud_panel_physics_text");
-                                       HUD_Write_Cvar("hud_panel_physics_text_scale");
-                                       break;
-                               case HUD_PANEL_CENTERPRINT:
-                                       HUD_Write_Cvar("hud_panel_centerprint_align");
-                                       HUD_Write_Cvar("hud_panel_centerprint_flip");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fontscale");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fontscale_bold");
-                                       HUD_Write_Cvar("hud_panel_centerprint_time");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_in");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_out");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone_minalpha");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo_minalpha");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_minfontsize");
-                                       HUD_Write_Cvar("hud_panel_centerprint_fade_minfontsize");
-                                       break;
-                               case HUD_PANEL_ITEMSTIME:
-                                       HUD_Write_Cvar("hud_panel_itemstime_iconalign");
-                                       HUD_Write_Cvar("hud_panel_itemstime_progressbar");
-                                       HUD_Write_Cvar("hud_panel_itemstime_progressbar_name");
-                                       HUD_Write_Cvar("hud_panel_itemstime_progressbar_reduced");
-                                       HUD_Write_Cvar("hud_panel_itemstime_text");
-                                       HUD_Write_Cvar("hud_panel_itemstime_ratio");
-                                       HUD_Write_Cvar("hud_panel_itemstime_dynamicsize");
-                                       break;
-                               case HUD_PANEL_MAPVOTE:
-                                       HUD_Write_Cvar("hud_panel_mapvote_highlight_border");
-                                       break;
-                               case HUD_PANEL_QUICKMENU:
-                                       HUD_Write_Cvar("hud_panel_quickmenu_align");
-                                       break;
-                               case HUD_PANEL_SCOREBOARD:
-                                       HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_fadeoutspeed");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_respawntime_decimals");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_bg_alpha");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_bg_scale");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha_self");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha_self");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows");
-                                       HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors");
-                                       break;
-                       }
+                       panel.panel_export(panel, fh);
                        HUD_Write("\n");
                }
                MUTATOR_CALLHOOK(HUD_WriteCvars, fh);
index d91fe370e1d997cd213e661dfeb69adb63ab6312..f3f3d8b009da75d4b0e2839548557ce73a205b96 100644 (file)
@@ -27,3 +27,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary);
 void HUD_Panel_EnableMenu();
 
 void HUD_Panel_FirstInDrawQ(float id);
+
+#define HUD_Write(s) fputs(fh, s)
+#define HUD_Write_Cvar(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
+#define HUD_Write_PanelCvar(cvar_suf) str = strcat("hud_panel_", panel.panel_name, cvar_suf), HUD_Write_Cvar(str)
index 95ceced82c74d7ca6a39adc2084de9e950c85a2c..fbe1aa5ce24cf303022cd44d354632b2ef2d74c9 100644 (file)
 
 // Ammo (#1)
 
+void HUD_Ammo_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_ammo_onlycurrent");
+       HUD_Write_Cvar("hud_panel_ammo_noncurrent_alpha");
+       HUD_Write_Cvar("hud_panel_ammo_noncurrent_scale");
+       HUD_Write_Cvar("hud_panel_ammo_iconalign");
+       HUD_Write_Cvar("hud_panel_ammo_progressbar");
+       HUD_Write_Cvar("hud_panel_ammo_progressbar_name");
+       HUD_Write_Cvar("hud_panel_ammo_progressbar_xoffset");
+       HUD_Write_Cvar("hud_panel_ammo_text");
+}
+
 void DrawNadeProgressBar(vector myPos, vector mySize, float progress, vector color)
 {
        HUD_Panel_DrawProgressBar(
index 446a64ec65649c7266c890f56fdc803f366dec72..1b2f3fe04466178cda9164bd50ebfb388727c11f 100644 (file)
@@ -6,6 +6,26 @@
 #include <client/miscfunctions.qh>
 
 // CenterPrint (#16)
+
+void HUD_CenterPrint_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_centerprint_align");
+       HUD_Write_Cvar("hud_panel_centerprint_flip");
+       HUD_Write_Cvar("hud_panel_centerprint_fontscale");
+       HUD_Write_Cvar("hud_panel_centerprint_fontscale_bold");
+       HUD_Write_Cvar("hud_panel_centerprint_time");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_in");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_out");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passone_minalpha");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_passtwo_minalpha");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_subsequent_minfontsize");
+       HUD_Write_Cvar("hud_panel_centerprint_fade_minfontsize");
+}
+
 // These are the functions that draw the text at the center of the screen (e.g. frag messages and server MOTDs).
 // Usually local_notification_centerprint_generic() is called, which in turn calls centerprint_generic(), which
 // uses some kind of macro magic to call HUD_CenterPrint, which draws them on screen using drawcolorcodedstring().
index 5f309d0b0224bd4c019f9f4d51b29a9f851368a9..7b405d5bb10c097fdb3cab9c396d938e492e8476 100644 (file)
@@ -6,6 +6,11 @@
 
 // Chat (#12)
 
+void HUD_Chat_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 void HUD_Chat()
 {
        if(!autocvar__hud_configure)
index ed7966c16ea1431fe0bfcbdeab2f2386f96897cb..db376a2ce859b389541b763cbcfc1177d448e9fa 100644 (file)
@@ -5,6 +5,13 @@
 
 // Engine info (#13)
 
+void HUD_EngineInfo_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_engineinfo_framecounter_time");
+       HUD_Write_Cvar("hud_panel_engineinfo_framecounter_decimals");
+}
+
 float prevfps;
 float prevfps_time;
 int framecounter;
index 1a61a96d3d1c90bad00b39a7f0fa79ddf9a181c8..d63b3d97bc2e3970071ce7ca6891c94489fdb0bc 100644 (file)
@@ -7,6 +7,21 @@
 
 // Health/armor (#3)
 
+void HUD_HealthArmor_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_healtharmor_combined");
+       HUD_Write_Cvar("hud_panel_healtharmor_flip");
+       HUD_Write_Cvar("hud_panel_healtharmor_iconalign");
+       HUD_Write_Cvar("hud_panel_healtharmor_baralign");
+       HUD_Write_Cvar("hud_panel_healtharmor_progressbar");
+       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_health");
+       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_armor");
+       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx");
+       HUD_Write_Cvar("hud_panel_healtharmor_progressbar_gfx_smooth");
+       HUD_Write_Cvar("hud_panel_healtharmor_text");
+}
+
 void HUD_HealthArmor()
 {
        int armor, health, fuel, air_time;
index 131d62efe921129071db68a515723bf45cf0c69f..803491f843ffda1ef73900ff6bf7b643ce0bd7be 100644 (file)
@@ -8,6 +8,12 @@
 
 // Info messages (#14)
 
+void HUD_InfoMessages_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_infomessages_flip");
+}
+
 float autocvar_hud_panel_infomessages_group0 = 1;
 float autocvar_hud_panel_infomessages_group_fadetime = 0.4;
 float autocvar_hud_panel_infomessages_group_time = 6;
index 18ec37d47e78f8df34789593c97cc8c4864d21dc..b206609b3fe435f676beed1b9af0c74ba7add3a1 100644 (file)
@@ -9,6 +9,14 @@
 
 // Mod icons (#10)
 
+void HUD_ModIcons_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_modicons_ca_layout");
+       HUD_Write_Cvar("hud_panel_modicons_dom_layout");
+       HUD_Write_Cvar("hud_panel_modicons_freezetag_layout");
+}
+
 void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
 {
        TC(int, layout); TC(int, i);
index 82690bee73a3d494a84a69762f7749f75806ce49..b562fdb61c0a7abd79734337481369881ffe898f 100644 (file)
@@ -5,6 +5,16 @@
 
 // Notifications (#4)
 
+void HUD_Notify_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_notify_flip");
+       HUD_Write_Cvar("hud_panel_notify_fontsize");
+       HUD_Write_Cvar("hud_panel_notify_time");
+       HUD_Write_Cvar("hud_panel_notify_fadetime");
+       HUD_Write_Cvar("hud_panel_notify_icon_aspect");
+}
+
 void HUD_Notify_Push(string icon, string attacker, string victim)
 {
        if (icon == "")
index aa77690a6a4a23ee36aa39548511289239ab8ad1..e2be0de0059ed821ff92ec72d9c87794afb97e03 100644 (file)
@@ -9,6 +9,26 @@
 
 // Physics (#15)
 
+void HUD_Physics_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_physics_speed_unit_show");
+       HUD_Write_Cvar("hud_panel_physics_speed_max");
+       HUD_Write_Cvar("hud_panel_physics_speed_vertical");
+       HUD_Write_Cvar("hud_panel_physics_topspeed");
+       HUD_Write_Cvar("hud_panel_physics_topspeed_time");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_max");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_vertical");
+       HUD_Write_Cvar("hud_panel_physics_flip");
+       HUD_Write_Cvar("hud_panel_physics_baralign");
+       HUD_Write_Cvar("hud_panel_physics_progressbar");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_mode");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_scale");
+       HUD_Write_Cvar("hud_panel_physics_acceleration_progressbar_nonlinear");
+       HUD_Write_Cvar("hud_panel_physics_text");
+       HUD_Write_Cvar("hud_panel_physics_text_scale");
+}
+
 vector acc_prevspeed;
 float acc_prevtime, acc_avg, top_speed, top_speed_time;
 float physics_update_time, discrete_speed, discrete_acceleration;
index 49b7a97018c0071d4170e06fe43e8bd274d7d905..d68a60f3182ff8676ce43d224dd9206c275e20e4 100644 (file)
@@ -7,6 +7,15 @@
 
 // Powerups (#2)
 
+void HUD_Powerups_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_powerups_iconalign");
+       HUD_Write_Cvar("hud_panel_powerups_baralign");
+       HUD_Write_Cvar("hud_panel_powerups_progressbar");
+       HUD_Write_Cvar("hud_panel_powerups_text");
+}
+
 // Powerup item fields (reusing existing fields)
 .string message;  // Human readable name
 .string netname;  // Icon name
index 3c87a1c1d58ebd259491f3988d6d6a92b5d0386d..ed9ab7ded66446bbc847fcb23d01c97c37184324 100644 (file)
@@ -6,6 +6,13 @@
 
 // Pressed keys (#11)
 
+void HUD_PressedKeys_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_pressedkeys_aspect");
+       HUD_Write_Cvar("hud_panel_pressedkeys_attack");
+}
+
 void HUD_PressedKeys()
 {
        if(!autocvar__hud_configure)
index a0bd8727a99d271004951553a1d1653f0213cd91..de7489ca80693af470c7111782b5813b1442b58e 100644 (file)
 
 // QuickMenu (#23)
 
+void HUD_QuickMenu_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_quickmenu_align");
+}
+
 // QUICKMENU_MAXLINES must be <= 10
 const int QUICKMENU_MAXLINES = 10;
 // visible entries are loaded from QuickMenu_Buffer into QuickMenu_Page_* arrays
index ecf8f9f33851ecb3fa8659c76448b134e0f90f8d..326d776539f1117baba1f0a4a5984d1dd909a72e 100644 (file)
@@ -7,6 +7,11 @@
 
 // Race timer (#8)
 
+void HUD_RaceTimer_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 // return the string of the onscreen race timer
 string MakeRaceString(int cp, float mytime, float theirtime, float othertime, float lapdelta, string theirname)
 {
index 612dc12e98ada6183ca03d1ed8712f63f8ae0aaa..0737156952c80cb7316d3c6c19bdebb5a0acc9dd 100644 (file)
 
 // Radar (#6)
 
+void HUD_Radar_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_radar_foreground_alpha");
+       HUD_Write_Cvar("hud_panel_radar_rotation");
+       HUD_Write_Cvar("hud_panel_radar_zoommode");
+       HUD_Write_Cvar("hud_panel_radar_scale");
+       HUD_Write_Cvar("hud_panel_radar_maximized_scale");
+       HUD_Write_Cvar("hud_panel_radar_maximized_size");
+       HUD_Write_Cvar("hud_panel_radar_maximized_rotation");
+       HUD_Write_Cvar("hud_panel_radar_maximized_zoommode");
+}
+
 bool HUD_Radar_Clickable()
 {
        return hud_panel_radar_mouse && !hud_panel_radar_temp_hidden;
index 525bf614b8be11e0cd01c075ec857b61c2937090..a4820d74c12554be59ff3bec59faf23916ce92f8 100644 (file)
 
 // Score (#7)
 
+void HUD_Score_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_score_rankings");
+}
+
 void HUD_Score_Rankings(vector pos, vector mySize, entity me)
 {
        float score;
index 08a1a73bb0977148aa8174f48ef67d836aad4ded..5ab3688f37de10010b95e3d3706d791fd4bd5490 100644 (file)
 
 // Scoreboard (#24)
 
+void Scoreboard_Draw_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_scoreboard_fadeinspeed");
+       HUD_Write_Cvar("hud_panel_scoreboard_fadeoutspeed");
+       HUD_Write_Cvar("hud_panel_scoreboard_respawntime_decimals");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_bg_alpha");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_bg_scale");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_fg_alpha_self");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha");
+       HUD_Write_Cvar("hud_panel_scoreboard_table_highlight_alpha_self");
+       HUD_Write_Cvar("hud_panel_scoreboard_bg_teams_color_team");
+       HUD_Write_Cvar("hud_panel_scoreboard_accuracy_doublerows");
+       HUD_Write_Cvar("hud_panel_scoreboard_accuracy_nocolors");
+}
+
 const int MAX_SBT_FIELDS = MAX_SCORE;
 
 PlayerScoreField sbt_field[MAX_SBT_FIELDS + 1];
index e01aa751757e3087b25038cdac422e6b162c4049..3cb587c0baefd0b22ca4a9a156eee617bdcfbb10 100644 (file)
@@ -6,6 +6,11 @@
 
 // Timer (#5)
 
+void HUD_Timer_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 void HUD_Timer()
 {
        if(!autocvar__hud_configure)
index 0337eccfc215cac966713dd4602018548129b935..0dd509163f881ae89613886ef85779af500a0355 100644 (file)
@@ -7,6 +7,12 @@
 
 // Vote (#9)
 
+void HUD_Vote_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_vote_alreadyvoted_alpha");
+}
+
 void HUD_Vote()
 {
        if(autocvar_cl_allow_uid2name == -1 && (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (serverflags & SERVERFLAG_PLAYERSTATS)))
index 8668886a91282da36356f92d9577a8fdfffa9601..4f452e04b8e83ec6be2ed58f8768342f0c231671 100644 (file)
@@ -8,6 +8,35 @@
 
 // Weapons (#0)
 
+void HUD_Weapons_Export(entity panel, int fh)
+{
+       HUD_Write_Cvar("hud_panel_weapons_accuracy");
+       HUD_Write_Cvar("hud_panel_weapons_label");
+       HUD_Write_Cvar("hud_panel_weapons_label_scale");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble_padding");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble_time");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble_fadetime");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_outofammo");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_donthave");
+       HUD_Write_Cvar("hud_panel_weapons_complainbubble_color_unavailable");
+       HUD_Write_Cvar("hud_panel_weapons_ammo");
+       HUD_Write_Cvar("hud_panel_weapons_ammo_color");
+       HUD_Write_Cvar("hud_panel_weapons_ammo_alpha");
+       HUD_Write_Cvar("hud_panel_weapons_aspect");
+       HUD_Write_Cvar("hud_panel_weapons_timeout");
+       HUD_Write_Cvar("hud_panel_weapons_timeout_effect");
+       HUD_Write_Cvar("hud_panel_weapons_timeout_fadebgmin");
+       HUD_Write_Cvar("hud_panel_weapons_timeout_fadefgmin");
+       HUD_Write_Cvar("hud_panel_weapons_timeout_speed_in");
+       HUD_Write_Cvar("hud_panel_weapons_timeout_speed_out");
+       HUD_Write_Cvar("hud_panel_weapons_onlyowned");
+       HUD_Write_Cvar("hud_panel_weapons_noncurrent_alpha");
+       HUD_Write_Cvar("hud_panel_weapons_noncurrent_scale");
+       HUD_Write_Cvar("hud_panel_weapons_selection_radius");
+       HUD_Write_Cvar("hud_panel_weapons_selection_speed");
+}
+
 entity weaponorder[Weapons_MAX];
 void weaponorder_swap(int i, int j, entity pass)
 {
index d0bab24b56d2d1918da0a132275efdd143e348bf..c206e773f823a6297d796600982465cf140730d0 100644 (file)
@@ -8,6 +8,13 @@
 
 #include <common/mapinfo.qh>
 
+// MapVote (#21)
+
+void MapVote_Draw_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_mapvote_highlight_border");
+}
 
 int mv_num_maps;
 
index fd9e3941e1285daafce81122fecfd8763a29b703..a1d9a257788081c40182c099c6de9d1ca64233c1 100644 (file)
 #include <client/hud/hud_config.qh>
 #include <client/mapvoting.qh>
 
+void HUD_MinigameBoard_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameStatus_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameHelp_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameMenu_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 // whether the mouse is over the given panel
 bool HUD_mouse_over(entity somepanel)
 {
index 5add006c3d2c6bc7082ff8f7cc59294652f9dcef..5ee7faae8494022623fd047dbdcf7f773ae7875c 100644 (file)
@@ -185,6 +185,20 @@ MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn)
 
 #ifdef CSQC
 
+// ItemsTime (#22)
+
+void HUD_ItemsTime_Export(entity panel, int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+       HUD_Write_Cvar("hud_panel_itemstime_iconalign");
+       HUD_Write_Cvar("hud_panel_itemstime_progressbar");
+       HUD_Write_Cvar("hud_panel_itemstime_progressbar_name");
+       HUD_Write_Cvar("hud_panel_itemstime_progressbar_reduced");
+       HUD_Write_Cvar("hud_panel_itemstime_text");
+       HUD_Write_Cvar("hud_panel_itemstime_ratio");
+       HUD_Write_Cvar("hud_panel_itemstime_dynamicsize");
+}
+
 void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon, float item_time, bool item_available, float item_availableTime)
 {
     float t = 0;