From 4c24e465f7a9f587fed4a40e6d2829c5edb13b5a Mon Sep 17 00:00:00 2001 From: cidoku Date: Mon, 11 Aug 2025 02:53:43 -0400 Subject: [PATCH] another effect hack --- gameview.py | 16 ++++++++++------ ini.py | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gameview.py b/gameview.py index dbdc66c..2326181 100644 --- a/gameview.py +++ b/gameview.py @@ -2518,7 +2518,7 @@ class GUI(QtGui.QWidget): msg += emote[2]+"#" #anim msg += text+"#" msg += self.charside+"#" - msg += emote[4]+"#" #sfx + msg += (ini.get_effect_sound(self.effectdropdown.currentText(), self.charname) if self.effectdropdown.currentIndex() > 0 else emote[4])+"#" #sfx msg += str(modifier)+"#" #emote modifier msg += str(self.mychar)+"#" #character ID msg += emote[5]+"#" #sfx delay @@ -2784,6 +2784,9 @@ class GUI(QtGui.QWidget): m_chatmessage[n_string] = p_contents[n_string] else: m_chatmessage[n_string] = "" + + # For debugging + # print m_chatmessage f_char_id = int(m_chatmessage[CHAR_ID]) @@ -3172,6 +3175,11 @@ class GUI(QtGui.QWidget): text_delay = ini.read_ini_int(AOpath+"characters/"+f_char+"/char.ini", "textdelay", f_preanim, -1) sfx_delay = int(self.m_chatmessage[SFX_DELAY]) * 60 + if sfx_delay > 0: + self.sfx_delay_timer.start(sfx_delay) + else: + self.play_sfx() + preanim_duration = ao2_duration anim_to_find = AOpath+"characters/"+f_char+"/"+f_preanim+".gif" @@ -3184,6 +3192,7 @@ class GUI(QtGui.QWidget): else: self.anim_state = 1 self.preanim_done() + return self.char.play_pre(f_char, f_preanim, preanim_duration, self.scaling[0]) if noninterrupting: @@ -3191,11 +3200,6 @@ class GUI(QtGui.QWidget): else: self.anim_state = 1 - if sfx_delay > 0: - self.sfx_delay_timer.start(sfx_delay) - else: - self.play_sfx() - if text_delay >= 0: pass #text delay timer, but not now. diff --git a/ini.py b/ini.py index 03cd522..2b4ee0d 100644 --- a/ini.py +++ b/ini.py @@ -116,9 +116,9 @@ def get_effect_sound(fx_name, char): inifile = ConfigParser() inifile.read(p_path) for section in inifile.sections(): - if fx_name == read_ini(inifile, section, "name", "").rstrip(): - return read_ini(inifile, section, "sound", "").rstrip() - return read_sectionless_ini(default_path, fx_name) + if fx_name == read_ini(inifile, section, "name", "").strip(): + return read_ini(inifile, section, "sound", "").strip() + return read_sectionless_ini(default_path, fx_name).strip() def get_effects(char): p_effect = read_ini("base/characters/"+char+"/char.ini", "options", "effects", "default/effects")