Owsap 201 Posted March 4, 2019 (edited) Correção de código de cor no quadro de avisos e de dicas (notice / big_notice) Antes: Depois: root/constInfo.py Spoiler # Adicione no fim do documento def StripColor(text): import re regex = '\|c([a-zA-Z0-9]){0,8}|' search = re.search(regex, text) if search: text = re.sub(regex, '', text) return text root/uiTip.py Spoiler # Adicione o seguinte import no início do documento import constInfo # Procure: curPos = text.find(" ", prevPos) if curPos < 0: break # Adicione acima: text = constInfo.StripColor(text) # Procure: curTime = app.GetTime() self.tipList.append((curTime, text)) self.__RefreshBoard() # Adicione acima: text = constInfo.StripColor(text) Edited March 4, 2019 by OWSAP (see edit history) 5 1 Hellblazer, 'ŞŦŘƗƗҜ€Ř', NewWars and 3 others reacted to this Share this post Link to post Share on other sites
NewWars 875 Posted March 4, 2019 Nice post. Já agora, porque não usar um event render invés? Assim permite que a cor seja aplicada também na big notice e caso queria mostrar um item ou algo de gênero também funcionaria Cumprimentos. 1 BPinto98 reacted to this Share this post Link to post Share on other sites
'PACI 2,317 Posted March 4, 2019 Porque o módulo grp já oferece essa possibilidade, e a classe TextBar do módulo uiTip é criada a partir daí. Share this post Link to post Share on other sites