]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/itemstime/itemstime.qc
HUD: allow panels to define in their own files their own saved cvars
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / itemstime / itemstime.qc
index 8d2bb318f0f2443f1200545a675f23b1d31d433c..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;
@@ -194,12 +208,7 @@ void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon,
     if (autocvar_hud_panel_itemstime_hidespawned == 2)
         picalpha = 1;
     else if (item_available)
-    {
-        float BLINK_FACTOR = 0.15;
-        float BLINK_BASE = 0.85;
-        float BLINK_FREQ = 5;
-        picalpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
-    }
+        picalpha = blink(0.85, 0.15, 5);
     else
         picalpha = 0.5;
     t = floor(item_time - time + 0.999);