improve rainbow text and add black text

This commit is contained in:
cidoku 2025-02-19 14:43:33 -03:00
parent 638631c0a8
commit 68969f8e1a
3 changed files with 65 additions and 18 deletions

View File

@ -1,10 +1,9 @@
self.gamewindow.setFixedSize(820, 730)
self.text.setGeometry(16, 32, VIEWPORT_W - 32, 112)
self.text.setStyleSheet('background-color: rgba(0, 0, 0, 0); color: white;')
self.ao2text.setGeometry(16, 32, VIEWPORT_W - 32, 112)
self.ao2text.setStyleSheet("background-color: rgba(0, 0, 0, 0); color: white;")
self.text.setGeometry(16, 32, VIEWPORT_W - 32, 112)
self.text.setStyleSheet("background-color: rgba(0, 0, 0, 0); color: white;")
self.name.setStyleSheet('color: white')
self.name.move(16, -1)

26
bass_test.py Normal file
View File

@ -0,0 +1,26 @@
import __builtin__
import audio as AUDIO
__builtin__.audio = AUDIO
del AUDIO
from pybass_constants import *
from urllib2 import Request, urlopen
audio.init()
url = 'one_last_dance.mid'
music = audio.loadMIDI(False, url, 0, 0, BASS_SAMPLE_LOOP)
print "Trying to play", url
if music:
audio.sethandleattr(music, BASS_ATTRIB_VOL, 1.0)
audio.playhandle(music, False)
else:
print "Couldn't play music. Error", audio.getbasserror()
print "Error?", audio.getbasserror()
while 1:
pass

View File

@ -62,7 +62,8 @@ C_YELLOW = 5
C_PINK = 6
C_CYAN = 7
C_GRAY = 8
C_RAINBOW = 9 # proprietary
C_RAINBOW = 9
C_BLACK = 10
DOWNLOAD_BLACKLIST = []
@ -1182,7 +1183,7 @@ class gui(QtGui.QWidget):
self.sidechar.move(self.sidechar.xx, self.sidechar.yy, True)
self.chatbox.move(0, VIEWPORT_H-self.chatboxheight)
self.ao2text.move(16, 32)
self.text.move(16,-1)
self.text.move(16,32)
self.screenshake.stop()
def onAdditiveCheck(self):
@ -2166,6 +2167,8 @@ class gui(QtGui.QWidget):
color = QtGui.QColor(0, 255, 255)
elif textcolor == 8:
color = QtGui.QColor(200, 200, 200)
elif textcolor == 10:
color = QtGui.QColor(0, 0, 0)
else:
color = QtGui.QColor(255, 255, 255)
@ -2598,7 +2601,9 @@ class gui(QtGui.QWidget):
elif f_character == "(" and not self.next_character_is_not_special: #blue.
self.inline_color_stack.append(INLINE_BLUE)
self.ao2text.insertHtml("<font color=\"" + get_text_color(4).name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color(4).name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
self.inline_blue_depth += 1
if not self.entire_message_is_blue and self.anim_state != 4:
@ -2609,7 +2614,9 @@ class gui(QtGui.QWidget):
elif f_character == ")" and not self.next_character_is_not_special and self.inline_color_stack:
if self.inline_color_stack[-1] == INLINE_BLUE:
del self.inline_color_stack[-1]
self.ao2text.insertHtml("<font color=\"" + get_text_color(4).name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color(4).name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
if self.inline_blue_depth > 0:
self.inline_blue_depth -= 1
@ -2625,12 +2632,16 @@ class gui(QtGui.QWidget):
elif f_character == "[" and not self.next_character_is_not_special: #gray.
self.inline_color_stack.append(INLINE_GRAY)
self.ao2text.insertHtml("<font color=\"" + get_text_color("_inline_grey").name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color("_inline_grey").name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
elif f_character == "]" and not self.next_character_is_not_special and self.inline_color_stack:
if self.inline_color_stack[-1] == INLINE_GRAY:
del self.inline_color_stack[-1]
self.ao2text.insertHtml("<font color=\"" + get_text_color("_inline_grey").name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color("_inline_grey").name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
else:
self.next_character_is_not_special = True
self.tick_pos -= 1
@ -2664,7 +2675,7 @@ class gui(QtGui.QWidget):
self.next_character_is_not_special = False
elif f_character == "n" and self.next_character_is_not_special: # newline
self.text.setText(self.text.text() + "\n")
self.text.insertPlainText("\n")
self.ao2text.insertPlainText("\n")
self.next_character_is_not_special = False
@ -2673,16 +2684,27 @@ class gui(QtGui.QWidget):
if self.inline_color_stack:
top_color = self.inline_color_stack[-1]
if top_color == INLINE_ORANGE:
self.ao2text.insertHtml("<font color=\"" + get_text_color(C_ORANGE).name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color(C_ORANGE).name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
elif top_color == INLINE_BLUE:
self.ao2text.insertHtml("<font color=\"" + get_text_color(C_BLUE).name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color(C_BLUE).name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
elif top_color == INLINE_GREEN:
self.ao2text.insertHtml("<font color=\"" + get_text_color(C_GREEN).name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color(C_GREEN).name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
elif top_color == INLINE_GRAY:
self.ao2text.insertHtml("<font color=\"" + get_text_color("_inline_grey").name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color("_inline_grey").name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
elif top_color == INLINE_RED:
self.ao2text.insertHtml("<font color=\"" + get_text_color(C_RED).name() + "\">" + f_character + "</font>")
html = "<font color=\"" + get_text_color(C_RED).name() + "\">" + f_character + "</font>"
self.ao2text.insertHtml(html)
self.text.insertHtml(html)
else:
self.text.insertHtml(f_character)
self.ao2text.insertHtml(f_character)
else:
if int(self.m_chatmessage[TEXT_COLOR]) == C_RAINBOW:
@ -2899,9 +2921,9 @@ class gui(QtGui.QWidget):
self.ypairoffset_l.setVisible("y_offset" in features)
self.colordropdown.clear()
self.colordropdown.addItems(['white', 'green', 'red', 'orange', 'blue'])
self.colordropdown.addItems(['White', 'Green', 'Red', 'Orange', 'Blue'])
if "yellowtext" in features:
self.colordropdown.addItems(['yellow', 'pink', 'cyan', 'gray', 'rainbow'])
self.colordropdown.addItems(['Yellow', 'Pink', 'Cyan', 'Gray', 'Rainbow', 'Black'])
self.colordropdown.setCurrentIndex(self.mychatcolor)
for hp in hplist: