another effect hack

This commit is contained in:
cidoku 2025-08-11 02:53:43 -04:00
parent 8c1b29473c
commit 4c24e465f7
2 changed files with 13 additions and 9 deletions

View File

@ -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
@ -2785,6 +2785,9 @@ class GUI(QtGui.QWidget):
else:
m_chatmessage[n_string] = ""
# For debugging
# print m_chatmessage
f_char_id = int(m_chatmessage[CHAR_ID])
if f_char_id < 0 or f_char_id >= len(self.charlist):
@ -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.

6
ini.py
View File

@ -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")