better wtce/modcall sound management
This commit is contained in:
parent
8b2a93bdf0
commit
d58268a244
28
gameview.py
28
gameview.py
@ -657,17 +657,7 @@ class gui(QtGui.QWidget):
|
|||||||
self.sfx_delay_timer.setSingleShot(True)
|
self.sfx_delay_timer.setSingleShot(True)
|
||||||
self.sfx_delay_timer.timeout.connect(self.play_sfx)
|
self.sfx_delay_timer.timeout.connect(self.play_sfx)
|
||||||
|
|
||||||
if exists('mod_call.wav'):
|
self.modcall = None
|
||||||
self.modcall = audio.loadhandle(0, "mod_call.wav", 0, 0, 0)
|
|
||||||
else:
|
|
||||||
self.modcall = None
|
|
||||||
|
|
||||||
wtcefile = AOpath+"sounds/general/sfx-testimony2"
|
|
||||||
guiltyfile = AOpath+"sounds/general/sfx-guilty"
|
|
||||||
notguiltyfile = AOpath+"sounds/general/sfx-notguilty.opus"
|
|
||||||
self.wtcesfx = audio.loadhandle(False, wtcefile+".opus" if exists(wtcefile+".opus") else wtcefile+".wav", 0, 0, 0)
|
|
||||||
self.guiltysfx = audio.loadhandle(False, guiltyfile+".opus" if exists(guiltyfile+".opus") else guiltyfile+".wav", 0, 0, 0)
|
|
||||||
self.notguiltysfx = audio.loadhandle(False, notguiltyfile, 0, 0, 0)
|
|
||||||
|
|
||||||
self.healthbars.connect(self.netmsg_hp)
|
self.healthbars.connect(self.netmsg_hp)
|
||||||
self.disconnectnow = False
|
self.disconnectnow = False
|
||||||
@ -2835,7 +2825,10 @@ class TCP_Thread(QtCore.QThread):
|
|||||||
|
|
||||||
elif header == 'ZZ':
|
elif header == 'ZZ':
|
||||||
if self.parent.modcall:
|
if self.parent.modcall:
|
||||||
audio.playhandle(self.parent.modcall, False)
|
audio.freehandle(self.parent.modcall)
|
||||||
|
self.parent.modcall = audio.loadhandle(0, "mod_call.wav", 0, 0, 0)
|
||||||
|
audio.sethandleattr(self.parent.modcall, BASS_ATTRIB_VOL, self.parent.soundslider.value() / 100.0)
|
||||||
|
audio.playhandle(self.parent.modcall, False)
|
||||||
|
|
||||||
if len(network) > 1:
|
if len(network) > 1:
|
||||||
self.OOC_Log.emit('<b>[MOD CALL] ' + network[1].replace("\n", "<br />") + '</b>')
|
self.OOC_Log.emit('<b>[MOD CALL] ' + network[1].replace("\n", "<br />") + '</b>')
|
||||||
@ -2850,15 +2843,20 @@ class TCP_Thread(QtCore.QThread):
|
|||||||
|
|
||||||
elif header == 'RT':
|
elif header == 'RT':
|
||||||
testimony = network[1]
|
testimony = network[1]
|
||||||
|
wtcefile = AOpath+"sounds/general/sfx-testimony2"
|
||||||
|
audio.freehandle(self.parent.wtcesfx)
|
||||||
|
|
||||||
if testimony == 'judgeruling':
|
if testimony == 'judgeruling':
|
||||||
variant = int(network[2])
|
variant = int(network[2])
|
||||||
if variant == 0:
|
if variant == 0:
|
||||||
audio.playhandle(self.parent.notguiltysfx, True)
|
wtcefile = AOpath+"sounds/general/sfx-notguilty"
|
||||||
elif variant == 1:
|
elif variant == 1:
|
||||||
audio.playhandle(self.parent.guiltysfx, True)
|
wtcefile = AOpath+"sounds/general/sfx-guilty"
|
||||||
else:
|
else:
|
||||||
variant = 0
|
variant = 0
|
||||||
audio.playhandle(self.parent.wtcesfx, True)
|
self.parent.wtcesfx = audio.loadhandle(False, wtcefile+".opus" if exists(wtcefile+".opus") else wtcefile+".wav", 0, 0, 0)
|
||||||
|
audio.sethandleattr(self.parent.wtcesfx, BASS_ATTRIB_VOL, self.parent.soundslider.value() / 100.0)
|
||||||
|
audio.playhandle(self.parent.wtcesfx, True)
|
||||||
self.parent.WTCEsignal.emit(testimony, variant)
|
self.parent.WTCEsignal.emit(testimony, variant)
|
||||||
|
|
||||||
elif header == 'HP':
|
elif header == 'HP':
|
||||||
|
Loading…
Reference in New Issue
Block a user