Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0720 12:36:26486 :: File "networkModule.py", line 245, in SetGamePhase
- 0720 12:36:26486 :: File "system.py", line 130, in __pack_import
- 0720 12:36:26487 :: File "system.py", line 110, in _process_result
- 0720 12:36:26487 :: File "game.py", line 59, in <module>
- 0720 12:36:26487 :: File "system.py", line 130, in __pack_import
- 0720 12:36:26487 :: File "
- 0720 12:36:26487 :: uispecialcard.py
- 0720 12:36:26487 :: ", line
- 0720 12:36:26487 :: 137
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 :: if self.ImagesAlpha < 1.0:
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 ::
- 0720 12:36:26487 :: ^
- 0720 12:36:26487 :: SyntaxError
- 0720 12:36:26487 :: :
- 0720 12:36:26487 :: invalid syntax
- 0720 12:36:26487 ::
- import ui
- import net
- import grp
- import wndMgr
- COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, 0.0)
- POSITIONS = [-200, 0, 200]
- PHASE_OPENING = 1
- PHASE_OPEN = 2
- PHASE_CLOSE = 3
- class SpecialCardReward(ui.Bar):
- def __init__(self):
- ui.Bar.__init__(self, "TOP_MOST")
- self.WindowPhase = 0
- self.BackgroundAlpha = 0.0
- self.ImagesAlpha = 0.0
- self.CoverAlpha = [1.0, 1.0, 1.0]
- self.BackgroundCards = []
- self.CoverCards = []
- self.CardButtons = []
- self.Selected = False
- self.SelectedID = 0
- self.ShowOther = False
- self.BG = grp.GenerateColor()
- self.BuildWindow()
- def __del__(self):
- ui.Bar.__del__(self)
- def BuildWindow(self):
- self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
- self.SetColor(COLOR_BG)
- self.SelectRewardText = ui.ExpandedImageBox()
- self.SelectRewardText.SetParent(self)
- self.SelectRewardText.LoadImage("new_gui/special_cards/desc.tga")
- self.SelectRewardText.SetWindowHorizontalAlignCenter()
- self.SelectRewardText.SetWindowVerticalAlignCenter()
- self.SelectRewardText.SetPosition(0, 0)
- self.SelectRewardText.SetAlpha(0.0)
- self.SelectRewardText.Show()
- for x in xrange(3):
- bgCard = ui.ExpandedImageBox()
- bgCard.SetParent(self)
- bgCard.LoadImage("new_gui/special_cards/background_card.tga")
- bgCard.SetWindowHorizontalAlignCenter()
- bgCard.SetWindowVerticalAlignCenter()
- bgCard.SetPosition(POSITIONS[x], 60)
- bgCard.Hide()
- self.bgCard = bgCard
- self.BackgroundsCards.append(self.bgCard)
- coverCard = ui.ExpandedImageBox()
- coverCard.SetParent(self)
- coverCard.LoadImage("new_gui/special_cards/card_01.tga")
- coverCard.SetWindowHorizontalAlignCenter()
- coverCard.SetWindowVerticalAlignCenter()
- coverCard.SetPosition(POSITIONS[x], 60)
- coverCard.SetAlpha(0.0)
- coverCard.Show()
- self.coverCard = bgCard
- self.CoverCards.append(self.coverCard)
- cardButton = uimg.Button()
- cardButton.SetParent(self)
- cardButton.SetUpVisual("new_gui/special_cards/card_01.tga")
- cardButton.SetOverVisual("new_gui/special_cards/card_02.tga")
- cardButton.SetDownVisual("new_gui/special_cards/card_02.tga")
- cardButton.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
- cardButton.SetEvent(uimg.__mem_func__(self.SelectReward), x)
- cardButton.Hide()
- self.cardButton = cardButton
- self.CardButtons.append(self.cardButton)
- self.ShowOtherButton = ui.Button()
- self.ShowOtherButton.SetParent(self)
- self.ShowOtherButton.SetUpVisual("d:/ymir work/ui/public/xlarge_button_01.sub")
- self.ShowOtherButton.SetOverVisual("d:/ymir work/ui/public/xlarge_button_02.sub")
- self.ShowOtherButton.SetDownVisual("d:/ymir work/ui/public/xlarge_button_03.sub")
- self.ShowOtherButton.SetWindowHorizontalAlignCenter()
- self.ShowOtherButton.SetWindowVerticalAlignCenter()
- self.ShowOtherButton.SetPosition(0, 220)
- self.ShowOtherButton.SetText("Pokaż Pozostałe")
- self.ShowOtherButton.SetEvent(ui.__mem_func__(self.OtherRewards))
- self.ShowOtherButton.Hide()
- self.CloseButton = ui.Button()
- self.CloseButton.SetParent(self)
- self.CloseButton.SetUpVisual("d:/ymir work/ui/public/xlarge_button_01.sub")
- self.CloseButton.SetOverVisual("d:/ymir work/ui/public/xlarge_button_02.sub")
- self.CloseButton.SetDownVisual("d:/ymir work/ui/public/xlarge_button_03.sub")
- self.CloseButton.SetWindowHorizontalAlignCenter()
- self.CloseButton.SetWindowVerticalAlignCenter()
- self.CloseButton.SetPosition(0, 220)
- self.CloseButton.SetText("Zamknij")
- self.CloseButton.SetEvent(ui.__mem_func__(self.Close))
- self.CloseButton.Hide()
- def SelectReward(self, index):
- for x in xrange(3):
- self.CardButtons[x].Hide()
- self.SelectedID = index
- self.Selected = True
- net.SendChatPacket("/get_card_reward " + str(index))
- def ShowElements(self):
- for x in xrange(3):
- self.BackgroundsCards[x].Show()
- self.CardButtons[x].Show()
- self.ShowOtherButton.Show()
- self.CloseButton.Show()
- pass
- def OtherRewards(self):
- self.ShowOther = True
- def Open(self):
- self.WindowPhase = PHASE_OPENING
- self.Show()
- def Close(self):
- self.Hide()
- def OnUpdate(self):
- if self.WindowPhase == PHASE_OPENING:
- if self.BackgroundAlpha < 0.6:
- self.BackgroundAlpha += 0.03
- self.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, self.BackgroundAlpha)
- if self.ImagesAlpha < 1.0:
- self.ImagesAlpha += 0.04
- for x in xrange(3):
- self.CoverCards[x].SetAlpha(self.ImagesAlpha)
- else:
- self.WindowPhase = PHASE_OPEN
- self.ShowElements()
- # if self.ShowOther:
- # for x in xrange(3):
- # if self.CoverAlpha[x] > 0.0:
- # self.CoverAlpha[x] -= 0.05
- # self.CoverCards[x].SetAlpha(self.CoverAlpha[x])
- # if self.Selected:
- # if self.CoverAlpha[self.SelectedID] > 0.0:
- # self.CoverAlpha[self.SelectedID] -= 0.05
- # self.CoverCards[self.SelectedID].SetAlpha(self.CoverAlpha[self.SelectedID])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement