Marcos Posted December 6, 2018 at 09:31 PM Share Posted December 6, 2018 at 09:31 PM Boa noite, gostaria de saber se alguém tem ou sabe um cliente q tenha o sistema de colocar múltiplos pontos em status e skills. Obrigado e boa noite... Link to comment
oserra Posted December 6, 2018 at 10:35 PM Share Posted December 6, 2018 at 10:35 PM uicharacter.py: Spoiler Substituir função por: def __OnClickStatusPlusButton(self, statusKey): try: statusPlusPoint=player.GetStatus(player.STAT) if statusPlusPoint > 4: self.ChooseCountPlusStat(statusKey) else: statusPlusCommand=self.statusPlusCommandDict[statusKey] net.SendChatPacket(statusPlusCommand) except KeyError, msg: dbg.TraceError("CharacterWindow.__OnClickStatusPlusButton KeyError: %s", msg) Adicionar: def ChooseCountPlusStat(self, statusKey): inputDialog = uiCommon.InputDialog() inputDialog.SetTitle(localeInfo.STATUS_BOX) inputDialog.SetMaxLength(2) inputDialog.SetNumberMode() inputDialog.SetFocus() inputDialog.SetAcceptEvent(lambda arg1=statusKey: self.ChooseCountPlusStatConfirm(arg1)) inputDialog.SetCancelEvent(self.ChooseCountPlusStatHide) inputDialog.Open() self.inputDialog = inputDialog def ChooseCountPlusStatHide(self): self.inputDialog.Hide() def ChooseCountPlusStatConfirm(self, statusKey): self.ChooseCountPlusStatHide() statusPlusCommand=self.statusPlusCommandDict[statusKey] try: count = int(self.inputDialog.GetText()) if count <= 0: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.STATUS_BOX_PLUS) return if count > 30: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.STATUS_BOX_INFO) return if count > 1: for i in xrange(count): net.SendChatPacket(statusPlusCommand) else: net.SendChatPacket(statusPlusCommand) except ValueError: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.STATUS_BOX_PLUS) locale_game.txt: Spoiler STATUS_BOX Adiciona pontos nos status. STATUS_BOX_INFO Aumenta no máximo 30 pontos para não haver problemas com o teu personagem. STATUS_BOX_PLUS Apenas números positivos. Limite estabelecido para nº de pontos por uso é 30 para não dar problemas com crashes, pode ser alterado. Só está para stats, reproduzir o mesmo processo para skills. Link to comment
Marcos Posted December 7, 2018 at 11:42 AM Author Share Posted December 7, 2018 at 11:42 AM (edited) 13 horas atrás, oserra disse: uicharacter.py: Ocultar conteúdo Substituir função por: def __OnClickStatusPlusButton(self, statusKey): try: statusPlusPoint=player.GetStatus(player.STAT) if statusPlusPoint > 4: self.ChooseCountPlusStat(statusKey) else: statusPlusCommand=self.statusPlusCommandDict[statusKey] net.SendChatPacket(statusPlusCommand) except KeyError, msg: dbg.TraceError("CharacterWindow.__OnClickStatusPlusButton KeyError: %s", msg) Adicionar: def ChooseCountPlusStat(self, statusKey): inputDialog = uiCommon.InputDialog() inputDialog.SetTitle(localeInfo.STATUS_BOX) inputDialog.SetMaxLength(2) inputDialog.SetNumberMode() inputDialog.SetFocus() inputDialog.SetAcceptEvent(lambda arg1=statusKey: self.ChooseCountPlusStatConfirm(arg1)) inputDialog.SetCancelEvent(self.ChooseCountPlusStatHide) inputDialog.Open() self.inputDialog = inputDialog def ChooseCountPlusStatHide(self): self.inputDialog.Hide() def ChooseCountPlusStatConfirm(self, statusKey): self.ChooseCountPlusStatHide() statusPlusCommand=self.statusPlusCommandDict[statusKey] try: count = int(self.inputDialog.GetText()) if count <= 0: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.STATUS_BOX_PLUS) return if count > 30: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.STATUS_BOX_INFO) return if count > 1: for i in xrange(count): net.SendChatPacket(statusPlusCommand) else: net.SendChatPacket(statusPlusCommand) except ValueError: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.STATUS_BOX_PLUS) locale_game.txt: Ocultar conteúdo STATUS_BOX Adiciona pontos nos status. STATUS_BOX_INFO Aumenta no máximo 30 pontos para não haver problemas com o teu personagem. STATUS_BOX_PLUS Apenas números positivos. Limite estabelecido para nº de pontos por uso é 30 para não dar problemas com crashes, pode ser alterado. Só está para stats, reproduzir o mesmo processo para skills. implementei o sistema, ao clicar nos pontos de status aparece o seguinte erro: 1207 10:28:10598 :: Traceback (most recent call last): 1207 10:28:10598 :: File "ui.py", line 1362, in CallEvent 1207 10:28:10599 :: File "ui.py", line 87, in __call__ 1207 10:28:10599 :: File "ui.py", line 78, in __call__ 1207 10:28:10600 :: File "uiCharacter.py", line 506, in __OnClickStatusPlusButton 1207 10:28:10600 :: File "uiCharacter.py", line 1338, in ChooseCountPlusStat 1207 10:28:10600 :: NameError 1207 10:28:10600 :: : 1207 10:28:10600 :: global name 'uiCommon' is not defined 1207 10:28:10600 :: Edited December 7, 2018 at 12:34 PM by Marcos Link to comment
oserra Posted December 7, 2018 at 01:10 PM Share Posted December 7, 2018 at 01:10 PM import uiCommon 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now