respect deskmod in char.ini
This commit is contained in:
parent
62deeba0b5
commit
ec2ddcfbf0
36
gameview.py
36
gameview.py
@ -1532,11 +1532,14 @@ class gui(QtGui.QWidget):
|
||||
sound = ini.read_ini(AOpath + 'characters/' + charname + '/char.ini', "soundn", str(emoteind), '1')
|
||||
soundt = ini.read_ini(AOpath + 'characters/' + charname + '/char.ini', "soundt", str(emoteind), '0')
|
||||
soundl = ini.read_ini(AOpath + 'characters/' + charname + '/char.ini', "soundl", str(emoteind), '0') # AO 2.8
|
||||
|
||||
emotelist = emote.split('#')
|
||||
del emotelist[len(emotelist) - 1]
|
||||
deskmod = emotelist.pop(len(emotelist) - 1)
|
||||
|
||||
emotelist.append(sound)
|
||||
emotelist.append(soundt)
|
||||
emotelist.append(soundl) # AO 2.8
|
||||
emotelist.append(deskmod)
|
||||
self.charemotes.append(emotelist)
|
||||
if emotelist[0]:
|
||||
self.emotedropdown.addItem(emotelist[0])
|
||||
@ -2011,6 +2014,7 @@ class gui(QtGui.QWidget):
|
||||
text = "".join(l)
|
||||
|
||||
emote = self.charemotes[self.selectedemote]
|
||||
|
||||
if self.nointerruptbtn.isChecked():
|
||||
modifier = 0
|
||||
else:
|
||||
@ -2044,8 +2048,12 @@ class gui(QtGui.QWidget):
|
||||
|
||||
msg = "MS#"
|
||||
|
||||
if "deskmod" in self.features: # visible desk modifier
|
||||
msg += "%d#" % self.deskbtn.isChecked()
|
||||
# Visible desk modifier: respect char.ini if emotion has deskmod
|
||||
if "deskmod" in self.features:
|
||||
if emote[7]:
|
||||
msg += "%s#" % emote[7]
|
||||
else:
|
||||
msg += "%d#" % self.deskbtn.isChecked()
|
||||
else:
|
||||
msg += "chat#"
|
||||
|
||||
@ -2162,6 +2170,7 @@ class gui(QtGui.QWidget):
|
||||
else:
|
||||
setattr(self, bgfile[0], QtGui.QPixmap.fromImage(bgimg))
|
||||
self.set_scene(True)
|
||||
self.set_desk()
|
||||
self.chatbox.hide()
|
||||
self.char.hide()
|
||||
|
||||
@ -2358,11 +2367,25 @@ class gui(QtGui.QWidget):
|
||||
self.bench.setPixmap(self.bench_jud if self.bench_jur.isNull() else self.bench_jur)
|
||||
self.presentedevi.move(16, 16)
|
||||
|
||||
def set_desk(self, is_preanim=False):
|
||||
deskmod = self.m_chatmessage[DESK_MOD]
|
||||
if deskmod == "0" or (deskmod != "1" and (side in ("jud", "hld", "hlp"))):
|
||||
|
||||
if deskmod == "0" or (deskmod == "chat" and side in ("jud", "hld", "hlp")):
|
||||
self.bench.hide()
|
||||
else:
|
||||
elif deskmod == "1" or (deskmod == "chat" and side in ("def", "pro", "wit")):
|
||||
self.bench.show()
|
||||
elif deskmod == "2" or deskmod == "4":
|
||||
if is_preanim:
|
||||
self.bench.hide()
|
||||
else:
|
||||
self.bench.show()
|
||||
elif deskmod == "3" or deskmod == "5":
|
||||
if is_preanim:
|
||||
self.bench.show()
|
||||
else:
|
||||
self.bench.hide()
|
||||
else:
|
||||
self.bench.hide()
|
||||
|
||||
def objection_done(self):
|
||||
self.handle_chatmessage_2()
|
||||
@ -2498,6 +2521,7 @@ class gui(QtGui.QWidget):
|
||||
# self.sfx_delay_timer.start(sfx_delay)
|
||||
# else:
|
||||
# self.play_sfx()
|
||||
self.set_desk(True)
|
||||
self.play_preanim(False)
|
||||
elif emote_mod == 0 or emote_mod == 5 or self.m_chatmessage[PREANIM] == "-":
|
||||
if self.m_chatmessage[NO_INTERRUPT] == "0" or self.m_chatmessage[PREANIM] == "-":
|
||||
@ -2561,6 +2585,7 @@ class gui(QtGui.QWidget):
|
||||
|
||||
def handle_chatmessage_3(self):
|
||||
self.start_chat_ticking()
|
||||
self.set_desk(False)
|
||||
|
||||
f_evi_id = int(self.m_chatmessage[EVIDENCE])
|
||||
f_side = self.m_chatmessage[SIDE]
|
||||
@ -3151,6 +3176,7 @@ class gui(QtGui.QWidget):
|
||||
|
||||
self.setBackground(background.lower())
|
||||
self.set_scene(True)
|
||||
self.set_desk()
|
||||
self.chatbox.hide()
|
||||
|
||||
for msg in oocjoin:
|
||||
|
Loading…
Reference in New Issue
Block a user