From 503ed0094b3253d765a4d50383e1714be0b85b9b Mon Sep 17 00:00:00 2001 From: cidoku Date: Mon, 27 Oct 2025 02:00:59 -0300 Subject: [PATCH] record shout in logs + default to male blips if not defined in char.ini (controversial) --- gameview.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/gameview.py b/gameview.py index 11d4ac8..30f983c 100644 --- a/gameview.py +++ b/gameview.py @@ -3489,6 +3489,16 @@ class GUI(QtGui.QWidget): # Some characters use " - " instead of "-" for no preanim. mChatMessage[PREANIM] = mChatMessage[PREANIM].strip() + customObjection = "custom" + try: + objectionMod = int(mChatMessage[SHOUT_MOD]) + except: + if "4&" in mChatMessage[SHOUT_MOD]: # custom objection name + objectionMod = 4 + customObjection = mChatMessage[SHOUT_MOD].split("4&")[1] # get the name + else: # just in case of mindfuckery + objectionMod = 0 + # TODO: Make logging format customizable t = time.localtime() logcharName = fChar @@ -3498,16 +3508,24 @@ class GUI(QtGui.QWidget): if fChar.lower() != self.charList[fCharId][0].lower(): logcharName = self.charList[fCharId][0] + ' (' + fChar + ')' - chatmsg = mChatMessage[CHATMSG] + chatmsg = mChatMessage[CHATMSG].strip() if mChatMessage[SHOWNAME] and mChatMessage[SHOWNAME].lower() != fChar.lower(): try: logcharName += " (" + mChatMessage[SHOWNAME]+")" except: logcharName += " (???)" + + if objectionMod == 1: + self.ICLog.append(timestamp + '%s: %s' % (logcharName, "Hold it!")) + elif objectionMod == 2 or objectionMod == 4: + self.ICLog.append(timestamp + '%s: %s' % (logcharName, "Objection!")) + elif objectionMod == 3: + self.ICLog.append(timestamp + '%s: %s' % (logcharName, "Take that!")) if evidence == -1: - self.ICLog.append(timestamp + '%s: %s' % (logcharName, chatmsg.replace("<", "<"))) + if chatmsg: + self.ICLog.append(timestamp + '%s: %s' % (logcharName, chatmsg.replace("<", "<"))) else: eviname = '(NULL) %d' % evidence try: @@ -3518,16 +3536,6 @@ class GUI(QtGui.QWidget): self.ICLog.append(timestamp + '%s: %s\n%s presented an evidence: %s' % (logcharName, chatmsg, fChar, eviname.strip())) self.isAdditive = (mChatMessage[ADDITIVE] == "1") - - customObjection = "custom" - try: - objectionMod = int(mChatMessage[SHOUT_MOD]) - except: - if "4&" in mChatMessage[SHOUT_MOD]: # custom objection name - objectionMod = 4 - customObjection = mChatMessage[SHOUT_MOD].split("4&")[1] # get the name - else: # just in case of mindfuckery - objectionMod = 0 if objectionMod <= 4 and objectionMod >= 1: # Skip everything in the queue, show message immediately @@ -4019,6 +4027,8 @@ class GUI(QtGui.QWidget): if not self.blip: self.blip = self.charList[charid][2].lower() + if not self.blip: + self.blip = "male" path = testPath( AOpath + "sounds/blips/"+ self.blip +".wav", @@ -4639,8 +4649,10 @@ class GUI(QtGui.QWidget): if not exists(AOpath + 'characters/' + char[0].lower() + '/char.ini'): continue char[2] = getCharIni(char[0], "Options", "gender").lower() - if char[2] == "": + if not char[2]: char[2] = getCharIni(char[0], "Options", "blips").lower() + if not char[2]: + char[2] = "male" self.btnRealization.setPressed(False) self.btnCustomObjection.setPressed(False)