]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix minigame busy icon
authorMattia Basaglia <mattia.basaglia@gmail.com>
Fri, 6 Feb 2015 12:47:37 +0000 (13:47 +0100)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Fri, 6 Feb 2015 12:47:37 +0000 (13:47 +0100)
models/sprites/minigame_busy.png [deleted file]
models/sprites/minigame_busy.tga [new file with mode: 0644]
qcsrc/server/cl_client.qc

diff --git a/models/sprites/minigame_busy.png b/models/sprites/minigame_busy.png
deleted file mode 100644 (file)
index 30e18b7..0000000
Binary files a/models/sprites/minigame_busy.png and /dev/null differ
diff --git a/models/sprites/minigame_busy.tga b/models/sprites/minigame_busy.tga
new file mode 100644 (file)
index 0000000..c896b2a
Binary files /dev/null and b/models/sprites/minigame_busy.tga differ
index e2d156195b220d489a01f9b36f7599be470c5977..a3598512ed4823372bc68f74c6ae691c4d4b9d38 100644 (file)
@@ -1345,20 +1345,6 @@ void ClientDisconnect (void)
 }
 
 .float BUTTON_CHAT;
-float ChatBubbleCustomize()
-{
-       entity e = WaypointSprite_getviewentity(other), own = self.owner;
-
-       if(!own.deadflag && IS_PLAYER(own))
-       {
-               if(own.BUTTON_CHAT) { self.skin = 0; return true; }
-               if(own.active_minigame) { self.skin = 1; return true; }
-               if(SAME_TEAM(own, e) && e != own) { self.skin = 2; return true; }
-       }
-
-       return false;
-}
-
 void ChatBubbleThink()
 {
        self.nextthink = time;
@@ -1369,6 +1355,20 @@ void ChatBubbleThink()
                remove(self);
                return;
        }
+       
+       self.mdl = "";
+       
+       if ( !self.owner.deadflag && IS_PLAYER(self.owner) )
+       {
+               if ( self.owner.active_minigame )
+                       self.mdl = "models/sprites/minigame_busy.iqm";
+               else if ( self.owner.BUTTON_CHAT )
+                       self.mdl = "models/misc/chatbubble.spr";
+       }
+       
+       if ( self.model != self.mdl )
+               setmodel(self, self.mdl);
+
 }
 
 void UpdateChatBubble()
@@ -1381,13 +1381,11 @@ void UpdateChatBubble()
                self.chatbubbleentity = spawn();
                self.chatbubbleentity.owner = self;
                self.chatbubbleentity.exteriormodeltoclient = self;
-               self.chatbubbleentity.alpha = 1;
-               self.chatbubbleentity.customizeentityforclient = ChatBubbleCustomize;
                self.chatbubbleentity.think = ChatBubbleThink;
                self.chatbubbleentity.nextthink = time;
                setmodel(self.chatbubbleentity, "models/misc/chatbubble.spr"); // precision set below
                //setorigin(self.chatbubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1');
-               setorigin(self.chatbubbleentity, '0 0 15' + self.maxs.z * '0 0 1');
+               setorigin(self.chatbubbleentity, '0 0 15' + self.maxs_z * '0 0 1');
                setattachment(self.chatbubbleentity, self, "");  // sticks to moving player better, also conserves bandwidth
                self.chatbubbleentity.mdl = self.chatbubbleentity.model;
                //self.chatbubbleentity.model = "";