]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'terencehill/hud_cvar_exporter' into 'master'
authorMario <mario.mario@y7mail.com>
Sat, 23 May 2020 13:21:21 +0000 (13:21 +0000)
committerMario <mario.mario@y7mail.com>
Sat, 23 May 2020 13:21:21 +0000 (13:21 +0000)
HUD: allow panels to define in their own files their own saved cvars

Closes #1883

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

26 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/client/mutators/events.qh
qcsrc/common/minigames/cl_minigames_hud.qc
qcsrc/common/mutators/mutator/itemstime/itemstime.qc

index d05b04090018a3432bf9b7821bb7077c31d8e9e3..2c12a6150ee560b528fdabb787029b209c80091f 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(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(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..c4ae095ac3c559c7c3fd67a06084f990f0246e0a 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,170 +72,9 @@ 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(fh);
                        HUD_Write("\n");
                }
-               MUTATOR_CALLHOOK(HUD_WriteCvars, fh);
 
                HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
 
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..5abbbf036bc4e2c9b1dae289c8595f83fec6e7d0 100644 (file)
 
 // Ammo (#1)
 
+void HUD_Ammo_Export(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..2f5aab5ed9f49b021e57db2a9fa0ee73f23a6525 100644 (file)
@@ -6,6 +6,26 @@
 #include <client/miscfunctions.qh>
 
 // CenterPrint (#16)
+
+void HUD_CenterPrint_Export(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..78cc6a0ef9066ae8291d52d3f0ea7f34a49b0c34 100644 (file)
@@ -6,6 +6,11 @@
 
 // Chat (#12)
 
+void HUD_Chat_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 void HUD_Chat()
 {
        if(!autocvar__hud_configure)
index ed7966c16ea1431fe0bfcbdeab2f2386f96897cb..908aa1defe7c68e76df489e0238fbaab3a62bf11 100644 (file)
@@ -5,6 +5,13 @@
 
 // Engine info (#13)
 
+void HUD_EngineInfo_Export(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..b1a9311939e33ea9f368f15baef17a441045331f 100644 (file)
@@ -7,6 +7,21 @@
 
 // Health/armor (#3)
 
+void HUD_HealthArmor_Export(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..363465dfb77ff4723ac42c4a258c9864dae0d9b2 100644 (file)
@@ -8,6 +8,12 @@
 
 // Info messages (#14)
 
+void HUD_InfoMessages_Export(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..0a8b8cf5ed18f8d6815c02a194130fd37b15e5a6 100644 (file)
@@ -9,6 +9,14 @@
 
 // Mod icons (#10)
 
+void HUD_ModIcons_Export(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..bfb23bf2c7e6bf2183bf092d09b55964958226f1 100644 (file)
@@ -5,6 +5,16 @@
 
 // Notifications (#4)
 
+void HUD_Notify_Export(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..a451f924b029d386b86365fa50d2fdb610bbc9a2 100644 (file)
@@ -9,6 +9,26 @@
 
 // Physics (#15)
 
+void HUD_Physics_Export(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..1662415edda0e77e51cbea992f25cbbb54ec96ff 100644 (file)
@@ -7,6 +7,15 @@
 
 // Powerups (#2)
 
+void HUD_Powerups_Export(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..73bd583bcd5b44b85d62c3dc45b6f1457c299346 100644 (file)
@@ -6,6 +6,13 @@
 
 // Pressed keys (#11)
 
+void HUD_PressedKeys_Export(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..66ee555b43910b1472ba1b59555741972c90f176 100644 (file)
 
 // QuickMenu (#23)
 
+void HUD_QuickMenu_Export(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..cd0b26e0bd7af067bd797092e82f045b20b796dc 100644 (file)
@@ -7,6 +7,11 @@
 
 // Race timer (#8)
 
+void HUD_RaceTimer_Export(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..b75b36d33fbd632bda6c81609e76bd2b2fb1cbfe 100644 (file)
 
 // Radar (#6)
 
+void HUD_Radar_Export(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..10aec79ff6939f663dea3139994111e894a21f8c 100644 (file)
 
 // Score (#7)
 
+void HUD_Score_Export(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..962759011a9e3d2b13e9f5e69d228f1e0cb75a6d 100644 (file)
 
 // Scoreboard (#24)
 
+void Scoreboard_Draw_Export(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..8bb4ade6a17f49aca0f69be10c5ffa303069af2f 100644 (file)
@@ -6,6 +6,11 @@
 
 // Timer (#5)
 
+void HUD_Timer_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
 void HUD_Timer()
 {
        if(!autocvar__hud_configure)
index 0337eccfc215cac966713dd4602018548129b935..4aab1b93bb520315148e1574e95ccf1b8d111bf2 100644 (file)
@@ -7,6 +7,12 @@
 
 // Vote (#9)
 
+void HUD_Vote_Export(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..f7444daaa3572cd063eaa62f454430f8ef353db0 100644 (file)
@@ -8,6 +8,35 @@
 
 // Weapons (#0)
 
+void HUD_Weapons_Export(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..c025bdd4651229ed39d182281ca9f4542b31fb59 100644 (file)
@@ -8,6 +8,13 @@
 
 #include <common/mapinfo.qh>
 
+// MapVote (#21)
+
+void MapVote_Draw_Export(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 e9778b795ce2e077cb7cef10023712b616743f74..0629c2a9f0dd17a7897c73f6ff68dc818748c4ac 100644 (file)
@@ -170,12 +170,6 @@ MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS);
        /**/
 MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages);
 
-/** Called when drawing info messages, allows adding new info messages */
-#define EV_HUD_WriteCvars(i, o) \
-       /** file */                     i(float, MUTATOR_ARGV_0_float) \
-       /**/
-MUTATOR_HOOKABLE(HUD_WriteCvars, EV_HUD_WriteCvars);
-
 /** Called when the view model is being animated (setorigin is called after the hook, so you only need to modify origin here if desired) */
 #define EV_DrawViewModel(i, o) \
        /** entity id */                i(entity, MUTATOR_ARGV_0_entity) \
index fd9e3941e1285daafce81122fecfd8763a29b703..0acdb0da59964e20c6900b5ff4532b953fb35652 100644 (file)
 #include <client/hud/hud_config.qh>
 #include <client/mapvoting.qh>
 
+void HUD_MinigameBoard_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameStatus_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameHelp_Export(int fh)
+{
+       // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_MinigameMenu_Export(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..78a5624c31b98bf74829377557fa7af956927944 100644 (file)
@@ -185,6 +185,20 @@ MUTATOR_HOOKFUNCTION(itemstime, PlayerSpawn)
 
 #ifdef CSQC
 
+// ItemsTime (#22)
+
+void HUD_ItemsTime_Export(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;