Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.36 KB | None | 0 0
  1. import app
  2. import constInfo
  3. import uimg
  4. import uiToolTip
  5. import item
  6. import player
  7. import grp
  8. import time
  9. import event
  10. import chat
  11. import chr
  12. import net
  13.  
  14. import wndMgr
  15.  
  16. COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, 0.0)
  17.  
  18. class NagrodaBoss(uimg.Bar):
  19. Schowaj1 = 0
  20. Schowaj2 = 0
  21. Schowaj3 = 0
  22.  
  23. a1 = 1.0
  24. a2 = 1.0
  25. a3 = 1.0
  26.  
  27. Animacja = 0
  28. Alpha = 0.00
  29. Alpha2 = 0.00
  30. Nagroda = 0
  31. Pozostale = 0
  32. Zamknij = 0
  33. def __init__(self):
  34. uimg.Bar.__init__(self, "TOP_MOST")
  35. self.ZbudujOkno()
  36. def SetColor(self,color):
  37. wndMgr.SetColor(self.hWnd, color)
  38. self.color = color
  39.  
  40. def __del__(self):
  41. uimg.Bar.__del__(self)
  42.  
  43. def Destroy(self):
  44. self.Hide()
  45. return TRUE
  46.  
  47. def ZbudujOkno(self):
  48. self.SetPosition(0, 0)
  49. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  50. self.SetColor(COLOR_BG)
  51. self.Show()
  52.  
  53. self.CancelButton3 = uimg.Button()
  54. self.CancelButton3.SetParent(self)
  55. self.CancelButton3.SetPosition(self.GetWidth()/2-95, self.GetHeight()/2+130)
  56. self.CancelButton3.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
  57. self.CancelButton3.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
  58. self.CancelButton3.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
  59. self.CancelButton3.SetText("|cffe6d0a2Pozostałe")
  60. self.CancelButton3.SetEvent(self.Reszta)
  61. self.CancelButton3.Hide()
  62.  
  63. self.CancelButton4 = uimg.Button()
  64. self.CancelButton4.SetParent(self)
  65. self.CancelButton4.SetPosition(self.GetWidth()/2, self.GetHeight()/2+130)
  66. self.CancelButton4.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
  67. self.CancelButton4.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
  68. self.CancelButton4.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
  69. self.CancelButton4.SetText("|cffe6d0a2Zamknij")
  70. self.CancelButton4.SetEvent(self.Close)
  71. self.CancelButton4.Hide()
  72.  
  73. self.Obrazek1 = uimg.ExpandedImageBox()
  74. self.Obrazek1.SetParent(self)
  75. self.Obrazek1.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
  76. self.Obrazek1.LoadImage("illumina/nagroda_boss/tlo.tga")
  77. self.Obrazek1.SetAlpha(0.0)
  78. self.Obrazek1.Show()
  79.  
  80. self.Obrazek2 = uimg.ExpandedImageBox()
  81. self.Obrazek2.SetParent(self)
  82. self.Obrazek2.SetPosition((self.GetWidth()/2-172)+120, self.GetHeight()/2+20)
  83. self.Obrazek2.LoadImage("illumina/nagroda_boss/tlo.tga")
  84. self.Obrazek2.SetAlpha(0.0)
  85. self.Obrazek2.Show()
  86.  
  87. self.Obrazek3 = uimg.ExpandedImageBox()
  88. self.Obrazek3.SetParent(self)
  89. self.Obrazek3.SetPosition((self.GetWidth()/2-172)+120*2, self.GetHeight()/2+20)
  90. self.Obrazek3.LoadImage("illumina/nagroda_boss/tlo.tga")
  91. self.Obrazek3.SetAlpha(0.0)
  92. self.Obrazek3.Show()
  93.  
  94. self.Pyt1 = uimg.ExpandedImageBox()
  95. self.Pyt1.LoadImage("illumina/nagroda_boss/btn_01.tga")
  96. self.Pyt1.SetParent(self)
  97. self.Pyt1.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
  98. self.Pyt1.SetAlpha(0.0)
  99. self.Pyt1.Show()
  100.  
  101. self.Pyt2 = uimg.ExpandedImageBox()
  102. self.Pyt2.LoadImage("illumina/nagroda_boss/btn_01.tga")
  103. self.Pyt2.SetParent(self)
  104. self.Pyt2.SetPosition((self.GetWidth()/2-172)+120, self.GetHeight()/2+20)
  105. self.Pyt2.SetAlpha(0.0)
  106. self.Pyt2.Show()
  107.  
  108. self.Pyt3 = uimg.ExpandedImageBox()
  109. self.Pyt3.LoadImage("illumina/nagroda_boss/btn_01.tga")
  110. self.Pyt3.SetParent(self)
  111. self.Pyt3.SetPosition((self.GetWidth()/2-172)+120*2, self.GetHeight()/2+20)
  112. self.Pyt3.SetAlpha(0.0)
  113. self.Pyt3.Show()
  114.  
  115. self.Btn1 = uimg.Button()
  116. self.Btn1.SetParent(self)
  117. self.Btn1.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
  118. self.Btn1.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
  119. self.Btn1.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
  120. self.Btn1.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
  121. self.Btn1.SetEvent(uimg.__mem_func__(self.Schowaj), 1)
  122. self.Btn1.Hide()
  123.  
  124. self.Btn2 = uimg.Button()
  125. self.Btn2.SetParent(self)
  126. self.Btn2.SetPosition((self.GetWidth()/2-172)+120, self.GetHeight()/2+20)
  127. self.Btn2.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
  128. self.Btn2.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
  129. self.Btn2.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
  130. self.Btn2.SetEvent(uimg.__mem_func__(self.Schowaj), 2)
  131. self.Btn2.Hide()
  132.  
  133. self.Btn3 = uimg.Button()
  134. self.Btn3.SetParent(self)
  135. self.Btn3.SetPosition((self.GetWidth()/2-172)+120*2, self.GetHeight()/2+20)
  136. self.Btn3.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
  137. self.Btn3.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
  138. self.Btn3.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
  139. self.Btn3.SetEvent(uimg.__mem_func__(self.Schowaj), 3)
  140. self.Btn3.Hide()
  141.  
  142. self.Slot1 = uimg.SlotWindow()
  143. self.Slot1.SetParent(self.Obrazek1)
  144. self.Slot1.SetPosition(36, 36)
  145. self.Slot1.AppendSlot(0, 0, 0, 32, 32)
  146. self.Slot1.Hide()
  147.  
  148. self.Slot2 = uimg.SlotWindow()
  149. self.Slot2.SetParent(self.Obrazek2)
  150. self.Slot2.SetPosition(36, 36)
  151. self.Slot2.AppendSlot(0, 0, 0, 32, 32)
  152. self.Slot2.Hide()
  153.  
  154. self.Slot3 = uimg.SlotWindow()
  155. self.Slot3.SetParent(self.Obrazek3)
  156. self.Slot3.SetPosition(36, 36)
  157. self.Slot3.AppendSlot(0, 0, 0, 32, 32)
  158. self.Slot3.Hide()
  159.  
  160. self.Tlo = uimg.ExpandedImageBox()
  161. self.Tlo.LoadImage("illumina/nagroda_boss/info.tga")
  162. self.Tlo.SetParent(self)
  163. self.Tlo.SetPosition(self.GetWidth()/2-150, self.GetHeight()/2-200)
  164. self.Tlo.SetAlpha(0.0)
  165. self.Tlo.Show()
  166.  
  167. def Schowaj(self, nr):
  168. self.Btn1.Hide()
  169. self.Btn2.Hide()
  170. self.Btn3.Hide()
  171. if nr == 1:
  172. self.Schowaj1 = 1
  173. elif nr == 2:
  174. self.Schowaj2 = 1
  175. elif nr == 3:
  176. self.Schowaj3 = 1
  177. self.Nagroda = nr
  178.  
  179. event.QuestButtonClick(constInfo.NagrodaBoss)
  180. net.SendQuestInputStringPacket(str(nr))
  181.  
  182. self.CancelButton3.Show()
  183. self.CancelButton4.Show()
  184.  
  185. def Teleportacja(self, id):
  186. net.SendChatPacket("/teleport " + str(id))
  187.  
  188. def Reszta(self):
  189. self.Pozostale = 1
  190. self.CancelButton3.Hide()
  191.  
  192. def PokazReszte(self):
  193. if self.Pozostale == 1:
  194. self.Schowaj1 = 1
  195. self.Schowaj2 = 1
  196. self.Schowaj3 = 1
  197. self.Pozostale = 0
  198.  
  199. def Open(self):
  200. self.Show()
  201. self.Alpha = 0.0
  202. self.Animacja = 1
  203. self.a1 = 1.0
  204. self.a2 = 1.0
  205. self.a3 = 1.0
  206. self.Pyt1.SetAlpha(self.a1)
  207. self.Pyt2.SetAlpha(self.a1)
  208. self.Pyt3.SetAlpha(self.a3)
  209.  
  210. def OnPressEscapeKey(self):
  211. self.Hide()
  212. return TRUE
  213.  
  214. def PrzyciskiShow(self):
  215. if self.Animacja == 1:
  216. self.Btn1.Show()
  217. self.Btn2.Show()
  218. self.Btn3.Show()
  219. self.Slot1.Show()
  220. self.Slot2.Show()
  221. self.Slot3.Show()
  222.  
  223. def WyborNagrody(self, nr):
  224. if self.Schowaj1 == 1 and self.a1 > 0:
  225. self.Btn1.Hide()
  226. self.a1 -= 0.05
  227. self.Pyt1.SetAlpha(self.a1)
  228.  
  229. if self.Schowaj2 == 1 and self.a2 > 0:
  230. self.Btn2.Hide()
  231. self.a2 -= 0.05
  232. self.Pyt2.SetAlpha(self.a2)
  233.  
  234. if self.Schowaj3 == 1 and self.a3 > 0:
  235. self.Btn3.Hide()
  236. self.a3 -= 0.05
  237. self.Pyt3.SetAlpha(self.a3)
  238.  
  239. def WyswietlOkno(self):
  240. global COLOR_BG
  241.  
  242. if self.Animacja == 1 and self.Alpha < 0.49:
  243. self.Alpha += 0.01
  244. COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, self.Alpha)
  245. self.SetColor(COLOR_BG)
  246.  
  247. self.Tlo.SetAlpha(self.Alpha*2)
  248.  
  249. self.Obrazek1.SetAlpha(self.Alpha*2)
  250. self.Obrazek2.SetAlpha(self.Alpha*2)
  251. self.Obrazek3.SetAlpha(self.Alpha*2)
  252. self.Pyt1.SetAlpha(self.Alpha*2)
  253. self.Pyt2.SetAlpha(self.Alpha*2)
  254. self.Pyt3.SetAlpha(self.Alpha*2)
  255.  
  256. else:
  257. self.PrzyciskiShow()
  258. self.Animacja = 0
  259.  
  260. def Close(self):
  261. self.Zamknij = 1
  262. self.CancelButton4.Hide()
  263.  
  264. def ZamknijCalosc(self):
  265. global COLOR_BG
  266.  
  267. if self.Zamknij == 1 and self.Alpha > 0.1:
  268. self.Alpha -= 0.01
  269. COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, self.Alpha)
  270. self.SetColor(COLOR_BG)
  271.  
  272. self.Tlo.SetAlpha(self.Alpha*2)
  273.  
  274. self.Obrazek1.SetAlpha(self.Alpha*2)
  275. self.Obrazek2.SetAlpha(self.Alpha*2)
  276. self.Obrazek3.SetAlpha(self.Alpha*2)
  277. else:
  278. self.Slot1.Hide()
  279. self.Slot2.Hide()
  280. self.Slot3.Hide()
  281. self.Schowaj1 = 0
  282. self.Schowaj2 = 0
  283. self.Schowaj3 = 0
  284. self.a1 = 1.0
  285. self.a2 = 1.0
  286. self.a3 = 1.0
  287. self.Hide()
  288. self.Zamknij = 0
  289.  
  290. def UstawItemy(self, i1, i2, i3, c1, c2, c3):
  291. self.Slot1.SetItemSlot(0, int(i1), int(c1))
  292. self.Slot2.SetItemSlot(0, int(i2), int(c2))
  293. self.Slot3.SetItemSlot(0, int(i3), int(c3))
  294.  
  295. def OnUpdate(self):
  296. self.WyswietlOkno()
  297.  
  298. self.WyborNagrody(self.Nagroda)
  299.  
  300. self.PokazReszte()
  301.  
  302. if self.Zamknij == 1:
  303. self.ZamknijCalosc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement