]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Registrize modicons_reset
authorMario <mario@smbclan.net>
Sun, 14 Aug 2016 08:27:02 +0000 (18:27 +1000)
committerMario <mario@smbclan.net>
Sun, 14 Aug 2016 08:27:02 +0000 (18:27 +1000)
qcsrc/client/hud/hud.qc
qcsrc/common/mapinfo.qh

index c5a3f795058e2bb087d084ed527d5ad020de9286..a0417f326fa1f5ae093f439ac8b6db2912de9640 100644 (file)
@@ -383,8 +383,8 @@ void HUD_Panel_Draw(entity panent)
 void HUD_Reset()
 {
        // reset gametype specific icons
-       if(gametype == MAPINFO_TYPE_CTF)
-               HUD_Mod_CTF_Reset();
+       if(gametype.m_modicons_reset)
+               gametype.m_modicons_reset();
 }
 
 float autocvar_hud_dynamic_shake = 1;
index 28e0cfe237800b209fca58b63ef268b4bad076ef..d84d86cad607026dc4004cee70063adc345f7d25 100644 (file)
@@ -42,6 +42,7 @@ CLASS(Gametype, Object)
     ATTRIB(Gametype, gametype_description, string);
 #ifdef CSQC
     ATTRIB(Gametype, m_modicons, void(vector pos, vector mySize));
+    ATTRIB(Gametype, m_modicons_reset, void());
 #endif
 
     ATTRIB(Gametype, m_mutators, string);
@@ -205,6 +206,7 @@ REGISTER_GAMETYPE(TEAM_DEATHMATCH, NEW(TeamDeathmatch));
 
 #ifdef CSQC
 void HUD_Mod_CTF(vector pos, vector mySize);
+void HUD_Mod_CTF_Reset();
 #endif
 CLASS(CaptureTheFlag, Gametype)
     INIT(CaptureTheFlag)
@@ -222,6 +224,7 @@ CLASS(CaptureTheFlag, Gametype)
     }
 #ifdef CSQC
     ATTRIB(CaptureTheFlag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CTF);
+    ATTRIB(CaptureTheFlag, m_modicons_reset, void(), HUD_Mod_CTF_Reset);
 #endif
 ENDCLASS(CaptureTheFlag)
 REGISTER_GAMETYPE(CTF, NEW(CaptureTheFlag));