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
- POS_X1 = [330, 430, 95, 260, 130, 300, 100]
- POS_Y1 = [15, 105, 105, 175, 210, 300, 320]
- OBRAZKI1_01 = [
- "mapa/teleport_wybor_1_red.tga",
- "mapa/teleport_wybor_1_blue.tga",
- "mapa/teleport_wybor_1_exp.tga",
- "mapa/teleport_wybor_1_wojna.tga",
- "mapa/teleport_wybor_1_event.tga",
- "mapa/teleport_wybor_1_gilldia.tga",
- "mapa/teleport_wybor_1_wyprawy.tga"
- ]
- OBRAZKI1_02 = [
- "mapa/teleport_wybor_1_red.tga",
- "mapa/teleport_wybor_1_blue.tga",
- "mapa/teleport_wybor_1_exp.tga",
- "mapa/teleport_wybor_1_wojna.tga",
- "mapa/teleport_wybor_1_event.tga",
- "mapa/teleport_wybor_1_gilldia.tga",
- "mapa/teleport_wybor_1_wyprawy.tga"
- ]
- POS_X2 = [60, 60, 215, 240, 205, 370, 365, 400]
- POS_Y2 = [335, 210, 340, 235, 140, 65, 175, 290]
- #POS_X2 = [370, 205, 365, 60, 240, 400, 60, 215]
- #POS_Y2 = [65, 140, 175, 210, 235, 290, 335, 340]
- '''
- OBRAZKI2_01 = [
- "mapa/teleport_wybor_2_rogun.tga",
- "mapa/teleport_wybor_2_pieklo.tga",
- "mapa/teleport_wybor_2_zak_las.tga",
- "mapa/teleport_wybor_2_orki.tga",
- "mapa/teleport_wybor_2_red_las.tga",
- "mapa/teleport_wybor_2_urodzaj.tga",
- "mapa/teleport_wybor_2_pustynia.tga",
- "mapa/teleport_wybor_2_lodowa.tga"]
- '''
- OBRAZKI2_01 = [
- "mapa/teleport_wybor_2_pustynia.tga",
- "mapa/teleport_wybor_2_orki.tga",
- "mapa/teleport_wybor_2_lodowa.tga",
- "mapa/teleport_wybor_2_red_las.tga",
- "mapa/teleport_wybor_2_pieklo.tga",
- "mapa/teleport_wybor_2_rogun.tga",
- "mapa/teleport_wybor_2_zak_las.tga",
- "mapa/teleport_wybor_2_urodzaj.tga"
- ]
- POS_X3 = [69, 192, 318, 56, 203, 334, 76, 216, 368]
- POS_Y3 = [89, 55, 72, 197, 188, 188, 309, 304, 283]
- OBRAZKI3_01 = [
- "mapa/teleport_wybor_3_gildia_1.tga",
- "mapa/teleport_wybor_3_gildia_2.tga",
- "mapa/teleport_wybor_3_gildia_3.tga",
- "mapa/teleport_wybor_3_gildia_4.tga",
- "mapa/teleport_wybor_3_gildia_5.tga",
- "mapa/teleport_wybor_3_gildia_6.tga",
- "mapa/teleport_wybor_3_gildia_7.tga",
- "mapa/teleport_wybor_3_gildia_8.tga",
- "mapa/teleport_wybor_3_gildia_9.tga"
- ]
- LOKALIZACJE1 = [
- 1,#ID KRÓLESTWO CZERWONE (WSZEDZIE DAJESZ ID USTALONE W SRC)
- 2,#ID KRÓLESTWO NIEBIESKIE
- 3,#ID EXPOWISKA
- 4,#ID MAPA WOJENNA
- 5,#ID MAPA EVENTOWA
- 6,#ID MAPA GILDYJNA
- 7,#ID WYPRAWY
- ]
- LOKALIZACJE2 = [
- 1,#ID PUSTYNIA
- 2,#ID ORKI
- 3,#ID LODOWA
- 4,#ID RED LAS
- 5,#ID PIEKŁO
- 6,#ID ROGUN
- 7,#ID ZAKLĘTY LAS
- 8,#ID URODZAJ
- ]
- LOKALIZACJE3 = [
- 1,#ID GILDIA I
- 2,#ID GILDIA II
- 3,#ID GILDIA III
- 4,#ID GILDIA IV
- 5,#ID GILDIA V
- 6,#ID GILDIA VI
- 7,#ID GILDIA VII
- 8,#ID GILDIA VIII
- 9,#ID GILDIA IX
- ]
- class MapaTeleportacyjna(uimg.ThinBoard):
- przyciski1 = []
- przyciski2 = []
- przyciski3 = []
- def __init__(self):
- uimg.ThinBoard.__init__(self, "TOP_MOST")
- self.ZbudujOkno()
- def __del__(self):
- uimg.ThinBoard.__del__(self)
- def Destroy(self):
- self.Hide()
- return TRUE
- def ZbudujOkno(self):
- self.SetPosition(-50, -50)
- self.SetSize(wndMgr.GetScreenWidth()+100, wndMgr.GetScreenHeight()+100)
- self.AddFlag("float")
- self.Show()
- self.Mapa1 = uimg.ImageBox()
- self.Mapa1.LoadImage("mapa/teleport_wybor_1.tga")
- self.Mapa1.SetParent(self)
- self.Mapa1.SetCenterPosition(50,0)
- self.Mapa1.AddFlag("attach")
- self.Mapa1.Show()
- self.Mapa2 = uimg.ImageBox()
- self.Mapa2.LoadImage("mapa/teleport_wybor_2.tga")
- self.Mapa2.SetParent(self)
- self.Mapa2.SetCenterPosition(50,-30)
- self.Mapa2.AddFlag("attach")
- self.Mapa2.Hide()
- self.Mapa3 = uimg.ImageBox()
- self.Mapa3.LoadImage("mapa/teleport_wybor_3.tga")
- self.Mapa3.SetParent(self)
- self.Mapa3.SetCenterPosition(50,-30)
- self.Mapa3.AddFlag("attach")
- self.Mapa3.Hide()
- self.CancelButton = uimg.Button()
- self.CancelButton.SetParent(self)
- self.CancelButton.SetPosition(self.GetWidth()/2-29, self.GetHeight()/2+160)
- self.CancelButton.SetUpVisual("mapa/red_button_01.tga")
- self.CancelButton.SetOverVisual("mapa/red_button_02.tga")
- self.CancelButton.SetDownVisual("mapa/red_button_03.tga")
- self.CancelButton.SetText("Anuluj")
- self.CancelButton.SetEvent(self.Destroy)
- self.CancelButton.Show()
- for x in xrange(0,7):
- self.Przycisk = uimg.Button()
- self.Przycisk.SetParent(self.Mapa1)
- self.Przycisk.SetPosition(POS_X1[x], POS_Y1[x])
- self.Przycisk.SetUpVisual(OBRAZKI1_01[x])
- self.Przycisk.SetOverVisual(OBRAZKI1_02[x])
- self.Przycisk.SetDownVisual(OBRAZKI1_01[x])
- if x == 2:
- self.Przycisk.SetEvent(self.ExpMap)
- elif x == 5:
- self.Przycisk.SetEvent(self.GuildMap)
- else:
- self.Przycisk.SetEvent(uimg.__mem_func__(self.Teleportacja1), LOKALIZACJE1[x])
- self.Przycisk.Show()
- self.przyciski1.append(self.Przycisk)
- for x in xrange(0,8):
- self.Przycisk = uimg.Button()
- self.Przycisk.SetParent(self.Mapa2)
- self.Przycisk.SetPosition(POS_X2[x], POS_Y2[x])
- self.Przycisk.SetUpVisual(OBRAZKI2_01[x])
- self.Przycisk.SetOverVisual(OBRAZKI2_01[x])
- self.Przycisk.SetDownVisual(OBRAZKI2_01[x])
- self.Przycisk.SetEvent(uimg.__mem_func__(self.Teleportacja2), LOKALIZACJE2[x])
- self.Przycisk.Show()
- self.przyciski2.append(self.Przycisk)
- for x in xrange(0,9):
- self.Przycisk = uimg.Button()
- self.Przycisk.SetParent(self.Mapa3)
- self.Przycisk.SetPosition(POS_X3[x], POS_Y3[x])
- self.Przycisk.SetUpVisual(OBRAZKI3_01[x])
- self.Przycisk.SetOverVisual(OBRAZKI3_01[x])
- self.Przycisk.SetDownVisual(OBRAZKI3_01[x])
- self.Przycisk.SetEvent(uimg.__mem_func__(self.Teleportacja3), LOKALIZACJE3[x])
- self.Przycisk.Show()
- self.przyciski3.append(self.Przycisk)
- def ExpMap(self):
- self.Mapa1.Hide()
- self.Mapa2.Show()
- def GuildMap(self):
- self.Mapa1.Hide()
- self.Mapa3.Show()
- def Teleportacja1(self, id):
- net.SendChatPacket("/teleport1 "+str(id))
- self.Hide()
- def Teleportacja2(self, id):
- net.SendChatPacket("/teleport2 "+str(id))
- self.Hide()
- def Teleportacja3(self, id):
- net.SendChatPacket("/teleport3 "+str(id))
- self.Hide()
- def Open(self):
- self.Mapa1.Show()
- self.Mapa2.Hide()
- self.Mapa3.Hide()
- self.Show()
- def OnPressEscapeKey(self):
- self.Hide()
- return TRUE
- #MapaTeleportacyjna().Show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement