Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.18 KB | None | 0 0
  1. 0720 12:36:26486 :: File "networkModule.py", line 245, in SetGamePhase
  2.  
  3. 0720 12:36:26486 :: File "system.py", line 130, in __pack_import
  4.  
  5. 0720 12:36:26487 :: File "system.py", line 110, in _process_result
  6.  
  7. 0720 12:36:26487 :: File "game.py", line 59, in <module>
  8.  
  9. 0720 12:36:26487 :: File "system.py", line 130, in __pack_import
  10.  
  11. 0720 12:36:26487 :: File "
  12. 0720 12:36:26487 :: uispecialcard.py
  13. 0720 12:36:26487 :: ", line
  14. 0720 12:36:26487 :: 137
  15. 0720 12:36:26487 ::
  16.  
  17. 0720 12:36:26487 ::
  18. 0720 12:36:26487 :: if self.ImagesAlpha < 1.0:
  19.  
  20. 0720 12:36:26487 ::
  21. 0720 12:36:26487 ::
  22. 0720 12:36:26487 ::
  23. 0720 12:36:26487 ::
  24. 0720 12:36:26487 ::
  25. 0720 12:36:26487 ::
  26. 0720 12:36:26487 ::
  27. 0720 12:36:26487 ::
  28. 0720 12:36:26487 ::
  29. 0720 12:36:26487 ::
  30. 0720 12:36:26487 ::
  31. 0720 12:36:26487 ::
  32. 0720 12:36:26487 ::
  33. 0720 12:36:26487 ::
  34. 0720 12:36:26487 ::
  35. 0720 12:36:26487 ::
  36. 0720 12:36:26487 ::
  37. 0720 12:36:26487 ::
  38. 0720 12:36:26487 ::
  39. 0720 12:36:26487 ::
  40. 0720 12:36:26487 ::
  41. 0720 12:36:26487 ::
  42. 0720 12:36:26487 ::
  43. 0720 12:36:26487 ::
  44. 0720 12:36:26487 ::
  45. 0720 12:36:26487 ::
  46. 0720 12:36:26487 :: ^
  47.  
  48. 0720 12:36:26487 :: SyntaxError
  49. 0720 12:36:26487 :: :
  50. 0720 12:36:26487 :: invalid syntax
  51. 0720 12:36:26487 ::
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. import ui
  66. import net
  67. import grp
  68. import wndMgr
  69.  
  70. COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, 0.0)
  71. POSITIONS = [-200, 0, 200]
  72.  
  73. PHASE_OPENING = 1
  74. PHASE_OPEN = 2
  75. PHASE_CLOSE = 3
  76.  
  77. class SpecialCardReward(ui.Bar):
  78. def __init__(self):
  79. ui.Bar.__init__(self, "TOP_MOST")
  80. self.WindowPhase = 0
  81.  
  82. self.BackgroundAlpha = 0.0
  83. self.ImagesAlpha = 0.0
  84. self.CoverAlpha = [1.0, 1.0, 1.0]
  85.  
  86. self.BackgroundCards = []
  87. self.CoverCards = []
  88. self.CardButtons = []
  89.  
  90. self.Selected = False
  91. self.SelectedID = 0
  92. self.ShowOther = False
  93.  
  94. self.BG = grp.GenerateColor()
  95. self.BuildWindow()
  96.  
  97. def __del__(self):
  98. ui.Bar.__del__(self)
  99.  
  100. def BuildWindow(self):
  101. self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  102. self.SetColor(COLOR_BG)
  103.  
  104. self.SelectRewardText = ui.ExpandedImageBox()
  105. self.SelectRewardText.SetParent(self)
  106. self.SelectRewardText.LoadImage("new_gui/special_cards/desc.tga")
  107. self.SelectRewardText.SetWindowHorizontalAlignCenter()
  108. self.SelectRewardText.SetWindowVerticalAlignCenter()
  109. self.SelectRewardText.SetPosition(0, 0)
  110. self.SelectRewardText.SetAlpha(0.0)
  111. self.SelectRewardText.Show()
  112.  
  113. for x in xrange(3):
  114. bgCard = ui.ExpandedImageBox()
  115. bgCard.SetParent(self)
  116. bgCard.LoadImage("new_gui/special_cards/background_card.tga")
  117. bgCard.SetWindowHorizontalAlignCenter()
  118. bgCard.SetWindowVerticalAlignCenter()
  119. bgCard.SetPosition(POSITIONS[x], 60)
  120. bgCard.Hide()
  121. self.bgCard = bgCard
  122. self.BackgroundsCards.append(self.bgCard)
  123.  
  124. coverCard = ui.ExpandedImageBox()
  125. coverCard.SetParent(self)
  126. coverCard.LoadImage("new_gui/special_cards/card_01.tga")
  127. coverCard.SetWindowHorizontalAlignCenter()
  128. coverCard.SetWindowVerticalAlignCenter()
  129. coverCard.SetPosition(POSITIONS[x], 60)
  130. coverCard.SetAlpha(0.0)
  131. coverCard.Show()
  132. self.coverCard = bgCard
  133. self.CoverCards.append(self.coverCard)
  134.  
  135. cardButton = uimg.Button()
  136. cardButton.SetParent(self)
  137. cardButton.SetUpVisual("new_gui/special_cards/card_01.tga")
  138. cardButton.SetOverVisual("new_gui/special_cards/card_02.tga")
  139. cardButton.SetDownVisual("new_gui/special_cards/card_02.tga")
  140. cardButton.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
  141. cardButton.SetEvent(uimg.__mem_func__(self.SelectReward), x)
  142. cardButton.Hide()
  143. self.cardButton = cardButton
  144. self.CardButtons.append(self.cardButton)
  145.  
  146. self.ShowOtherButton = ui.Button()
  147. self.ShowOtherButton.SetParent(self)
  148. self.ShowOtherButton.SetUpVisual("d:/ymir work/ui/public/xlarge_button_01.sub")
  149. self.ShowOtherButton.SetOverVisual("d:/ymir work/ui/public/xlarge_button_02.sub")
  150. self.ShowOtherButton.SetDownVisual("d:/ymir work/ui/public/xlarge_button_03.sub")
  151. self.ShowOtherButton.SetWindowHorizontalAlignCenter()
  152. self.ShowOtherButton.SetWindowVerticalAlignCenter()
  153. self.ShowOtherButton.SetPosition(0, 220)
  154. self.ShowOtherButton.SetText("Pokaż Pozostałe")
  155. self.ShowOtherButton.SetEvent(ui.__mem_func__(self.OtherRewards))
  156. self.ShowOtherButton.Hide()
  157.  
  158. self.CloseButton = ui.Button()
  159. self.CloseButton.SetParent(self)
  160. self.CloseButton.SetUpVisual("d:/ymir work/ui/public/xlarge_button_01.sub")
  161. self.CloseButton.SetOverVisual("d:/ymir work/ui/public/xlarge_button_02.sub")
  162. self.CloseButton.SetDownVisual("d:/ymir work/ui/public/xlarge_button_03.sub")
  163. self.CloseButton.SetWindowHorizontalAlignCenter()
  164. self.CloseButton.SetWindowVerticalAlignCenter()
  165. self.CloseButton.SetPosition(0, 220)
  166. self.CloseButton.SetText("Zamknij")
  167. self.CloseButton.SetEvent(ui.__mem_func__(self.Close))
  168. self.CloseButton.Hide()
  169.  
  170. def SelectReward(self, index):
  171. for x in xrange(3):
  172. self.CardButtons[x].Hide()
  173. self.SelectedID = index
  174. self.Selected = True
  175. net.SendChatPacket("/get_card_reward " + str(index))
  176.  
  177. def ShowElements(self):
  178. for x in xrange(3):
  179. self.BackgroundsCards[x].Show()
  180. self.CardButtons[x].Show()
  181. self.ShowOtherButton.Show()
  182. self.CloseButton.Show()
  183. pass
  184.  
  185. def OtherRewards(self):
  186. self.ShowOther = True
  187.  
  188. def Open(self):
  189. self.WindowPhase = PHASE_OPENING
  190. self.Show()
  191.  
  192. def Close(self):
  193. self.Hide()
  194.  
  195. def OnUpdate(self):
  196. if self.WindowPhase == PHASE_OPENING:
  197. if self.BackgroundAlpha < 0.6:
  198. self.BackgroundAlpha += 0.03
  199. self.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, self.BackgroundAlpha)
  200.  
  201. if self.ImagesAlpha < 1.0:
  202. self.ImagesAlpha += 0.04
  203. for x in xrange(3):
  204. self.CoverCards[x].SetAlpha(self.ImagesAlpha)
  205. else:
  206. self.WindowPhase = PHASE_OPEN
  207. self.ShowElements()
  208.  
  209. # if self.ShowOther:
  210. # for x in xrange(3):
  211. # if self.CoverAlpha[x] > 0.0:
  212. # self.CoverAlpha[x] -= 0.05
  213. # self.CoverCards[x].SetAlpha(self.CoverAlpha[x])
  214.  
  215. # if self.Selected:
  216. # if self.CoverAlpha[self.SelectedID] > 0.0:
  217. # self.CoverAlpha[self.SelectedID] -= 0.05
  218. # self.CoverCards[self.SelectedID].SetAlpha(self.CoverAlpha[self.SelectedID])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement