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.Bar):
- Schowaj1 = 0
- Schowaj2 = 0
- Schowaj3 = 0
- 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.Bar.__init__(self, "TOP_MOST")
- self.ZbudujOkno()
- def SetColor(self,color):
- wndMgr.SetColor(self.hWnd, color)
- self.color = color
- def __del__(self):
- uimg.Bar.__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()
- self.Obrazek1 = uimg.ExpandedImageBox()
- self.Obrazek1.SetParent(self)
- self.Obrazek1.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
- self.Obrazek1.LoadImage("illumina/nagroda_boss/tlo.tga")
- self.Obrazek1.SetAlpha(0.0)
- self.Obrazek1.Show()
- self.Obrazek2 = uimg.ExpandedImageBox()
- self.Obrazek2.SetParent(self)
- self.Obrazek2.SetPosition((self.GetWidth()/2-172)+120, self.GetHeight()/2+20)
- self.Obrazek2.LoadImage("illumina/nagroda_boss/tlo.tga")
- self.Obrazek2.SetAlpha(0.0)
- self.Obrazek2.Show()
- self.Obrazek3 = uimg.ExpandedImageBox()
- self.Obrazek3.SetParent(self)
- self.Obrazek3.SetPosition((self.GetWidth()/2-172)+120*2, self.GetHeight()/2+20)
- self.Obrazek3.LoadImage("illumina/nagroda_boss/tlo.tga")
- self.Obrazek3.SetAlpha(0.0)
- self.Obrazek3.Show()
- self.Pyt1 = uimg.ExpandedImageBox()
- self.Pyt1.LoadImage("illumina/nagroda_boss/btn_01.tga")
- self.Pyt1.SetParent(self)
- self.Pyt1.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
- self.Pyt1.SetAlpha(0.0)
- self.Pyt1.Show()
- self.Pyt2 = uimg.ExpandedImageBox()
- self.Pyt2.LoadImage("illumina/nagroda_boss/btn_01.tga")
- self.Pyt2.SetParent(self)
- self.Pyt2.SetPosition((self.GetWidth()/2-172)+120, self.GetHeight()/2+20)
- self.Pyt2.SetAlpha(0.0)
- self.Pyt2.Show()
- self.Pyt3 = uimg.ExpandedImageBox()
- self.Pyt3.LoadImage("illumina/nagroda_boss/btn_01.tga")
- self.Pyt3.SetParent(self)
- self.Pyt3.SetPosition((self.GetWidth()/2-172)+120*2, self.GetHeight()/2+20)
- self.Pyt3.SetAlpha(0.0)
- self.Pyt3.Show()
- self.Btn1 = uimg.Button()
- self.Btn1.SetParent(self)
- self.Btn1.SetPosition((self.GetWidth()/2-172), self.GetHeight()/2+20)
- self.Btn1.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
- self.Btn1.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
- self.Btn1.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
- self.Btn1.SetEvent(uimg.__mem_func__(self.Schowaj), 1)
- self.Btn1.Hide()
- self.Btn2 = uimg.Button()
- self.Btn2.SetParent(self)
- self.Btn2.SetPosition((self.GetWidth()/2-172)+120, self.GetHeight()/2+20)
- self.Btn2.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
- self.Btn2.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
- self.Btn2.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
- self.Btn2.SetEvent(uimg.__mem_func__(self.Schowaj), 2)
- self.Btn2.Hide()
- self.Btn3 = uimg.Button()
- self.Btn3.SetParent(self)
- self.Btn3.SetPosition((self.GetWidth()/2-172)+120*2, self.GetHeight()/2+20)
- self.Btn3.SetUpVisual("illumina/nagroda_boss/btn_01.tga")
- self.Btn3.SetOverVisual("illumina/nagroda_boss/btn_02.tga")
- self.Btn3.SetDownVisual("illumina/nagroda_boss/btn_01.tga")
- self.Btn3.SetEvent(uimg.__mem_func__(self.Schowaj), 3)
- self.Btn3.Hide()
- self.Slot1 = uimg.SlotWindow()
- self.Slot1.SetParent(self.Obrazek1)
- self.Slot1.SetPosition(36, 36)
- self.Slot1.AppendSlot(0, 0, 0, 32, 32)
- self.Slot1.Hide()
- self.Slot2 = uimg.SlotWindow()
- self.Slot2.SetParent(self.Obrazek2)
- self.Slot2.SetPosition(36, 36)
- self.Slot2.AppendSlot(0, 0, 0, 32, 32)
- self.Slot2.Hide()
- self.Slot3 = uimg.SlotWindow()
- self.Slot3.SetParent(self.Obrazek3)
- self.Slot3.SetPosition(36, 36)
- self.Slot3.AppendSlot(0, 0, 0, 32, 32)
- self.Slot3.Hide()
- 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):
- self.Btn1.Hide()
- self.Btn2.Hide()
- self.Btn3.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
- self.Pozostale = 0
- def Open(self):
- self.Show()
- self.Alpha = 0.0
- self.Animacja = 1
- def OnPressEscapeKey(self):
- self.Hide()
- return TRUE
- def PrzyciskiShow(self):
- if self.Animacja == 1:
- self.Btn1.Show()
- self.Btn2.Show()
- self.Btn3.Show()
- self.Slot1.Show()
- self.Slot2.Show()
- self.Slot3.Show()
- def WyborNagrody(self, nr):
- if self.Schowaj1 == 1 and self.a1 > 0:
- self.Btn1.Hide()
- self.a1 -= 0.05
- self.Pyt1.SetAlpha(self.a1)
- if self.Schowaj2 == 1 and self.a2 > 0:
- self.Btn2.Hide()
- self.a2 -= 0.05
- self.Pyt2.SetAlpha(self.a2)
- if self.Schowaj3 == 1 and self.a3 > 0:
- self.Btn3.Hide()
- self.a3 -= 0.05
- self.Pyt3.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)
- self.Obrazek1.SetAlpha(self.Alpha*2)
- self.Obrazek2.SetAlpha(self.Alpha*2)
- self.Obrazek3.SetAlpha(self.Alpha*2)
- self.Pyt1.SetAlpha(self.Alpha*2)
- self.Pyt2.SetAlpha(self.Alpha*2)
- self.Pyt3.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)
- self.Obrazek1.SetAlpha(self.Alpha*2)
- self.Obrazek2.SetAlpha(self.Alpha*2)
- self.Obrazek3.SetAlpha(self.Alpha*2)
- else:
- self.Slot1.Hide()
- self.Slot2.Hide()
- self.Slot3.Hide()
- self.Schowaj1 = 0
- self.Schowaj2 = 0
- self.Schowaj3 = 0
- self.a1 = 1.0
- self.a2 = 1.0
- self.a3 = 1.0
- self.Hide()
- self.Zamknij = 0
- def UstawItemy(self, i1, i2, i3, c1, c2, c3):
- self.Slot1.SetItemSlot(0, int(i1), int(c1))
- self.Slot2.SetItemSlot(0, int(i2), int(c2))
- self.Slot3.SetItemSlot(0, int(i3), int(c3))
- def OnUpdate(self):
- self.WyswietlOkno()
- self.WyborNagrody(self.Nagroda)
- self.PokazReszte()
- if self.Zamknij == 1:
- self.ZamknijCalosc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement