Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import app
- import constInfo
- import uimg
- import uiToolTip
- import item
- import localemg
- import player
- import grp
- import time
- import event
- import chat
- import chr
- import net
- import wndMgr
- COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, 0.0)
- class NagrodaBoss(uimg.ThinBoard):
- Schowaj1 = 0
- Schowaj2 = 0
- Schowaj3 = 0
- Sloty = []
- NagrodyBG = []
- Przyciski = []
- Pytajniki = []
- a1 = 1.0
- a2 = 1.0
- a3 = 1.0
- Animacja = 0
- Alpha = 0.00
- Alpha2 = 0.00
- Nagroda = 0
- Pozostale = 0
- Zamknij = 0
- def __init__(self):
- uimg.ThinBoard.__init__(self, "TOP_MOST")
- self.ZbudujOkno()
- def SetColor(self,color):
- wndMgr.SetColor(self.hWnd, color)
- self.color = color
- def __del__(self):
- uimg.ThinBoard.__del__(self)
- def Destroy(self):
- self.Hide()
- return TRUE
- def ZbudujOkno(self):
- self.SetPosition(0, 0)
- self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
- self.SetColor(COLOR_BG)
- self.Show()
- self.CancelButton2 = uimg.Button()
- self.CancelButton2.SetParent(self)
- self.CancelButton2.SetPosition(self.GetWidth()/2-54, self.GetHeight()/2+190)
- self.CancelButton2.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
- self.CancelButton2.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
- self.CancelButton2.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
- self.CancelButton2.SetText("Start")
- self.CancelButton2.SetEvent(self.Open)
- self.CancelButton2.Show()
- self.CancelButton3 = uimg.Button()
- self.CancelButton3.SetParent(self)
- self.CancelButton3.SetPosition(self.GetWidth()/2-95, self.GetHeight()/2+130)
- self.CancelButton3.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
- self.CancelButton3.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
- self.CancelButton3.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
- self.CancelButton3.SetText("Pozostałe")
- self.CancelButton3.SetEvent(self.Reszta)
- self.CancelButton3.Hide()
- self.CancelButton4 = uimg.Button()
- self.CancelButton4.SetParent(self)
- self.CancelButton4.SetPosition(self.GetWidth()/2, self.GetHeight()/2+130)
- self.CancelButton4.SetUpVisual("d:/ymir work/ui/public/large_button_01.sub")
- self.CancelButton4.SetOverVisual("d:/ymir work/ui/public/large_button_02.sub")
- self.CancelButton4.SetDownVisual("d:/ymir work/ui/public/large_button_03.sub")
- self.CancelButton4.SetText("Zamknij")
- self.CancelButton4.SetEvent(self.Close)
- self.CancelButton4.Hide()
- for i in xrange(0,3):
- Obrazek = uimg.ExpandedImageBox()
- Obrazek.SetParent(self)
- Obrazek.SetPosition((self.GetWidth()/2-172)+120*i, self.GetHeight()/2+20)
- Obrazek.LoadImage("illumina/nagroda_boss/tlo.tga")
- Obrazek.SetAlpha(0.0)
- Obrazek.Show()
- self.NagrodyBG.append(Obrazek)
- Slot = uimg.SlotWindow()
- Slot.SetParent(Obrazek)
- Slot.SetPosition(39, 39)
- Slot.AppendSlot(i, 0, 0, 32, 32)
- Slot.Hide()
- self.Sloty.append(Slot)
- Pyt1 = uimg.ExpandedImageBox()
- Pyt1.LoadImage("illumina/nagroda_boss/btn_01.tga")
- Pyt1.SetParent(self)
- Pyt1.SetPosition((self.GetWidth()/2-172)+120*i, self.GetHeight()/2+20)
- Pyt1.SetAlpha(0.0)
- Pyt1.Show()
- self.Pytajniki.append(Pyt1)
- Btn = uimg.Button()
- Btn.SetParent(self)
- Btn.SetPosition((self.GetWidth()/2-172)+120*i, self.GetHeight()/2+20)
- Btn.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
- Btn.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
- Btn.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
- Btn.SetEvent(uimg.__mem_func__(self.Schowaj), i+1)
- Btn.Hide()
- self.Przyciski.append(Btn)
- self.Tlo = uimg.ExpandedImageBox()
- self.Tlo.LoadImage("illumina/nagroda_boss/info.tga")
- self.Tlo.SetParent(self)
- self.Tlo.SetPosition(self.GetWidth()/2-150, self.GetHeight()/2-200)
- self.Tlo.SetAlpha(0.0)
- self.Tlo.Show()
- def Schowaj(self, nr):
- for i in xrange(0,3):
- self.Przyciski[i].Hide()
- if nr == 1:
- self.Schowaj1 = 1
- self.Nagroda = 1
- elif nr == 2:
- self.Schowaj2 = 1
- self.Nagroda = 2
- elif nr == 3:
- self.Schowaj3 = 1
- self.Nagroda = 3
- self.CancelButton3.Show()
- self.CancelButton4.Show()
- def Teleportacja(self, id):
- net.SendChatPacket("/teleport " + str(id))
- def Reszta(self):
- self.Pozostale = 1
- self.CancelButton3.Hide()
- def PokazReszte(self):
- if self.Pozostale == 1:
- self.Schowaj1 = 1
- self.Schowaj2 = 1
- self.Schowaj3 = 1
- def Open(self):
- self.Alpha = 0.0
- self.Animacja = 1
- def OnPressEscapeKey(self):
- self.Hide()
- return TRUE
- def PrzyciskiShow(self):
- if self.Animacja == 1:
- for i in xrange(0,3):
- self.Przyciski[i].Show()
- def WyborNagrody(self, nr):
- if self.Schowaj1 == 1 and self.a1 > 0:
- self.Przyciski[0].Hide()
- self.a1 -= 0.05
- self.Pytajniki[0].SetAlpha(self.a1)
- if self.Schowaj2 == 1 and self.a2 > 0:
- self.Przyciski[1].Hide()
- self.a2 -= 0.05
- self.Pytajniki[1].SetAlpha(self.a2)
- if self.Schowaj3 == 1 and self.a3 > 0:
- self.Przyciski[2].Hide()
- self.a3 -= 0.05
- self.Pytajniki[2].SetAlpha(self.a3)
- def WyswietlOkno(self):
- global COLOR_BG
- if self.Animacja == 1 and self.Alpha < 0.49:
- self.Alpha += 0.01
- COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, self.Alpha)
- self.SetColor(COLOR_BG)
- self.Tlo.SetAlpha(self.Alpha*2)
- for i in xrange(0,3):
- self.NagrodyBG[i].SetAlpha(self.Alpha*2)
- self.Pytajniki[i].SetAlpha(self.Alpha*2)
- else:
- self.PrzyciskiShow()
- self.Animacja = 0
- def Close(self):
- self.Zamknij = 1
- self.CancelButton4.Hide()
- def ZamknijCalosc(self):
- global COLOR_BG
- if self.Zamknij == 1 and self.Alpha > 0.1:
- self.Alpha -= 0.01
- COLOR_BG = grp.GenerateColor(0.0, 0.0, 0.0, self.Alpha)
- self.SetColor(COLOR_BG)
- self.Tlo.SetAlpha(self.Alpha*2)
- for i in xrange(0,3):
- self.NagrodyBG[i].SetAlpha(self.Alpha*2)
- else:
- self.Hide()
- self.Zamknij = 0
- def OnUpdate(self):
- self.WyswietlOkno()
- self.WyborNagrody(self.Nagroda)
- self.PokazReszte()
- if self.Zamknij == 1:
- self.ZamknijCalosc()
- NagrodaBoss().Show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement