]> Skullheadx's Git Forge - Pygame-Jam.git/commitdiff
Fix
authorlbcmk <30442978+lbcmk@users.noreply.github.com>
Wed, 13 Jul 2022 20:53:40 +0000 (16:53 -0400)
committerlbcmk <30442978+lbcmk@users.noreply.github.com>
Wed, 13 Jul 2022 20:53:40 +0000 (16:53 -0400)
UI/Dialogue.py

index b277f3e8a9897866d49c12b33792cd67837fd55a..158146661ce82ad0c4d5c9b561319316109e5d9e 100644 (file)
@@ -27,25 +27,23 @@ class DialogueUI:
         return;
 
     def draw(self, surf, agent, text, sec, ID, Xt=-10000, Yt=-10000):
-
+        
         if(not ID in self.IDS):
             temp = []
-            c = []
             self.PSA += sec
             temp.append(text)
             temp.append(self.PSA)
-            c.append(Xt)
-            c.append(Yt)
-            temp.append(c)
+            temp.append(agent)
+            temp.append(Xt == -10000 and Yt == -10000)
             self.IDS.append(ID)
-            self.dialogue_list.append(temp)
+            self.dialogue_list.append(temp)                
 
         try:
             X, Y = 0, 0
             try:
-                if(self.dialogue_list[self.char][2][0] == -10000 and self.dialogue_list[self.char][2][1] == -10000):
-                    X = get_display_point(agent.position)[0] + agent.width / 2
-                    Y = get_display_point(agent.position)[1]
+                if(self.dialogue_list[self.char][3] == True):
+                    X = get_display_point(self.dialogue_list[self.char][2].position)[0] + agent.width / 2
+                    Y = get_display_point(self.dialogue_list[self.char][2].position)[1]
                 else:
                     X, Y = get_display_point((self.dialogue_list[self.char][2][0], self.dialogue_list[self.char][2][1]))
 
@@ -61,6 +59,7 @@ class DialogueUI:
                     self.text = self.dialogue_list[self.char][0]
             except:
                 pass;
+
             self.checkTime()
             self.createDialogue()