From 9157aee4023453c441ab1c730302ef8101dcf51c Mon Sep 17 00:00:00 2001 From: cidoku Date: Mon, 10 Mar 2025 18:33:23 -0300 Subject: [PATCH] get blips from ms + reset time on demo playback if longer than demo --- gameview.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gameview.py b/gameview.py index 7b7a2f9..93b8b59 100644 --- a/gameview.py +++ b/gameview.py @@ -2542,7 +2542,7 @@ class gui(QtGui.QWidget): m_chatmessage[n_string] = p_contents[n_string] else: m_chatmessage[n_string] = "" - + f_char_id = int(m_chatmessage[CHAR_ID]) if f_char_id < 0 or f_char_id >= len(self.charlist): @@ -3081,9 +3081,10 @@ class gui(QtGui.QWidget): self.current_display_speed = 3 self.chat_tick_timer.start(self.message_display_speed[self.current_display_speed]) - self.blip = self.charlist[charid][2] + self.blip = self.m_chatmessage[BLIPS] + if not self.blip: - self.blip = self.m_chatmessage[BLIPS] + self.blip = self.charlist[charid][2] path = test_path( AOpath+"sounds/blips/"+self.blip+".wav", @@ -3836,6 +3837,8 @@ class DemoPlayer(QtCore.QObject): self.last_bg = "" def start(self, file): + self.wait_timer.stop() + self.time = 0 self.demo_length_ms = 0 self.demo = [] @@ -3844,6 +3847,8 @@ class DemoPlayer(QtCore.QObject): self.last_music = "" self.last_bg = "" self.load_demo(file) + print "[client] Started demo playback (%s commands)" % self.demo_length + self.parent.demoslider.setMaximum(self.demo_length - 1) self.OOC_Log.emit("Demo playback started.") @@ -3861,6 +3866,9 @@ class DemoPlayer(QtCore.QObject): self.step() def step(self, skip_wait=False): + if self.time >= self.demo_length: + self.time = 0 + packet = self.demo[self.time] self.parent.demoslider.blockSignals(True) self.parent.demoslider.setValue(self.time)