From b927606b353008c40cb80ec0b3bb9737f23c9ad8 Mon Sep 17 00:00:00 2001 From: cidoku Date: Fri, 14 Feb 2025 17:46:12 -0300 Subject: [PATCH] removed rainbow text and fixed cyan/pink/gray text --- gameview.py | 59 +++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/gameview.py b/gameview.py index 0bce91f..047148e 100644 --- a/gameview.py +++ b/gameview.py @@ -58,9 +58,9 @@ C_RED = 2 C_ORANGE = 3 C_BLUE = 4 C_YELLOW = 5 -C_RAINBOW = 6 -C_PINK = 7 -C_CYAN = 8 +C_PINK = 6 +C_CYAN = 7 +C_GRAY = 8 DOWNLOAD_BLACKLIST = [] @@ -1890,7 +1890,7 @@ class gui(QtGui.QWidget): def set_text_color(self): textcolor = int(self.m_chatmessage[TEXT_COLOR]) - is_rainbow = textcolor == 6 + #is_rainbow = textcolor == 6 if textcolor == 0: color = QtGui.QColor(255, 255, 255) @@ -1905,18 +1905,18 @@ class gui(QtGui.QWidget): elif textcolor == 5: color = QtGui.QColor(255, 255, 0) elif textcolor == 6: - color = QtGui.QColor(255, 255, 255) - elif textcolor == 7: color = QtGui.QColor(255, 192, 203) - elif textcolor == 8: + elif textcolor == 7: color = QtGui.QColor(0, 255, 255) + elif textcolor == 8: + color = QtGui.QColor(200, 200, 200) - if is_rainbow: - self.text.show() - self.ao2text.hide() - else: - self.text.hide() - self.ao2text.show() + # if is_rainbow: + # self.text.show() + # self.ao2text.hide() + # else: + self.text.hide() + self.ao2text.show() style = "background-color: rgba(0, 0, 0, 0);\n" style += "color: rgb("+str(color.red())+", "+str(color.green())+", "+str(color.blue())+")" @@ -2425,10 +2425,10 @@ class gui(QtGui.QWidget): else: self.ao2text.insertHtml(f_character) else: - if int(self.m_chatmessage[TEXT_COLOR]) == C_RAINBOW: - self.text.setText(self.text.text() + f_character) - else: - self.ao2text.insertHtml(f_character) + # if int(self.m_chatmessage[TEXT_COLOR]) == C_RAINBOW: + # self.text.setText(self.text.text() + f_character) + # else: + self.ao2text.insertHtml(f_character) if self.message_is_centered: self.ao2text.setAlignment(QtCore.Qt.AlignCenter) @@ -2627,7 +2627,7 @@ class gui(QtGui.QWidget): self.colordropdown.clear() self.colordropdown.addItems(['white', 'green', 'red', 'orange', 'blue']) if "yellowtext" in features: - self.colordropdown.addItems(['yellow', 'rainbow', 'pink', 'cyan']) + self.colordropdown.addItems(['yellow', 'pink', 'cyan', 'gray']) self.colordropdown.setCurrentIndex(self.mychatcolor) for hp in hplist: @@ -2694,7 +2694,7 @@ class gui(QtGui.QWidget): self.tcpthread.showCharSelect.connect(self.charselect.show) self.tcpthread.allEvidence.connect(self.allEvidence) self.tcpthread.updatePlayerList.connect(self.updatePlayerList) - self.tcpthread.rainbowColor.connect(self.text.setStyleSheet) + #self.tcpthread.rainbowColor.connect(self.text.setStyleSheet) self.tcpthread.start() def allEvidence(self, evi): @@ -2963,7 +2963,7 @@ class TCP_Thread(QtCore.QThread): charSlots = QtCore.pyqtSignal() showCharSelect = QtCore.pyqtSignal() allEvidence = QtCore.pyqtSignal(list) - rainbowColor = QtCore.pyqtSignal(str) + #rainbowColor = QtCore.pyqtSignal(str) updatePlayerList = QtCore.pyqtSignal(str, int, int, str) def __init__(self, parent): @@ -2972,11 +2972,12 @@ class TCP_Thread(QtCore.QThread): def run(self): pingtimer = 150 - rainbow = 0 + #rainbow = 0 sendtick = 0 tempdata = "" color = QtGui.QColor() - color.setHsv(rainbow, 255, 255) + #color.setHsv(rainbow, 255, 255) + color.setHsv(0, 255, 255) while True: if self.parent.disconnectnow: self.parent.selectedplayer = -1 @@ -2991,13 +2992,13 @@ class TCP_Thread(QtCore.QThread): self.parent.tcp.send('CH#%') pingtimer = 150 - if self.parent.m_chatmessage[TEXT_COLOR] == "6": - color.setHsv(rainbow, 255, 255) - rainbow += 5 - if rainbow > 255: - rainbow = 0 - #self.parent.text.setStyleSheet('color: rgb(' + str(color.red()) + ', ' + str(color.green()) + ', ' + str(color.blue()) + ')') - self.rainbowColor.emit('color: rgb(' + str(color.red()) + ', ' + str(color.green()) + ', ' + str(color.blue()) + ')') + # if self.parent.m_chatmessage[TEXT_COLOR] == "6": + # color.setHsv(rainbow, 255, 255) + # rainbow += 5 + # if rainbow > 255: + # rainbow = 0 + # #self.parent.text.setStyleSheet('color: rgb(' + str(color.red()) + ', ' + str(color.green()) + ', ' + str(color.blue()) + ')') + # self.rainbowColor.emit('color: rgb(' + str(color.red()) + ', ' + str(color.green()) + ', ' + str(color.blue()) + ')') if sendtick: sendtick -= 1