Advertisement
deadx2

Untitled

Aug 2nd, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. import app
  2. import constInfo
  3. import uimg
  4. import uiToolTip
  5. import item
  6. import localemg
  7. import player
  8. import grp
  9. import time
  10. import event
  11. import chat
  12. import chr
  13. import net
  14.  
  15. import wndMgr
  16.  
  17. POS_X1 = [330, 430, 95, 260, 130, 300, 100]
  18. POS_Y1 = [15, 105, 105, 175, 210, 300, 320]
  19. OBRAZKI1_01 = [
  20. "mapa/teleport_wybor_1_red.tga",
  21. "mapa/teleport_wybor_1_blue.tga",
  22. "mapa/teleport_wybor_1_exp.tga",
  23. "mapa/teleport_wybor_1_wojna.tga",
  24. "mapa/teleport_wybor_1_event.tga",
  25. "mapa/teleport_wybor_1_gilldia.tga",
  26. "mapa/teleport_wybor_1_wyprawy.tga"
  27. ]
  28. OBRAZKI1_02 = [
  29. "mapa/teleport_wybor_1_red.tga",
  30. "mapa/teleport_wybor_1_blue.tga",
  31. "mapa/teleport_wybor_1_exp.tga",
  32. "mapa/teleport_wybor_1_wojna.tga",
  33. "mapa/teleport_wybor_1_event.tga",
  34. "mapa/teleport_wybor_1_gilldia.tga",
  35. "mapa/teleport_wybor_1_wyprawy.tga"
  36. ]
  37.  
  38. POS_X2 = [60, 60, 215, 240, 205, 370, 365, 400]
  39. POS_Y2 = [335, 210, 340, 235, 140, 65, 175, 290]
  40. #POS_X2 = [370, 205, 365, 60, 240, 400, 60, 215]
  41. #POS_Y2 = [65, 140, 175, 210, 235, 290, 335, 340]
  42. '''
  43. OBRAZKI2_01 = [
  44. "mapa/teleport_wybor_2_rogun.tga",
  45. "mapa/teleport_wybor_2_pieklo.tga",
  46. "mapa/teleport_wybor_2_zak_las.tga",
  47. "mapa/teleport_wybor_2_orki.tga",
  48. "mapa/teleport_wybor_2_red_las.tga",
  49. "mapa/teleport_wybor_2_urodzaj.tga",
  50. "mapa/teleport_wybor_2_pustynia.tga",
  51. "mapa/teleport_wybor_2_lodowa.tga"]
  52. '''
  53. OBRAZKI2_01 = [
  54. "mapa/teleport_wybor_2_pustynia.tga",
  55. "mapa/teleport_wybor_2_orki.tga",
  56. "mapa/teleport_wybor_2_lodowa.tga",
  57. "mapa/teleport_wybor_2_red_las.tga",
  58. "mapa/teleport_wybor_2_pieklo.tga",
  59. "mapa/teleport_wybor_2_rogun.tga",
  60. "mapa/teleport_wybor_2_zak_las.tga",
  61. "mapa/teleport_wybor_2_urodzaj.tga"
  62. ]
  63.  
  64.  
  65. POS_X3 = [69, 192, 318, 56, 203, 334, 76, 216, 368]
  66. POS_Y3 = [89, 55, 72, 197, 188, 188, 309, 304, 283]
  67. OBRAZKI3_01 = [
  68. "mapa/teleport_wybor_3_gildia_1.tga",
  69. "mapa/teleport_wybor_3_gildia_2.tga",
  70. "mapa/teleport_wybor_3_gildia_3.tga",
  71. "mapa/teleport_wybor_3_gildia_4.tga",
  72. "mapa/teleport_wybor_3_gildia_5.tga",
  73. "mapa/teleport_wybor_3_gildia_6.tga",
  74. "mapa/teleport_wybor_3_gildia_7.tga",
  75. "mapa/teleport_wybor_3_gildia_8.tga",
  76. "mapa/teleport_wybor_3_gildia_9.tga"
  77. ]
  78.  
  79. LOKALIZACJE1 = [
  80. 1,#ID KRÓLESTWO CZERWONE (WSZEDZIE DAJESZ ID USTALONE W SRC)
  81. 2,#ID KRÓLESTWO NIEBIESKIE
  82. 3,#ID EXPOWISKA
  83. 4,#ID MAPA WOJENNA
  84. 5,#ID MAPA EVENTOWA
  85. 6,#ID MAPA GILDYJNA
  86. 7,#ID WYPRAWY
  87. ]
  88.  
  89. LOKALIZACJE2 = [
  90. 1,#ID PUSTYNIA
  91. 2,#ID ORKI
  92. 3,#ID LODOWA
  93. 4,#ID RED LAS
  94. 5,#ID PIEKŁO
  95. 6,#ID ROGUN
  96. 7,#ID ZAKLĘTY LAS
  97. 8,#ID URODZAJ
  98. ]
  99.  
  100. LOKALIZACJE3 = [
  101. 1,#ID GILDIA I
  102. 2,#ID GILDIA II
  103. 3,#ID GILDIA III
  104. 4,#ID GILDIA IV
  105. 5,#ID GILDIA V
  106. 6,#ID GILDIA VI
  107. 7,#ID GILDIA VII
  108. 8,#ID GILDIA VIII
  109. 9,#ID GILDIA IX
  110. ]
  111.  
  112. class MapaTeleportacyjna(uimg.ThinBoard):
  113. przyciski1 = []
  114. przyciski2 = []
  115. przyciski3 = []
  116. def __init__(self):
  117. uimg.ThinBoard.__init__(self, "TOP_MOST")
  118. self.ZbudujOkno()
  119.  
  120. def __del__(self):
  121. uimg.ThinBoard.__del__(self)
  122.  
  123. def Destroy(self):
  124. self.Hide()
  125. return TRUE
  126.  
  127. def ZbudujOkno(self):
  128. self.SetPosition(-50, -50)
  129. self.SetSize(wndMgr.GetScreenWidth()+100, wndMgr.GetScreenHeight()+100)
  130. self.AddFlag("float")
  131. self.Show()
  132.  
  133. self.Mapa1 = uimg.ImageBox()
  134. self.Mapa1.LoadImage("mapa/teleport_wybor_1.tga")
  135. self.Mapa1.SetParent(self)
  136. self.Mapa1.SetCenterPosition(50,0)
  137. self.Mapa1.AddFlag("attach")
  138. self.Mapa1.Show()
  139.  
  140. self.Mapa2 = uimg.ImageBox()
  141. self.Mapa2.LoadImage("mapa/teleport_wybor_2.tga")
  142. self.Mapa2.SetParent(self)
  143. self.Mapa2.SetCenterPosition(50,-30)
  144. self.Mapa2.AddFlag("attach")
  145. self.Mapa2.Hide()
  146.  
  147. self.Mapa3 = uimg.ImageBox()
  148. self.Mapa3.LoadImage("mapa/teleport_wybor_3.tga")
  149. self.Mapa3.SetParent(self)
  150. self.Mapa3.SetCenterPosition(50,-30)
  151. self.Mapa3.AddFlag("attach")
  152. self.Mapa3.Hide()
  153.  
  154. self.CancelButton = uimg.Button()
  155. self.CancelButton.SetParent(self)
  156. self.CancelButton.SetPosition(self.GetWidth()/2-29, self.GetHeight()/2+160)
  157. self.CancelButton.SetUpVisual("mapa/red_button_01.tga")
  158. self.CancelButton.SetOverVisual("mapa/red_button_02.tga")
  159. self.CancelButton.SetDownVisual("mapa/red_button_03.tga")
  160. self.CancelButton.SetText("Anuluj")
  161. self.CancelButton.SetEvent(self.Destroy)
  162. self.CancelButton.Show()
  163.  
  164. for x in xrange(0,7):
  165. self.Przycisk = uimg.Button()
  166. self.Przycisk.SetParent(self.Mapa1)
  167. self.Przycisk.SetPosition(POS_X1[x], POS_Y1[x])
  168. self.Przycisk.SetUpVisual(OBRAZKI1_01[x])
  169. self.Przycisk.SetOverVisual(OBRAZKI1_02[x])
  170. self.Przycisk.SetDownVisual(OBRAZKI1_01[x])
  171. if x == 2:
  172. self.Przycisk.SetEvent(self.ExpMap)
  173. elif x == 5:
  174. self.Przycisk.SetEvent(self.GuildMap)
  175. else:
  176. self.Przycisk.SetEvent(uimg.__mem_func__(self.Teleportacja1), LOKALIZACJE1[x])
  177. self.Przycisk.Show()
  178. self.przyciski1.append(self.Przycisk)
  179.  
  180. for x in xrange(0,8):
  181. self.Przycisk = uimg.Button()
  182. self.Przycisk.SetParent(self.Mapa2)
  183. self.Przycisk.SetPosition(POS_X2[x], POS_Y2[x])
  184. self.Przycisk.SetUpVisual(OBRAZKI2_01[x])
  185. self.Przycisk.SetOverVisual(OBRAZKI2_01[x])
  186. self.Przycisk.SetDownVisual(OBRAZKI2_01[x])
  187. self.Przycisk.SetEvent(uimg.__mem_func__(self.Teleportacja2), LOKALIZACJE2[x])
  188. self.Przycisk.Show()
  189. self.przyciski2.append(self.Przycisk)
  190.  
  191. for x in xrange(0,9):
  192. self.Przycisk = uimg.Button()
  193. self.Przycisk.SetParent(self.Mapa3)
  194. self.Przycisk.SetPosition(POS_X3[x], POS_Y3[x])
  195. self.Przycisk.SetUpVisual(OBRAZKI3_01[x])
  196. self.Przycisk.SetOverVisual(OBRAZKI3_01[x])
  197. self.Przycisk.SetDownVisual(OBRAZKI3_01[x])
  198. self.Przycisk.SetEvent(uimg.__mem_func__(self.Teleportacja3), LOKALIZACJE3[x])
  199. self.Przycisk.Show()
  200. self.przyciski3.append(self.Przycisk)
  201.  
  202. def ExpMap(self):
  203. self.Mapa1.Hide()
  204. self.Mapa2.Show()
  205.  
  206. def GuildMap(self):
  207. self.Mapa1.Hide()
  208. self.Mapa3.Show()
  209.  
  210. def Teleportacja1(self, id):
  211. net.SendChatPacket("/teleport1 "+str(id))
  212. self.Hide()
  213.  
  214. def Teleportacja2(self, id):
  215. net.SendChatPacket("/teleport2 "+str(id))
  216. self.Hide()
  217.  
  218. def Teleportacja3(self, id):
  219. net.SendChatPacket("/teleport3 "+str(id))
  220. self.Hide()
  221.  
  222. def Open(self):
  223. self.Mapa1.Show()
  224. self.Mapa2.Hide()
  225. self.Mapa3.Hide()
  226. self.Show()
  227.  
  228. def OnPressEscapeKey(self):
  229. self.Hide()
  230. return TRUE
  231.  
  232. #MapaTeleportacyjna().Show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement