Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## find:
- import emotion
- ## add bellow:
- import uiCommon
- ## find
- def __OnClickStatusPlusButton(self, statusKey):
- try:
- statusPlusCommand=self.statusPlusCommandDict[statusKey]
- net.SendChatPacket(statusPlusCommand)
- except KeyError, msg:
- dbg.TraceError("CharacterWindow.__OnClickStatusPlusButton KeyError: %s", msg)
- ## change to:
- def ChooseCountPlusStat(self, statusKey):
- inputDialog = uiCommon.InputDialog()
- inputDialog.SetTitle("Podaj ilość punktów")
- 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, "Podano błędną wartość.")
- return
- if count > 30:
- chat.AppendChat(chat.CHAT_TYPE_INFO, "Możesz dodać maksymalnie 30 punktów jednocześnie.")
- return
- if count > 1:
- for i in xrange(count):
- net.SendChatPacket(statusPlusCommand)
- else:
- net.SendChatPacket(statusPlusCommand)
- except ValueError:
- chat.AppendChat(chat.CHAT_TYPE_INFO, "Podano błędną wartość.")
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement