get blips from ms + reset time on demo playback if longer than demo

This commit is contained in:
cidoku 2025-03-10 18:33:23 -03:00
parent 999da56bd4
commit 9157aee402

View File

@ -3081,10 +3081,11 @@ 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]
if not self.blip:
self.blip = self.m_chatmessage[BLIPS]
if not self.blip:
self.blip = self.charlist[charid][2]
path = test_path(
AOpath+"sounds/blips/"+self.blip+".wav",
AOpath+"sounds/blips/"+self.blip+".opus",
@ -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("<b>Demo playback started.</b>")
@ -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)