Guest User

tutorial

a guest
May 15th, 2020
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. class GameWindow(ui.ScriptWindow):
  2. def __init__(self, stream):
  3.  
  4. import dailygift
  5. self.wnddailygift = dailygift.DailyGift()
  6.  
  7.  
  8. def Open(self):
  9. app.SetFrameSkip(1)
  10.  
  11. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  12.  
  13.  
  14. self.daily_reward = ui.Button()
  15. self.daily_reward.SetParent(self)
  16. self.daily_reward.SetPosition(wndMgr.GetScreenWidth()-75,20)
  17. self.daily_reward.SetUpVisual("icon/item/50244.tga")
  18. self.daily_reward.SetOverVisual("icon/item/50244.tga")
  19. self.daily_reward.SetDownVisual("icon/item/50244.tga")
  20. self.daily_reward.SetToolTipText("Daily Rewards")
  21. self.daily_reward.SetEvent(lambda : self.ManagerGiftSystem("Show|"))
  22. self.daily_reward.Show()
  23.  
  24. def OnUpdate(self):
  25. app.UpdateGame()
  26.  
  27. self.wnddailygift.OnUpdate()
  28.  
  29.  
  30.  
  31.  
  32.  
  33. "ManagerGiftSystem" : self.ManagerGiftSystem,
  34.  
  35.  
  36. def ManagerGiftSystem(self, cmd):
  37. cmd = cmd.split("|")
  38. if cmd[0] == "Show":
  39. self.wnddailygift.Show()
  40. elif cmd[0] == "DeleteRewards":
  41. self.wnddailygift.DeleteRewards()
  42. elif cmd[0] == "SetDailyReward":
  43. self.wnddailygift.SetDailyReward(cmd[1]) # numero de la recompensa
  44. elif cmd[0] == "SetTime":
  45. self.wnddailygift.SetTime(cmd[1]) # tiempo en numeros grandes
  46. elif cmd[0] == "SetReward":
  47. self.wnddailygift.SetReward(cmd[1], cmd[2]) #hacer un array con los items
  48. elif cmd[0] == "SetRewardDone":
  49. self.wnddailygift.SetRewardDone()
Add Comment
Please, Sign In to add comment