slides show the witness
This commit is contained in:
parent
4a823abf32
commit
e393c1d2f1
53
gameview.py
53
gameview.py
@ -187,7 +187,13 @@ class music_download_thread(QtCore.QThread):
|
|||||||
|
|
||||||
request = Request(url, headers=headers)
|
request = Request(url, headers=headers)
|
||||||
request.get_method = lambda: 'HEAD'
|
request.get_method = lambda: 'HEAD'
|
||||||
response = urlopen(request)
|
try:
|
||||||
|
response = urlopen(request, timeout=5)
|
||||||
|
except:
|
||||||
|
print "[audio] There's no response, aborting..."
|
||||||
|
self.quit()
|
||||||
|
return
|
||||||
|
|
||||||
file_length = int(response.headers.get('Content-Length', 0))
|
file_length = int(response.headers.get('Content-Length', 0))
|
||||||
|
|
||||||
if file_length > 0:
|
if file_length > 0:
|
||||||
@ -213,6 +219,10 @@ class music_download_thread(QtCore.QThread):
|
|||||||
if not self.exiting:
|
if not self.exiting:
|
||||||
self.caller.stream = create_string_buffer(stream)
|
self.caller.stream = create_string_buffer(stream)
|
||||||
self.finished_signal.emit(file_length)
|
self.finished_signal.emit(file_length)
|
||||||
|
else:
|
||||||
|
print "[audio] There's no response, aborting..."
|
||||||
|
self.quit()
|
||||||
|
return
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.exiting = True
|
self.exiting = True
|
||||||
@ -326,6 +336,7 @@ class AOCharMovie(QtGui.QLabel):
|
|||||||
self.play_once = True
|
self.play_once = True
|
||||||
self.m_flipped = False
|
self.m_flipped = False
|
||||||
self.scaling = SCALING_AUTO
|
self.scaling = SCALING_AUTO
|
||||||
|
self.show_on_play = True
|
||||||
|
|
||||||
self.m_movie = QtGui.QMovie()
|
self.m_movie = QtGui.QMovie()
|
||||||
|
|
||||||
@ -460,6 +471,7 @@ class AOCharMovie(QtGui.QLabel):
|
|||||||
|
|
||||||
self.set_pillow_frame()
|
self.set_pillow_frame()
|
||||||
|
|
||||||
|
if self.show_on_play:
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
def play_pre(self, p_char, p_emote, duration, scaling = SCALING_AUTO):
|
def play_pre(self, p_char, p_emote, duration, scaling = SCALING_AUTO):
|
||||||
@ -881,6 +893,14 @@ class gui(QtGui.QWidget):
|
|||||||
self.sidechar = AOCharMovie(self.viewport)
|
self.sidechar = AOCharMovie(self.viewport)
|
||||||
self.sidechar.hide()
|
self.sidechar.hide()
|
||||||
|
|
||||||
|
self.slide_last_wit = []
|
||||||
|
self.slide_witness = AOCharMovie(self.viewport)
|
||||||
|
self.slide_witness.show_on_play = False
|
||||||
|
self.slide_witness.hide()
|
||||||
|
self.slide_lawyer = AOCharMovie(self.viewport)
|
||||||
|
self.slide_lawyer.hide()
|
||||||
|
self.slide_lawyer.show_on_play = False
|
||||||
|
|
||||||
self.slide_overlay = QtGui.QLabel(self.viewport)
|
self.slide_overlay = QtGui.QLabel(self.viewport)
|
||||||
self.slide_overlay_animation = QtCore.QPropertyAnimation(self.slide_overlay, "geometry")
|
self.slide_overlay_animation = QtCore.QPropertyAnimation(self.slide_overlay, "geometry")
|
||||||
self.slide_overlay.hide()
|
self.slide_overlay.hide()
|
||||||
@ -2340,6 +2360,9 @@ class gui(QtGui.QWidget):
|
|||||||
|
|
||||||
self.slide_bg.show()
|
self.slide_bg.show()
|
||||||
|
|
||||||
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.play_idle(self.slide_last_wit[0], self.slide_last_wit[1], self.slide_last_wit[2])
|
||||||
|
|
||||||
def_pos = QtCore.QRect(0, 0, self.slide_bg.width(), VIEWPORT_H)
|
def_pos = QtCore.QRect(0, 0, self.slide_bg.width(), VIEWPORT_H)
|
||||||
pro_pos = QtCore.QRect(-def_pos.size().width() + VIEWPORT_W, def_pos.top(), def_pos.size().width(), VIEWPORT_H)
|
pro_pos = QtCore.QRect(-def_pos.size().width() + VIEWPORT_W, def_pos.top(), def_pos.size().width(), VIEWPORT_H)
|
||||||
wit_pos = QtCore.QRect(0, 0, self.slide_bg.width(), VIEWPORT_H)
|
wit_pos = QtCore.QRect(0, 0, self.slide_bg.width(), VIEWPORT_H)
|
||||||
@ -2395,11 +2418,19 @@ class gui(QtGui.QWidget):
|
|||||||
if x > -VIEWPORT_W:
|
if x > -VIEWPORT_W:
|
||||||
self.char.move_slide(x)
|
self.char.move_slide(x)
|
||||||
else:
|
else:
|
||||||
|
self.char.hide()
|
||||||
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.move_slide(x + self.slide_bg.width() / 2 - VIEWPORT_W / 2)
|
||||||
|
self.slide_witness.show()
|
||||||
self.slide_stage = 1
|
self.slide_stage = 1
|
||||||
elif self.slide_stage == 1:
|
elif self.slide_stage == 1:
|
||||||
if x <= -VIEWPORT_W and x >= -self.slide_bg.width() + self.slide_bg.width() / 2:
|
if x <= -VIEWPORT_W and x >= -self.slide_bg.width() + self.slide_bg.width() / 2:
|
||||||
self.char.move_slide(x + self.slide_bg.width() / 2 - VIEWPORT_W / 2)
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.move_slide(x + self.slide_bg.width() / 2 - VIEWPORT_W / 2)
|
||||||
else:
|
else:
|
||||||
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.hide()
|
||||||
|
self.char.show()
|
||||||
self.slide_stage = 2
|
self.slide_stage = 2
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@ -2409,18 +2440,24 @@ class gui(QtGui.QWidget):
|
|||||||
if x < -self.slide_bg.width() + self.slide_bg.width() / 2:
|
if x < -self.slide_bg.width() + self.slide_bg.width() / 2:
|
||||||
self.char.move_slide(x + self.slide_bg.width() - VIEWPORT_W)
|
self.char.move_slide(x + self.slide_bg.width() - VIEWPORT_W)
|
||||||
else:
|
else:
|
||||||
|
self.char.hide()
|
||||||
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.move_slide(x + self.slide_bg.width() / 2 - VIEWPORT_W / 2)
|
||||||
|
self.slide_witness.show()
|
||||||
self.slide_stage = 1
|
self.slide_stage = 1
|
||||||
elif self.slide_stage == 1:
|
elif self.slide_stage == 1:
|
||||||
if x <= -VIEWPORT_W and x >= -self.slide_bg.width() + self.slide_bg.width() / 2:
|
if x <= -VIEWPORT_W and x >= -self.slide_bg.width() + self.slide_bg.width() / 2:
|
||||||
self.char.move_slide(x + self.slide_bg.width() / 2 - VIEWPORT_W / 2)
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.move_slide(x + self.slide_bg.width() / 2 - VIEWPORT_W / 2)
|
||||||
else:
|
else:
|
||||||
|
if self.slide_last_wit:
|
||||||
|
self.slide_witness.hide()
|
||||||
|
self.char.show()
|
||||||
self.slide_stage = 2
|
self.slide_stage = 2
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.char.move_slide(x)
|
self.char.move_slide(x)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def slide_done(self):
|
def slide_done(self):
|
||||||
self.slide_bg.hide()
|
self.slide_bg.hide()
|
||||||
self.slide_overlay.hide()
|
self.slide_overlay.hide()
|
||||||
@ -2503,7 +2540,8 @@ class gui(QtGui.QWidget):
|
|||||||
self.is_additive = (m_chatmessage[ADDITIVE] == "1")
|
self.is_additive = (m_chatmessage[ADDITIVE] == "1")
|
||||||
|
|
||||||
custom_objection = "custom"
|
custom_objection = "custom"
|
||||||
try: objection_mod = int(m_chatmessage[SHOUT_MOD])
|
try:
|
||||||
|
objection_mod = int(m_chatmessage[SHOUT_MOD])
|
||||||
except:
|
except:
|
||||||
if "4&" in m_chatmessage[SHOUT_MOD]: # custom objection name
|
if "4&" in m_chatmessage[SHOUT_MOD]: # custom objection name
|
||||||
objection_mod = 4
|
objection_mod = 4
|
||||||
@ -2765,6 +2803,9 @@ class gui(QtGui.QWidget):
|
|||||||
|
|
||||||
self.scaling[0] = self.get_scaling(ini.read_ini(AOpath + 'characters/' + self.m_chatmessage[CHARNAME] + '/char.ini', "options", "scaling").lower())
|
self.scaling[0] = self.get_scaling(ini.read_ini(AOpath + 'characters/' + self.m_chatmessage[CHARNAME] + '/char.ini', "options", "scaling").lower())
|
||||||
|
|
||||||
|
if side == "wit":
|
||||||
|
self.slide_last_wit = [self.m_chatmessage[CHARNAME], self.m_chatmessage[ANIM], self.scaling[0]]
|
||||||
|
|
||||||
if (emote_mod == 1 or emote_mod == 2 or emote_mod == 6) and self.m_chatmessage[PREANIM] != "-":
|
if (emote_mod == 1 or emote_mod == 2 or emote_mod == 6) and self.m_chatmessage[PREANIM] != "-":
|
||||||
# sfx_delay = int(self.m_chatmessage[SFX_DELAY]) * 60
|
# sfx_delay = int(self.m_chatmessage[SFX_DELAY]) * 60
|
||||||
# if sfx_delay > 0:
|
# if sfx_delay > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user