slides show the witness
This commit is contained in:
parent
4a823abf32
commit
e393c1d2f1
59
gameview.py
59
gameview.py
@ -187,7 +187,13 @@ class music_download_thread(QtCore.QThread):
|
||||
|
||||
request = Request(url, headers=headers)
|
||||
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))
|
||||
|
||||
if file_length > 0:
|
||||
@ -213,6 +219,10 @@ class music_download_thread(QtCore.QThread):
|
||||
if not self.exiting:
|
||||
self.caller.stream = create_string_buffer(stream)
|
||||
self.finished_signal.emit(file_length)
|
||||
else:
|
||||
print "[audio] There's no response, aborting..."
|
||||
self.quit()
|
||||
return
|
||||
|
||||
def stop(self):
|
||||
self.exiting = True
|
||||
@ -326,6 +336,7 @@ class AOCharMovie(QtGui.QLabel):
|
||||
self.play_once = True
|
||||
self.m_flipped = False
|
||||
self.scaling = SCALING_AUTO
|
||||
self.show_on_play = True
|
||||
|
||||
self.m_movie = QtGui.QMovie()
|
||||
|
||||
@ -352,7 +363,7 @@ class AOCharMovie(QtGui.QLabel):
|
||||
def set_flipped(self, flip):
|
||||
self.m_flipped = flip
|
||||
|
||||
def play(self, p_char, p_emote, emote_prefix, scaling = SCALING_AUTO, single_frame_duration=-1):
|
||||
def play(self, p_char, p_emote, emote_prefix, scaling = SCALING_AUTO, single_frame_duration = -1):
|
||||
if p_emote[0] == "/" or p_emote[0] == "/":
|
||||
p_emote = p_emote[1:]
|
||||
elif "../../characters" in p_emote:
|
||||
@ -460,7 +471,8 @@ class AOCharMovie(QtGui.QLabel):
|
||||
|
||||
self.set_pillow_frame()
|
||||
|
||||
self.show()
|
||||
if self.show_on_play:
|
||||
self.show()
|
||||
|
||||
def play_pre(self, p_char, p_emote, duration, scaling = SCALING_AUTO):
|
||||
p_char = p_char.lower()
|
||||
@ -881,6 +893,14 @@ class gui(QtGui.QWidget):
|
||||
self.sidechar = AOCharMovie(self.viewport)
|
||||
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_animation = QtCore.QPropertyAnimation(self.slide_overlay, "geometry")
|
||||
self.slide_overlay.hide()
|
||||
@ -1903,7 +1923,7 @@ class gui(QtGui.QWidget):
|
||||
self.changeEvidence(0, 0)
|
||||
|
||||
def onClick_callMod(self):
|
||||
#self.do_slide()
|
||||
# self.do_slide()
|
||||
|
||||
if "modcall_reason" in self.features:
|
||||
reason, ok = QtGui.QInputDialog.getText(self, "Call a moderator", "Enter your reason.")
|
||||
@ -2340,6 +2360,9 @@ class gui(QtGui.QWidget):
|
||||
|
||||
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)
|
||||
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)
|
||||
@ -2395,11 +2418,19 @@ class gui(QtGui.QWidget):
|
||||
if x > -VIEWPORT_W:
|
||||
self.char.move_slide(x)
|
||||
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
|
||||
elif self.slide_stage == 1:
|
||||
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:
|
||||
if self.slide_last_wit:
|
||||
self.slide_witness.hide()
|
||||
self.char.show()
|
||||
self.slide_stage = 2
|
||||
pass
|
||||
else:
|
||||
@ -2409,18 +2440,24 @@ class gui(QtGui.QWidget):
|
||||
if x < -self.slide_bg.width() + self.slide_bg.width() / 2:
|
||||
self.char.move_slide(x + self.slide_bg.width() - VIEWPORT_W)
|
||||
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
|
||||
elif self.slide_stage == 1:
|
||||
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:
|
||||
if self.slide_last_wit:
|
||||
self.slide_witness.hide()
|
||||
self.char.show()
|
||||
self.slide_stage = 2
|
||||
pass
|
||||
else:
|
||||
self.char.move_slide(x)
|
||||
|
||||
|
||||
|
||||
def slide_done(self):
|
||||
self.slide_bg.hide()
|
||||
self.slide_overlay.hide()
|
||||
@ -2503,7 +2540,8 @@ class gui(QtGui.QWidget):
|
||||
self.is_additive = (m_chatmessage[ADDITIVE] == "1")
|
||||
|
||||
custom_objection = "custom"
|
||||
try: objection_mod = int(m_chatmessage[SHOUT_MOD])
|
||||
try:
|
||||
objection_mod = int(m_chatmessage[SHOUT_MOD])
|
||||
except:
|
||||
if "4&" in m_chatmessage[SHOUT_MOD]: # custom objection name
|
||||
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())
|
||||
|
||||
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] != "-":
|
||||
# sfx_delay = int(self.m_chatmessage[SFX_DELAY]) * 60
|
||||
# if sfx_delay > 0:
|
||||
|
Loading…
Reference in New Issue
Block a user