support character shownames

This commit is contained in:
cidoku 2025-02-17 19:23:18 -03:00
parent b3aaf8816d
commit e287391acc

View File

@ -1091,6 +1091,7 @@ class gui(QtGui.QWidget):
self.charemotes = []
self.selectedemote = 0
self.charname = ''
self.charshowname = ''
self.charside = 'def'
self.lastmsg = ''
self.msgqueue = []
@ -1359,6 +1360,9 @@ class gui(QtGui.QWidget):
charname = unicode(charname.toLower())
self.charname = ini.read_ini(AOpath + 'characters/' + charname + '/char.ini', "options", "name", charname).decode('utf-8').lower()
self.charshowname = ini.read_ini(AOpath + 'characters/' + charname + '/char.ini', "options", "showname")
if not self.charshowname == "":
self.charshowname = self.charshowname.decode('utf-8')
self.charside = ini.read_ini(AOpath + 'characters/' + charname + '/char.ini', "options", "side", "def")
self.posdropdown.setCurrentIndex(self.posdropdown.findText(self.charside))
@ -1623,7 +1627,10 @@ class gui(QtGui.QWidget):
text = mockStr(text)
if self.autocaps.isChecked():
l = list(text)
l[0] = l[0].upper()
if isinstance(l[0], QtCore.QString):
l[0] = l[0].toUpper()
else:
l[0] = l[0].upper()
if l[-1] != ".":
l.append(".")
text = "".join(l).replace(" i ", " I ").replace("i'm", "I'm").replace("it's", "It's")
@ -1714,7 +1721,10 @@ class gui(QtGui.QWidget):
msg += str(self.mychatcolor)+"#"
if "cccc_ic_support" in self.features:
msg += self.showname+"#" # custom showname
showname = self.showname
if self.showname == "" and not self.charshowname == "":
showname = self.charshowname
msg += showname+"#" # custom showname
if self.paircheckbox.isChecked():
msg += str(self.pairdropdown.currentIndex()) # pair charID
if "effects" in self.features: