From: lbcmk <30442978+lbcmk@users.noreply.github.com> Date: Wed, 13 Jul 2022 00:02:09 +0000 (-0400) Subject: Fix X-Git-Url: http://git.skullheadx.com/life/index.html?a=commitdiff_plain;h=30a41acfd241687f643a31cbccd291c5f6ed15bc;p=Pygame-Jam.git Fix --- diff --git a/UI/Dialogue.py b/UI/Dialogue.py index b65f424..0a0a7a6 100644 --- a/UI/Dialogue.py +++ b/UI/Dialogue.py @@ -42,20 +42,25 @@ class DialogueUI: try: X, Y = 0, 0 - 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] - else: - X, Y = get_display_point((self.dialogue_list[self.char][2][0], self.dialogue_list[self.char][2][1])) - - # print(get_display_point((X, Y))) - print(get_camera_offset()[0] + SCREEN_WIDTH/2, get_camera_offset()[1] + SCREEN_HEIGHT/2) - - if(ID == 0): - self.text = text - X, Y = get_display_point((Xt, Yt)) - else: - self.text = self.dialogue_list[self.char][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] + else: + X, Y = get_display_point((self.dialogue_list[self.char][2][0], self.dialogue_list[self.char][2][1])) + + # print(get_display_point((X, Y))) + print(get_camera_offset()[0] + SCREEN_WIDTH/2, get_camera_offset()[1] + SCREEN_HEIGHT/2) + except: + pass; + try: + if(ID == 0): + self.text = text + X, Y = get_display_point((Xt, Yt)) + else: + self.text = self.dialogue_list[self.char][0] + except: + pass; self.checkTime() self.createDialogue() @@ -96,9 +101,12 @@ class DialogueUI: return; def checkTime(self): - if(datetime.utcnow() - self.lastTextTime >= timedelta(seconds=self.dialogue_list[self.char][1])): - if(self.char +1 < len(self.dialogue_list)): - self.char = self.char + 1 - else: - self.char = 0 - self.dialogue_list = [] \ No newline at end of file + try: + if(datetime.utcnow() - self.lastTextTime >= timedelta(seconds=self.dialogue_list[self.char][1])): + if(self.char +1 < len(self.dialogue_list)): + self.char = self.char + 1 + else: + self.char = 0 + self.dialogue_list = [] + except: + pass; \ No newline at end of file