About This File
Autor: MusicInstructor
Este painél permite dar chatblock/kick a um jogador selecionado.
Como instalar?
Na pasta root, no ficheiro uiTarget.py, adicionar:
import uiChatBlock
No dictionary BUTTON_NAME_LIST, adicionar:
"Kick", "ChatBlock",
Na função __init__, após
self.buttonDict[localeInfo.TARGET_BUTTON_EMOTION_ALLOW].SetUpEvent(True, self.__OnEmotionAllow)
adicionar:
self.buttonDict["Kick"].SetEvent(ui.__mem_func__(self.OnKick)) self.buttonDict["ChatBlock"].SetEvent(ui.__mem_func__(self.OnChatBlock))
dlgChatBlock = uiChatBlock.ChatBlockDialog() dlgChatBlock.LoadDialog() dlgChatBlock.SetTitleName("ChatBlock") dlgChatBlock.Hide() self.dlgChatBlock = dlgChatBlock
Na função Destroy, adicionar:
self.dlgChatBlock.Destroy() self.dlgChatBlock = 0
No fim do ficheiro, adicionar estas novas funções:
def OnKick(self): net.SendChatPacket("/dc " + str(chr.GetNameByVID(self.vid))) def OnChatBlock(self): #if os.path.exists('gm.txt') and os.path.isfile('gm.txt'): if str(player.GetName())[0] == "[": self.dlgChatBlock.SetTitleName("ChatBlock: " + str(chr.GetNameByVID(self.vid))) self.dlgChatBlock.Open(str(chr.GetNameByVID(self.vid)))
Na função RefreshButton, procurar por:
self.ShowDefaultButton()
e adicionar após:
if str(player.GetName())[0] == "[": self.__ShowButton("Kick") self.__ShowButton("ChatBlock")
Após estes passos, basta adicionar o módulo uiChatBlock.py na pasta
e o script chatblockdialog.py na pasta uiscript.
Nota: O código só detecta e faz aparecer os botões se o nome do jogador conter parênteses rectos ("[ ]"), mesmo que seja GM.
What's New in Version 1.0.0 See changelog
Released
No changelog available for this version.