Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 80.81 KB | None | 0 0
  1. ##
  2. ## Interface
  3. ##
  4. import constInfo
  5. import systemSetting
  6. import wndMgr
  7. import chat
  8. import app
  9. import player
  10. import uiTaskBar
  11. import uiCharacter
  12. import uiInventory
  13. import uiDragonSoul
  14. import uiChat
  15. import uiMessenger
  16. import guild
  17.  
  18. import ui
  19. import uiHelp
  20. import uiWhisper
  21. import uiPointReset
  22. import uiShop
  23. import uiExchange
  24. import uiSystem
  25. import uiRestart
  26. import uiToolTip
  27. import uiMiniMap
  28. import uiParty
  29. import uiSafebox
  30. import uiGuild
  31. import uiQuest
  32. import uiPrivateShopBuilder
  33. import uiCommon
  34. import uiRefine
  35. import uiEquipmentDialog
  36. import uiGameButton
  37. import uiTip
  38. import uiCube
  39. import miniMap
  40. # ACCESSORY_REFINE_ADD_METIN_STONE
  41. import uiselectitem
  42. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  43. import uiScriptLocale
  44. import net
  45. if app.ENABLE_SHOW_CHEST_DROP:
  46. import uiChestDrop
  47. if app.ENABLE_MINI_GAME:
  48. import uiMiniGame
  49. import uiDice
  50. import event
  51. import localeInfo
  52. if app.LINK_IN_CHAT:
  53. import os
  54. if app.ENABLE_SASH_SYSTEM:
  55. import uisash
  56.  
  57. if app.ENABLE_CHANGELOOK_SYSTEM:
  58. import uichangelook
  59.  
  60. import chr
  61. if app.ENABLE_SPECIAL_STORAGE:
  62. import uiSpecialStorage
  63. IsQBHide = 0
  64. class Interface(object):
  65. CHARACTER_STATUS_TAB = 1
  66. CHARACTER_SKILL_TAB = 2
  67.  
  68. class NewGoldChat(ui.Window):
  69. def __init__(self, parent = None, x = 0, y = 0):
  70. ui.Window.__init__(self)
  71. self.texts = {}
  72. self.parent = parent
  73. self.SpaceBet = 14
  74. self.maxY = 0
  75. self.x = x
  76. self.y = y
  77. self.ColorValue = 0xFFFFFFFF
  78.  
  79. self.show = self.Button('Show Yang', x, y+3, self.showYang, 'sanyed_yang/btn_expand_normal.tga', 'sanyed_yang/btn_expand_over.tga', 'sanyed_yang/btn_expand_down.tga')
  80. self.hide = self.Button('Hide Yang', x, y+3, self.hideYang, 'sanyed_yang/btn_minimize_normal.tga', 'sanyed_yang/btn_minimize_over.tga', 'sanyed_yang/btn_minimize_down.tga')
  81. self.show.Hide()
  82. self.Show()
  83.  
  84. def Button(self, tooltipText, x, y, func, UpVisual, OverVisual, DownVisual):
  85. button = ui.Button()
  86. if self.parent != None:
  87. button.SetParent(self.parent)
  88. button.SetPosition(x, y)
  89. button.SetUpVisual(UpVisual)
  90. button.SetOverVisual(OverVisual)
  91. button.SetDownVisual(DownVisual)
  92. button.SetToolTipText(tooltipText)
  93. button.Show()
  94. button.SetEvent(func)
  95. return button
  96.  
  97. def showYang(self):
  98. for i in xrange(len(self.texts)):
  99. self.texts[i].Show()
  100. self.hide.Show()
  101. self.show.Hide()
  102. self.Show()
  103.  
  104. def hideYang(self):
  105. for i in xrange(len(self.texts)):
  106. self.texts[i].Hide()
  107. self.hide.Hide()
  108. self.show.Show()
  109. self.Hide()
  110.  
  111. def GetMaxY(self):
  112. return self.maxY
  113.  
  114. def AddGoldValue(self, text):
  115. for i in xrange(len(self.texts)):
  116. if len(self.texts) == 10 and i == 0:
  117. self.texts[i].Hide()
  118. x, y = self.texts[i].GetLocalPosition()
  119. self.texts[i].SetPosition(x, y-self.SpaceBet)
  120.  
  121. i = 0
  122. if len(self.texts) == 10:
  123. for i in xrange(len(self.texts)-1):
  124. self.texts[i] = self.texts[i+1]
  125. i = 9
  126. else:
  127. i = len(self.texts)
  128.  
  129. self.texts[i] = ui.TextLine("Tahoma:14")
  130. if self.parent != None:
  131. self.texts[i].SetParent(self.parent)
  132. self.texts[i].SetPosition(self.x, self.y)
  133. self.texts[i].SetPackedFontColor(self.ColorValue)
  134. self.texts[i].SetHorizontalAlignLeft()
  135. self.texts[i].SetOutline(TRUE)
  136. self.texts[i].SetText(text)
  137. if self.hide.IsShow():
  138. self.texts[i].Show()
  139.  
  140. if self.hide.IsShow():
  141. x, y = self.texts[0].GetLocalPosition()
  142. x2, y2 = self.hide.GetLocalPosition()
  143. self.hide.SetPosition(x2, y-10)
  144.  
  145. def ClearAll(self):
  146. self.Hide()
  147. self.texts = {}
  148. self.show.Hide()
  149. self.show = None
  150. self.hide.Hide()
  151. self.hide = None
  152.  
  153. def OnRender(self):
  154. if len(self.texts) > 0 and self.hide.IsShow():
  155. x, y = self.hide.GetGlobalPosition()
  156. w, h = self.texts[0].GetTextSize()
  157. grp.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.5))
  158. grp.RenderBar(x, y+h-6, 108, h*len(self.texts)+4)
  159.  
  160. def __init__(self):
  161. systemSetting.SetInterfaceHandler(self)
  162. self.windowOpenPosition = 0
  163. self.dlgWhisperWithoutTarget = None
  164. self.inputDialog = None
  165. self.tipBoard = None
  166. self.bigBoard = None
  167. self.wndGiftBox = None
  168. # ITEM_MALL
  169. self.mallPageDlg = None
  170. # END_OF_ITEM_MALL
  171.  
  172. self.wndWeb = None
  173. self.wndTaskBar = None
  174. self.wndCharacter = None
  175. self.wndInventory = None
  176. self.wndExpandedTaskBar = None
  177. self.wndDragonSoul = None
  178. self.wndDragonSoulRefine = None
  179. self.wndChat = None
  180. self.yangText = None
  181. self.wndMessenger = None
  182. self.wndMiniMap = None
  183. self.wndGuild = None
  184. if app.ENABLE_SHOW_CHEST_DROP:
  185. self.dlgChestDrop = None
  186. self.wndGuildBuilding = None
  187. if app.LINK_IN_CHAT:
  188. self.OpenLinkQuestionDialog = None
  189. if app.ENABLE_SPECIAL_STORAGE:
  190. self.wndSpecialStorage = None
  191.  
  192. self.listGMName = {}
  193. self.wndQuestWindow = {}
  194. self.wndQuestWindowNewKey = 0
  195. self.privateShopAdvertisementBoardDict = {}
  196. self.guildScoreBoardDict = {}
  197. self.equipmentDialogDict = {}
  198. if app.ENABLE_MINI_GAME:
  199. self.wndMiniGame = None
  200. self.miniGameList = []
  201.  
  202. event.SetInterfaceWindow(self)
  203.  
  204. def __OnClickGiftButton(self):
  205. if self.wndGameButton:
  206. if not self.wndGiftBox.IsShow():
  207. self.wndGiftBox.Open()
  208. else:
  209. self.wndGiftBox.Close()
  210.  
  211. def ClearGift(self):
  212. if self.wndGameButton:
  213. self.wndGameButton.HideGiftButton()
  214. if self.wndGiftBox:
  215. self.wndGiftBox.Clear()
  216. self.wndGiftBox.Refresh()
  217.  
  218. def __del__(self):
  219. systemSetting.DestroyInterfaceHandler()
  220. event.SetInterfaceWindow(None)
  221.  
  222. def SetStream(self, stream):
  223. self.stream = stream
  224.  
  225. ################################
  226. ## Make Windows & Dialogs
  227. def __MakeUICurtain(self):
  228. wndUICurtain = ui.Bar("TOP_MOST")
  229. wndUICurtain.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  230. wndUICurtain.SetColor(0x77000000)
  231. wndUICurtain.Hide()
  232. self.wndUICurtain = wndUICurtain
  233.  
  234. def __MakeMessengerWindow(self):
  235. self.wndMessenger = uiMessenger.MessengerWindow()
  236.  
  237. from _weakref import proxy
  238. self.wndMessenger.SetWhisperButtonEvent(lambda n,i=proxy(self):i.OpenWhisperDialog(n))
  239. self.wndMessenger.SetGuildButtonEvent(ui.__mem_func__(self.ToggleGuildWindow))
  240.  
  241. def __MakeGuildWindow(self):
  242. self.wndGuild = uiGuild.GuildWindow()
  243.  
  244. def __MakeChatWindow(self):
  245.  
  246. wndChat = uiChat.ChatWindow()
  247.  
  248. wndChat.SetSize(wndChat.CHAT_WINDOW_WIDTH, 0)
  249. wndChat.SetPosition(wndMgr.GetScreenWidth()/2 - wndChat.CHAT_WINDOW_WIDTH/2, wndMgr.GetScreenHeight() - wndChat.EDIT_LINE_HEIGHT - 37)
  250. wndChat.SetHeight(200)
  251. wndChat.Refresh()
  252. wndChat.Show()
  253.  
  254. self.wndChat = wndChat
  255. self.wndChat.BindInterface(self)
  256. self.wndChat.SetSendWhisperEvent(ui.__mem_func__(self.OpenWhisperDialogWithoutTarget))
  257. self.wndChat.SetOpenChatLogEvent(ui.__mem_func__(self.ToggleChatLogWindow))
  258. if self.yangText:
  259. self.yangText.Hide()
  260. yangText = self.NewGoldChat(None, wndMgr.GetScreenWidth()/2 - wndChat.CHAT_WINDOW_WIDTH/2 + 600, wndMgr.GetScreenHeight() - wndChat.EDIT_LINE_HEIGHT - 37 + 9)
  261. self.yangText = yangText
  262.  
  263. def OnPickMoneyNew(self, money):
  264. self.yangText.AddGoldValue("+%s"%(localeInfo.NumberToMoneyString(money)))
  265.  
  266. def __MakeTaskBar(self):
  267. wndTaskBar = uiTaskBar.TaskBar()
  268. wndTaskBar.LoadWindow()
  269. self.wndTaskBar = wndTaskBar
  270. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHARACTER, ui.__mem_func__(self.ToggleCharacterWindowStatusPage))
  271. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_INVENTORY, ui.__mem_func__(self.ToggleInventoryWindow))
  272. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_MESSENGER, ui.__mem_func__(self.ToggleMessenger))
  273. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_SYSTEM, ui.__mem_func__(self.ToggleSystemDialog))
  274. if uiTaskBar.TaskBar.IS_EXPANDED:
  275. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_EXPAND, ui.__mem_func__(self.ToggleExpandedButton))
  276. self.wndExpandedTaskBar = uiTaskBar.ExpandedTaskBar()
  277. self.wndExpandedTaskBar.LoadWindow()
  278. self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, ui.__mem_func__(self.ToggleDragonSoulWindow))
  279. self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_PET_GUI, ui.__mem_func__(self.TogglePetMain))
  280.  
  281. else:
  282. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHAT, ui.__mem_func__(self.ToggleChat))
  283.  
  284. self.wndEnergyBar = None
  285. import app
  286. if app.ENABLE_ENERGY_SYSTEM:
  287. wndEnergyBar = uiTaskBar.EnergyBar()
  288. wndEnergyBar.LoadWindow()
  289. self.wndEnergyBar = wndEnergyBar
  290.  
  291. import uiGift
  292. wndGiftBox=uiGift.GiftDialog()
  293. wndGiftBox.Hide()
  294. self.wndGiftBox=wndGiftBox
  295.  
  296. def __MakeParty(self):
  297. wndParty = uiParty.PartyWindow()
  298. wndParty.Hide()
  299. self.wndParty = wndParty
  300.  
  301. def __MakeGameButtonWindow(self):
  302. wndGameButton = uiGameButton.GameButtonWindow()
  303. wndGameButton.SetTop()
  304. wndGameButton.Show()
  305. wndGameButton.SetButtonEvent("STATUS", ui.__mem_func__(self.__OnClickStatusPlusButton))
  306. wndGameButton.SetButtonEvent("SKILL", ui.__mem_func__(self.__OnClickSkillPlusButton))
  307. wndGameButton.SetButtonEvent("QUEST", ui.__mem_func__(self.__OnClickQuestButton))
  308. wndGameButton.SetButtonEvent("HELP", ui.__mem_func__(self.__OnClickHelpButton))
  309. wndGameButton.SetButtonEvent("BUILD", ui.__mem_func__(self.__OnClickBuildButton))
  310. wndGameButton.SetButtonEvent("GIFT", ui.__mem_func__(self.__OnClickGiftButton))
  311.  
  312. self.wndGameButton = wndGameButton
  313.  
  314. def __IsChatOpen(self):
  315. return True
  316.  
  317. def __MakeWindows(self):
  318. wndCharacter = uiCharacter.CharacterWindow()
  319. wndInventory = uiInventory.InventoryWindow()
  320. wndInventory.BindInterfaceClass(self)
  321. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  322. wndDragonSoul = uiDragonSoul.DragonSoulWindow()
  323. wndDragonSoulRefine = uiDragonSoul.DragonSoulRefineWindow()
  324. else:
  325. wndDragonSoul = None
  326. wndDragonSoulRefine = None
  327.  
  328. wndMiniMap = uiMiniMap.MiniMap()
  329. wndSafebox = uiSafebox.SafeboxWindow()
  330.  
  331. # ITEM_MALL
  332. wndMall = uiSafebox.MallWindow()
  333. self.wndMall = wndMall
  334. # END_OF_ITEM_MALL
  335.  
  336. wndChatLog = uiChat.ChatLogWindow()
  337. wndChatLog.BindInterface(self)
  338.  
  339. self.wndCharacter = wndCharacter
  340. self.wndInventory = wndInventory
  341. self.wndDragonSoul = wndDragonSoul
  342. self.wndDragonSoulRefine = wndDragonSoulRefine
  343. self.wndMiniMap = wndMiniMap
  344. self.wndSafebox = wndSafebox
  345. self.wndChatLog = wndChatLog
  346. if app.ENABLE_SHOW_CHEST_DROP:
  347. self.dlgChestDrop = uiChestDrop.ChestDropWindow()
  348.  
  349. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  350. self.wndDragonSoul.SetDragonSoulRefineWindow(self.wndDragonSoulRefine)
  351. self.wndDragonSoulRefine.SetInventoryWindows(self.wndInventory, self.wndDragonSoul)
  352. self.wndInventory.SetDragonSoulRefineWindow(self.wndDragonSoulRefine)
  353. if app.ENABLE_SPECIAL_STORAGE:
  354. self.wndSpecialStorage = uiSpecialStorage.SpecialStorageWindow()
  355. else:
  356. self.wndSpecialStorage = None
  357.  
  358. def __MakeDialogs(self):
  359. self.dlgExchange = uiExchange.ExchangeDialog()
  360. self.dlgExchange.LoadDialog()
  361. self.dlgExchange.SetCenterPosition()
  362. self.dlgExchange.Hide()
  363.  
  364. self.dlgDice = uiDice.DiceDialog()
  365. self.dlgDice.LoadWindow()
  366. self.dlgDice.SetCenterPosition()
  367. self.dlgDice.Hide()
  368.  
  369. self.dlgPointReset = uiPointReset.PointResetDialog()
  370. self.dlgPointReset.LoadDialog()
  371. self.dlgPointReset.Hide()
  372.  
  373. self.dlgShop = uiShop.ShopDialog()
  374. self.dlgShop.LoadDialog()
  375. self.dlgShop.Hide()
  376.  
  377. self.dlgRestart = uiRestart.RestartDialog()
  378. self.dlgRestart.LoadDialog()
  379. self.dlgRestart.Hide()
  380.  
  381. self.dlgSystem = uiSystem.SystemDialog(self.stream)
  382. self.dlgSystem.LoadDialog()
  383. self.dlgSystem.SetOpenHelpWindowEvent(ui.__mem_func__(self.OpenHelpWindow))
  384.  
  385. self.dlgSystem.Hide()
  386.  
  387. self.dlgPassword = uiSafebox.PasswordDialog()
  388. self.dlgPassword.Hide()
  389.  
  390. self.hyperlinkItemTooltip = uiToolTip.HyperlinkItemToolTip()
  391. self.hyperlinkItemTooltip.Hide()
  392.  
  393. self.tooltipItem = uiToolTip.ItemToolTip()
  394. self.tooltipItem.Hide()
  395.  
  396. self.tooltipSkill = uiToolTip.SkillToolTip()
  397. self.tooltipSkill.Hide()
  398.  
  399. self.privateShopBuilder = uiPrivateShopBuilder.PrivateShopBuilder()
  400. self.privateShopBuilder.Hide()
  401.  
  402. self.dlgRefineNew = uiRefine.RefineDialogNew()
  403. self.dlgRefineNew.Hide()
  404.  
  405. def __MakeHelpWindow(self):
  406. self.wndHelp = uiHelp.HelpWindow()
  407. self.wndHelp.LoadDialog()
  408. self.wndHelp.SetCloseEvent(ui.__mem_func__(self.CloseHelpWindow))
  409. self.wndHelp.Hide()
  410.  
  411. def __MakeTipBoard(self):
  412. self.tipBoard = uiTip.TipBoard()
  413. self.tipBoard.Hide()
  414.  
  415. self.bigBoard = uiTip.BigBoard()
  416. self.bigBoard.Hide()
  417.  
  418. def __MakeWebWindow(self):
  419. if constInfo.IN_GAME_SHOP_ENABLE:
  420. import uiWeb
  421. self.wndWeb = uiWeb.WebWindow()
  422. self.wndWeb.LoadWindow()
  423. self.wndWeb.Hide()
  424.  
  425. if app.ENABLE_SASH_SYSTEM:
  426. def __MakeSashWindow(self):
  427. self.wndSashCombine = uisash.CombineWindow()
  428. self.wndSashCombine.LoadWindow()
  429. self.wndSashCombine.Hide()
  430.  
  431. self.wndSashAbsorption = uisash.AbsorbWindow()
  432. self.wndSashAbsorption.LoadWindow()
  433. self.wndSashAbsorption.Hide()
  434.  
  435. if self.wndInventory:
  436. self.wndInventory.SetSashWindow(self.wndSashCombine, self.wndSashAbsorption)
  437.  
  438. if app.ENABLE_CHANGELOOK_SYSTEM:
  439. def __MakeChangeLookWindow(self):
  440. self.wndChangeLook = uichangelook.Window()
  441. self.wndChangeLook.LoadWindow()
  442. self.wndChangeLook.Hide()
  443.  
  444. if self.wndInventory:
  445. self.wndInventory.SetChangeLookWindow(self.wndChangeLook)
  446.  
  447. def __MakeCubeWindow(self):
  448. self.wndCube = uiCube.CubeWindow()
  449. self.wndCube.LoadWindow()
  450. self.wndCube.Hide()
  451.  
  452. def __MakeCubeResultWindow(self):
  453. self.wndCubeResult = uiCube.CubeResultWindow()
  454. self.wndCubeResult.LoadWindow()
  455. self.wndCubeResult.Hide()
  456.  
  457. # ACCESSORY_REFINE_ADD_METIN_STONE
  458. def __MakeItemSelectWindow(self):
  459. self.wndItemSelect = uiselectitem.SelectItemWindow()
  460. self.wndItemSelect.Hide()
  461. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  462.  
  463. def MakeInterface(self):
  464. self.__MakeMessengerWindow()
  465. self.__MakeGuildWindow()
  466. self.__MakeChatWindow()
  467. self.__MakeParty()
  468. self.__MakeWindows()
  469. self.__MakeDialogs()
  470.  
  471. self.__MakeUICurtain()
  472. self.__MakeTaskBar()
  473. self.__MakeGameButtonWindow()
  474. self.__MakeHelpWindow()
  475. self.__MakeTipBoard()
  476. self.__MakeWebWindow()
  477. if app.ENABLE_SASH_SYSTEM:
  478. self.__MakeSashWindow()
  479. if app.ENABLE_CHANGELOOK_SYSTEM:
  480. self.__MakeChangeLookWindow()
  481. self.__MakeCubeWindow()
  482. self.__MakeCubeResultWindow()
  483.  
  484.  
  485. # ACCESSORY_REFINE_ADD_METIN_STONE
  486. self.__MakeItemSelectWindow()
  487. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  488.  
  489. self.questButtonList = []
  490. self.whisperButtonList = []
  491. self.whisperDialogDict = {}
  492. self.privateShopAdvertisementBoardDict = {}
  493.  
  494. self.wndInventory.SetItemToolTip(self.tooltipItem)
  495. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  496. self.wndDragonSoul.SetItemToolTip(self.tooltipItem)
  497. self.wndDragonSoulRefine.SetItemToolTip(self.tooltipItem)
  498. self.wndSafebox.SetItemToolTip(self.tooltipItem)
  499. if app.ENABLE_SASH_SYSTEM:
  500. self.wndSashCombine.SetItemToolTip(self.tooltipItem)
  501. self.wndSashAbsorption.SetItemToolTip(self.tooltipItem)
  502. if app.ENABLE_CHANGELOOK_SYSTEM:
  503. self.wndChangeLook.SetItemToolTip(self.tooltipItem)
  504. self.wndCube.SetItemToolTip(self.tooltipItem)
  505. self.wndCubeResult.SetItemToolTip(self.tooltipItem)
  506. if app.ENABLE_SPECIAL_STORAGE:
  507. self.wndSpecialStorage.SetItemToolTip(self.tooltipItem)
  508.  
  509. # ITEM_MALL
  510. self.wndMall.SetItemToolTip(self.tooltipItem)
  511. # END_OF_ITEM_MALL
  512.  
  513. self.wndCharacter.SetSkillToolTip(self.tooltipSkill)
  514. self.wndTaskBar.SetItemToolTip(self.tooltipItem)
  515. self.wndTaskBar.SetSkillToolTip(self.tooltipSkill)
  516. self.wndGuild.SetSkillToolTip(self.tooltipSkill)
  517.  
  518. # ACCESSORY_REFINE_ADD_METIN_STONE
  519. self.wndItemSelect.SetItemToolTip(self.tooltipItem)
  520. if app.ENABLE_SHOW_CHEST_DROP:
  521. self.dlgChestDrop.SetItemToolTip(self.tooltipItem)
  522. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  523.  
  524. self.dlgShop.SetItemToolTip(self.tooltipItem)
  525. self.dlgExchange.SetItemToolTip(self.tooltipItem)
  526. self.privateShopBuilder.SetItemToolTip(self.tooltipItem)
  527. self.dlgDice.SetItemToolTip(self.tooltipItem)
  528.  
  529. self.__InitWhisper()
  530. self.DRAGON_SOUL_IS_QUALIFIED = False
  531. if app.ENABLE_MINI_GAME:
  532. self.IntegrationEventBanner()
  533.  
  534. if app.LINK_IN_CHAT:
  535. def AnswerOpenLink(self, answer):
  536. if not self.OpenLinkQuestionDialog:
  537. return
  538.  
  539. self.OpenLinkQuestionDialog.Close()
  540. self.OpenLinkQuestionDialog = None
  541.  
  542. if not answer:
  543. return
  544.  
  545. link = constInfo.link
  546. os.system(link)
  547.  
  548. def MakeHyperlinkTooltip(self, hyperlink):
  549. tokens = hyperlink.split(":")
  550. if tokens and len(tokens):
  551. type = tokens[0]
  552. if "item" == type:
  553. self.hyperlinkItemTooltip.SetHyperlinkItem(tokens)
  554. elif "msg" == type and str(tokens[1]) != player.GetMainCharacterName():
  555. self.OpenWhisperDialog(str(tokens[1]))
  556. elif app.LINK_IN_CHAT and "web" == type and tokens[1].startswith("httpXxX") or "web" == type and tokens[1].startswith("httpsXxX"):
  557. OpenLinkQuestionDialog = uiCommon.QuestionDialog2()
  558. OpenLinkQuestionDialog.SetText1(localeInfo.CHAT_OPEN_LINK_DANGER)
  559. OpenLinkQuestionDialog.SetText2(localeInfo.CHAT_OPEN_LINK)
  560. OpenLinkQuestionDialog.SetAcceptEvent(lambda arg=TRUE: self.AnswerOpenLink(arg))
  561. OpenLinkQuestionDialog.SetCancelEvent(lambda arg=FALSE: self.AnswerOpenLink(arg))
  562. constInfo.link = "start " + tokens[1].replace("XxX", "://").replace("&","^&")
  563. OpenLinkQuestionDialog.Open()
  564. self.OpenLinkQuestionDialog = OpenLinkQuestionDialog
  565. elif app.LINK_IN_CHAT and "sysweb" == type:
  566. os.system("start " + tokens[1].replace("XxX", "://"))
  567.  
  568. ## Make Windows & Dialogs
  569. ################################
  570.  
  571. def Close(self):
  572. if self.dlgWhisperWithoutTarget:
  573. self.dlgWhisperWithoutTarget.Destroy()
  574. del self.dlgWhisperWithoutTarget
  575.  
  576. if uiQuest.QuestDialog.__dict__.has_key("QuestCurtain"):
  577. uiQuest.QuestDialog.QuestCurtain.Close()
  578.  
  579. if self.wndQuestWindow:
  580. for key, eachQuestWindow in self.wndQuestWindow.items():
  581. eachQuestWindow.nextCurtainMode = -1
  582. eachQuestWindow.CloseSelf()
  583. eachQuestWindow = None
  584. self.wndQuestWindow = {}
  585.  
  586. if self.wndChat:
  587. self.wndChat.Destroy()
  588.  
  589. if self.yangText:
  590. self.yangText.ClearAll()
  591.  
  592. if self.wndTaskBar:
  593. self.wndTaskBar.Destroy()
  594.  
  595. if self.wndExpandedTaskBar:
  596. self.wndExpandedTaskBar.Destroy()
  597.  
  598. if self.wndEnergyBar:
  599. self.wndEnergyBar.Destroy()
  600.  
  601. if self.wndCharacter:
  602. self.wndCharacter.Destroy()
  603.  
  604. if self.wndInventory:
  605. self.wndInventory.Destroy()
  606.  
  607. if self.wndDragonSoul:
  608. self.wndDragonSoul.Destroy()
  609.  
  610. if self.wndDragonSoulRefine:
  611. self.wndDragonSoulRefine.Destroy()
  612.  
  613. if app.ENABLE_SPECIAL_STORAGE:
  614. if self.wndSpecialStorage:
  615. self.wndSpecialStorage.Destroy()
  616.  
  617. if self.dlgExchange:
  618. self.dlgExchange.Destroy()
  619.  
  620. if self.dlgDice:
  621. self.dlgDice.Destroy()
  622.  
  623. if self.dlgPointReset:
  624. self.dlgPointReset.Destroy()
  625.  
  626. if self.dlgShop:
  627. self.dlgShop.Destroy()
  628.  
  629. if self.dlgRestart:
  630. self.dlgRestart.Destroy()
  631.  
  632. if self.dlgSystem:
  633. self.dlgSystem.Destroy()
  634.  
  635. if self.dlgPassword:
  636. self.dlgPassword.Destroy()
  637.  
  638. if self.wndMiniMap:
  639. self.wndMiniMap.Destroy()
  640.  
  641. if self.wndSafebox:
  642. self.wndSafebox.Destroy()
  643.  
  644. if self.wndWeb:
  645. self.wndWeb.Destroy()
  646. self.wndWeb = None
  647.  
  648. if self.wndMall:
  649. self.wndMall.Destroy()
  650.  
  651. if self.wndParty:
  652. self.wndParty.Destroy()
  653.  
  654. if self.wndHelp:
  655. self.wndHelp.Destroy()
  656.  
  657. if app.ENABLE_SASH_SYSTEM:
  658. if self.wndSashCombine:
  659. self.wndSashCombine.Destroy()
  660.  
  661. if self.wndSashAbsorption:
  662. self.wndSashAbsorption.Destroy()
  663.  
  664. if app.ENABLE_CHANGELOOK_SYSTEM:
  665. if self.wndChangeLook:
  666. self.wndChangeLook.Destroy()
  667.  
  668. if self.wndCube:
  669. self.wndCube.Destroy()
  670.  
  671. if self.wndCubeResult:
  672. self.wndCubeResult.Destroy()
  673.  
  674. if self.wndMessenger:
  675. self.wndMessenger.Destroy()
  676.  
  677. if self.wndGuild:
  678. self.wndGuild.Destroy()
  679.  
  680. if self.privateShopBuilder:
  681. self.privateShopBuilder.Destroy()
  682.  
  683. if self.dlgRefineNew:
  684. self.dlgRefineNew.Destroy()
  685.  
  686. if self.wndGuildBuilding:
  687. self.wndGuildBuilding.Destroy()
  688.  
  689. if self.wndGameButton:
  690. self.wndGameButton.Destroy()
  691.  
  692. # ITEM_MALL
  693. if self.mallPageDlg:
  694. self.mallPageDlg.Destroy()
  695. if app.ENABLE_SHOW_CHEST_DROP:
  696. if self.dlgChestDrop:
  697. self.dlgChestDrop.Destroy()
  698. # END_OF_ITEM_MALL
  699.  
  700. # ACCESSORY_REFINE_ADD_METIN_STONE
  701. if self.wndItemSelect:
  702. self.wndItemSelect.Destroy()
  703. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  704.  
  705. if self.wndGiftBox:
  706. self.wndGiftBox.Clear()
  707. self.wndGiftBox.Hide()
  708. self.wndGiftBox.Destroy()
  709. del self.wndGiftBox
  710.  
  711. self.wndChatLog.Destroy()
  712. for btn in self.questButtonList:
  713. btn.SetEvent(0)
  714. for btn in self.whisperButtonList:
  715. btn.SetEvent(0)
  716. for dlg in self.whisperDialogDict.itervalues():
  717. dlg.Destroy()
  718. for brd in self.guildScoreBoardDict.itervalues():
  719. brd.Destroy()
  720. for dlg in self.equipmentDialogDict.itervalues():
  721. dlg.Destroy()
  722.  
  723. # ITEM_MALL
  724. del self.mallPageDlg
  725. # END_OF_ITEM_MALL
  726.  
  727. del self.wndGuild
  728. del self.wndMessenger
  729. del self.wndUICurtain
  730. del self.wndChat
  731. del self.yangText
  732. del self.wndTaskBar
  733. if self.wndExpandedTaskBar:
  734. del self.wndExpandedTaskBar
  735. del self.wndEnergyBar
  736. del self.wndCharacter
  737. del self.wndInventory
  738. if self.wndDragonSoul:
  739. del self.wndDragonSoul
  740. if self.wndDragonSoulRefine:
  741. del self.wndDragonSoulRefine
  742. if app.ENABLE_SPECIAL_STORAGE:
  743. if self.wndSpecialStorage:
  744. del self.wndSpecialStorage
  745. del self.dlgExchange
  746. del self.dlgDice
  747. del self.dlgPointReset
  748. del self.dlgShop
  749. del self.dlgRestart
  750. del self.dlgSystem
  751. del self.dlgPassword
  752. del self.hyperlinkItemTooltip
  753. del self.tooltipItem
  754. del self.tooltipSkill
  755. del self.wndMiniMap
  756. del self.wndSafebox
  757. del self.wndMall
  758. del self.wndParty
  759. del self.wndHelp
  760. if app.ENABLE_SASH_SYSTEM:
  761. del self.wndSashCombine
  762. del self.wndSashAbsorption
  763. if app.ENABLE_CHANGELOOK_SYSTEM:
  764. del self.wndChangeLook
  765. del self.wndCube
  766. del self.wndCubeResult
  767. del self.privateShopBuilder
  768. del self.inputDialog
  769. del self.wndChatLog
  770. del self.dlgRefineNew
  771. del self.wndGuildBuilding
  772. del self.wndGameButton
  773. del self.tipBoard
  774. del self.bigBoard
  775. del self.wndItemSelect
  776. if app.ENABLE_SHOW_CHEST_DROP:
  777. if self.dlgChestDrop:
  778. del self.dlgChestDrop
  779. if app.ENABLE_MINI_GAME:
  780. if self.wndMiniGame:
  781. self.wndMiniGame.Destroy()
  782. del self.wndMiniGame
  783.  
  784. self.questButtonList = []
  785. self.whisperButtonList = []
  786. self.whisperDialogDict = {}
  787. self.privateShopAdvertisementBoardDict = {}
  788. self.guildScoreBoardDict = {}
  789. self.equipmentDialogDict = {}
  790.  
  791. uiChat.DestroyChatInputSetWindow()
  792.  
  793. def OpenGift(self):
  794. if self.wndGameButton:
  795. self.wndGameButton.ShowGiftButton()
  796.  
  797. ## Skill
  798. def OnUseSkill(self, slotIndex, coolTime):
  799. self.wndCharacter.OnUseSkill(slotIndex, coolTime)
  800. self.wndTaskBar.OnUseSkill(slotIndex, coolTime)
  801. self.wndGuild.OnUseSkill(slotIndex, coolTime)
  802.  
  803. def OnActivateSkill(self, slotIndex):
  804. self.wndCharacter.OnActivateSkill(slotIndex)
  805. self.wndTaskBar.OnActivateSkill(slotIndex)
  806.  
  807. def OnDeactivateSkill(self, slotIndex):
  808. self.wndCharacter.OnDeactivateSkill(slotIndex)
  809. self.wndTaskBar.OnDeactivateSkill(slotIndex)
  810.  
  811. def OnChangeCurrentSkill(self, skillSlotNumber):
  812. self.wndTaskBar.OnChangeCurrentSkill(skillSlotNumber)
  813.  
  814. def SelectMouseButtonEvent(self, dir, event):
  815. self.wndTaskBar.SelectMouseButtonEvent(dir, event)
  816.  
  817. ## Refresh
  818. def RefreshAlignment(self):
  819. self.wndCharacter.RefreshAlignment()
  820.  
  821. def RefreshStatus(self):
  822. self.wndTaskBar.RefreshStatus()
  823. self.wndCharacter.RefreshStatus()
  824. self.wndInventory.RefreshStatus()
  825. if self.wndEnergyBar:
  826. self.wndEnergyBar.RefreshStatus()
  827. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  828. self.wndDragonSoul.RefreshStatus()
  829.  
  830. def RefreshStamina(self):
  831. self.wndTaskBar.RefreshStamina()
  832.  
  833. def RefreshSkill(self):
  834. self.wndCharacter.RefreshSkill()
  835. self.wndTaskBar.RefreshSkill()
  836.  
  837. def RefreshInventory(self):
  838. self.wndTaskBar.RefreshQuickSlot()
  839. if app.ENABLE_SPECIAL_STORAGE:
  840. self.wndSpecialStorage.RefreshItemSlot()
  841. self.wndInventory.RefreshItemSlot()
  842. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  843. self.wndDragonSoul.RefreshItemSlot()
  844. if app.ENABLE_SPECIAL_STORAGE:
  845. self.wndSpecialStorage.RefreshItemSlot()
  846.  
  847. if app.ADD_INVENTORY:
  848. def SetInventoryPageKilit(self):
  849. if constInfo.envanter == 2:#3 envanter
  850. if player.GetEnvanter() == 0:#Hepsi kapali
  851. self.wndInventory.engelblack.Show()#open
  852. self.wndInventory.engelblackcl.Hide()
  853. self.wndInventory.engelblack2.Hide()
  854. self.wndInventory.engelblack2cl.Show()#close
  855. self.wndInventory.engelblack3.Hide()
  856. self.wndInventory.engelblack3cl.Show()
  857. self.wndInventory.engelblack4.Hide()
  858. self.wndInventory.engelblack4cl.Show()
  859. self.wndInventory.engelblack5.Hide()
  860. self.wndInventory.engelblack5cl.Show()
  861. self.wndInventory.engelblack6.Hide()
  862. self.wndInventory.engelblack6cl.Show()
  863. self.wndInventory.engelblack7.Hide()
  864. self.wndInventory.engelblack7cl.Show()
  865. self.wndInventory.engelblack8.Hide()
  866. self.wndInventory.engelblack8cl.Show()
  867. self.wndInventory.engelblack9.Hide()
  868. self.wndInventory.engelblack9cl.Show()
  869. elif player.GetEnvanter() == 1:# 1 tane acyk
  870. self.wndInventory.engelblack.Hide()#open
  871. self.wndInventory.engelblackcl.Hide()
  872. self.wndInventory.engelblack2.Show()
  873. self.wndInventory.engelblack2cl.Hide()#close
  874. self.wndInventory.engelblack3.Hide()
  875. self.wndInventory.engelblack3cl.Show()
  876. self.wndInventory.engelblack4.Hide()
  877. self.wndInventory.engelblack4cl.Show()
  878. self.wndInventory.engelblack5.Hide()
  879. self.wndInventory.engelblack5cl.Show()
  880. self.wndInventory.engelblack6.Hide()
  881. self.wndInventory.engelblack6cl.Show()
  882. self.wndInventory.engelblack7.Hide()
  883. self.wndInventory.engelblack7cl.Show()
  884. self.wndInventory.engelblack8.Hide()
  885. self.wndInventory.engelblack8cl.Show()
  886. self.wndInventory.engelblack9.Hide()
  887. self.wndInventory.engelblack9cl.Show()
  888. elif player.GetEnvanter() == 2:# 2 tane acyk
  889. self.wndInventory.engelblack.Hide()#open
  890. self.wndInventory.engelblackcl.Hide()#open
  891. self.wndInventory.engelblack2.Hide()
  892. self.wndInventory.engelblack2cl.Hide()#close
  893. self.wndInventory.engelblack3.Show()
  894. self.wndInventory.engelblack3cl.Hide()
  895. self.wndInventory.engelblack4.Hide()
  896. self.wndInventory.engelblack4cl.Show()
  897. self.wndInventory.engelblack5.Hide()
  898. self.wndInventory.engelblack5cl.Show()
  899. self.wndInventory.engelblack6.Hide()
  900. self.wndInventory.engelblack6cl.Show()
  901. self.wndInventory.engelblack7.Hide()
  902. self.wndInventory.engelblack7cl.Show()
  903. self.wndInventory.engelblack8.Hide()
  904. self.wndInventory.engelblack8cl.Show()
  905. self.wndInventory.engelblack9.Hide()
  906. self.wndInventory.engelblack9cl.Show()
  907. elif player.GetEnvanter() == 3:
  908. self.wndInventory.engelblack.Hide()#open
  909. self.wndInventory.engelblackcl.Hide()#open
  910. self.wndInventory.engelblack2.Hide()
  911. self.wndInventory.engelblack2cl.Hide()#close
  912. self.wndInventory.engelblack3.Hide()
  913. self.wndInventory.engelblack3cl.Hide()
  914. self.wndInventory.engelblack4.Show()###
  915. self.wndInventory.engelblack4cl.Hide()
  916. self.wndInventory.engelblack5.Hide()
  917. self.wndInventory.engelblack5cl.Show()
  918. self.wndInventory.engelblack6.Hide()
  919. self.wndInventory.engelblack6cl.Show()
  920. self.wndInventory.engelblack7.Hide()
  921. self.wndInventory.engelblack7cl.Show()
  922. self.wndInventory.engelblack8.Hide()
  923. self.wndInventory.engelblack8cl.Show()
  924. self.wndInventory.engelblack9.Hide()
  925. self.wndInventory.engelblack9cl.Show()
  926. elif player.GetEnvanter() == 4:
  927. self.wndInventory.engelblack.Hide()#open
  928. self.wndInventory.engelblackcl.Hide()#open
  929. self.wndInventory.engelblack2.Hide()
  930. self.wndInventory.engelblack2cl.Hide()#close
  931. self.wndInventory.engelblack3.Hide()
  932. self.wndInventory.engelblack3cl.Hide()
  933. self.wndInventory.engelblack4.Hide()###
  934. self.wndInventory.engelblack4cl.Hide()
  935. self.wndInventory.engelblack5.Show()
  936. self.wndInventory.engelblack5cl.Hide()
  937. self.wndInventory.engelblack6.Hide()
  938. self.wndInventory.engelblack6cl.Show()
  939. self.wndInventory.engelblack7.Hide()
  940. self.wndInventory.engelblack7cl.Show()
  941. self.wndInventory.engelblack8.Hide()
  942. self.wndInventory.engelblack8cl.Show()
  943. self.wndInventory.engelblack9.Hide()
  944. self.wndInventory.engelblack9cl.Show()
  945. elif player.GetEnvanter() == 5:
  946. self.wndInventory.engelblack.Hide()#open
  947. self.wndInventory.engelblackcl.Hide()#open
  948. self.wndInventory.engelblack2.Hide()
  949. self.wndInventory.engelblack2cl.Hide()#close
  950. self.wndInventory.engelblack3.Hide()
  951. self.wndInventory.engelblack3cl.Hide()
  952. self.wndInventory.engelblack4.Hide()###
  953. self.wndInventory.engelblack4cl.Hide()
  954. self.wndInventory.engelblack5.Hide()
  955. self.wndInventory.engelblack5cl.Hide()
  956. self.wndInventory.engelblack6.Show()#open
  957. self.wndInventory.engelblack6cl.Hide()
  958. self.wndInventory.engelblack7.Hide()
  959. self.wndInventory.engelblack7cl.Show()
  960. self.wndInventory.engelblack8.Hide()
  961. self.wndInventory.engelblack8cl.Show()
  962. self.wndInventory.engelblack9.Hide()
  963. self.wndInventory.engelblack9cl.Show()
  964. elif player.GetEnvanter() == 6:
  965. self.wndInventory.engelblack.Hide()#open
  966. self.wndInventory.engelblackcl.Hide()#open
  967. self.wndInventory.engelblack2.Hide()
  968. self.wndInventory.engelblack2cl.Hide()#close
  969. self.wndInventory.engelblack3.Hide()
  970. self.wndInventory.engelblack3cl.Hide()
  971. self.wndInventory.engelblack4.Hide()###
  972. self.wndInventory.engelblack4cl.Hide()
  973. self.wndInventory.engelblack5.Hide()
  974. self.wndInventory.engelblack5cl.Hide()
  975. self.wndInventory.engelblack6.Hide()#open
  976. self.wndInventory.engelblack6cl.Hide()
  977. self.wndInventory.engelblack7.Show()
  978. self.wndInventory.engelblack7cl.Hide()
  979. self.wndInventory.engelblack8.Hide()
  980. self.wndInventory.engelblack8cl.Show()
  981. self.wndInventory.engelblack9.Hide()
  982. self.wndInventory.engelblack9cl.Show()
  983. elif player.GetEnvanter() == 7:
  984. self.wndInventory.engelblack.Hide()#open
  985. self.wndInventory.engelblackcl.Hide()#open
  986. self.wndInventory.engelblack2.Hide()
  987. self.wndInventory.engelblack2cl.Hide()#close
  988. self.wndInventory.engelblack3.Hide()
  989. self.wndInventory.engelblack3cl.Hide()
  990. self.wndInventory.engelblack4.Hide()###
  991. self.wndInventory.engelblack4cl.Hide()
  992. self.wndInventory.engelblack5.Hide()
  993. self.wndInventory.engelblack5cl.Hide()
  994. self.wndInventory.engelblack6.Hide()#open
  995. self.wndInventory.engelblack6cl.Hide()
  996. self.wndInventory.engelblack7.Hide()
  997. self.wndInventory.engelblack7cl.Hide()
  998. self.wndInventory.engelblack8.Show()
  999. self.wndInventory.engelblack8cl.Hide()
  1000. self.wndInventory.engelblack9.Hide()
  1001. self.wndInventory.engelblack9cl.Show()
  1002. elif player.GetEnvanter() == 8:
  1003. self.wndInventory.engelblack.Hide()#open
  1004. self.wndInventory.engelblackcl.Hide()#open
  1005. self.wndInventory.engelblack2.Hide()
  1006. self.wndInventory.engelblack2cl.Hide()#close
  1007. self.wndInventory.engelblack3.Hide()
  1008. self.wndInventory.engelblack3cl.Hide()
  1009. self.wndInventory.engelblack4.Hide()###
  1010. self.wndInventory.engelblack4cl.Hide()
  1011. self.wndInventory.engelblack5.Hide()
  1012. self.wndInventory.engelblack5cl.Hide()
  1013. self.wndInventory.engelblack6.Hide()#open
  1014. self.wndInventory.engelblack6cl.Hide()
  1015. self.wndInventory.engelblack7.Hide()
  1016. self.wndInventory.engelblack7cl.Hide()
  1017. self.wndInventory.engelblack8.Hide()
  1018. self.wndInventory.engelblack8cl.Hide()
  1019. self.wndInventory.engelblack9.Show()
  1020. self.wndInventory.engelblack9cl.Hide()
  1021. elif player.GetEnvanter() == 9:
  1022. self.wndInventory.engelblack.Hide()#open
  1023. self.wndInventory.engelblackcl.Hide()#open
  1024. self.wndInventory.engelblack2.Hide()
  1025. self.wndInventory.engelblack2cl.Hide()#close
  1026. self.wndInventory.engelblack3.Hide()
  1027. self.wndInventory.engelblack3cl.Hide()
  1028. self.wndInventory.engelblack4.Hide()###
  1029. self.wndInventory.engelblack4cl.Hide()
  1030. self.wndInventory.engelblack5.Hide()
  1031. self.wndInventory.engelblack5cl.Hide()
  1032. self.wndInventory.engelblack6.Hide()#open
  1033. self.wndInventory.engelblack6cl.Hide()
  1034. self.wndInventory.engelblack7.Hide()
  1035. self.wndInventory.engelblack7cl.Hide()
  1036. self.wndInventory.engelblack8.Hide()
  1037. self.wndInventory.engelblack8cl.Hide()
  1038. self.wndInventory.engelblack9.Hide()
  1039. self.wndInventory.engelblack9cl.Hide()
  1040. elif player.GetEnvanter() >= 10:
  1041. self.wndInventory.engelblack.Hide()#open
  1042. self.wndInventory.engelblackcl.Hide()#open
  1043. self.wndInventory.engelblack2.Hide()
  1044. self.wndInventory.engelblack2cl.Hide()#close
  1045. self.wndInventory.engelblack3.Hide()
  1046. self.wndInventory.engelblack3cl.Hide()
  1047. self.wndInventory.engelblack4.Hide()###
  1048. self.wndInventory.engelblack4cl.Hide()
  1049. self.wndInventory.engelblack5.Hide()
  1050. self.wndInventory.engelblack5cl.Hide()
  1051. self.wndInventory.engelblack6.Hide()#open
  1052. self.wndInventory.engelblack6cl.Hide()
  1053. self.wndInventory.engelblack7.Hide()
  1054. self.wndInventory.engelblack7cl.Hide()
  1055. self.wndInventory.engelblack8.Hide()
  1056. self.wndInventory.engelblack8cl.Hide()
  1057. self.wndInventory.engelblack9.Hide()
  1058. self.wndInventory.engelblack9cl.Hide()
  1059. elif constInfo.envanter == 3:
  1060. if player.GetEnvanter() >= 0 and player.GetEnvanter() <= 8:
  1061. self.wndInventory.engelblack.Hide()#open
  1062. self.wndInventory.engelblackcl.Show()
  1063. self.wndInventory.engelblack2.Hide()
  1064. self.wndInventory.engelblack2cl.Show()#close
  1065. self.wndInventory.engelblack3.Hide()
  1066. self.wndInventory.engelblack3cl.Show()
  1067. self.wndInventory.engelblack4.Hide()
  1068. self.wndInventory.engelblack4cl.Show()
  1069. self.wndInventory.engelblack5.Hide()
  1070. self.wndInventory.engelblack5cl.Show()
  1071. self.wndInventory.engelblack6.Hide()
  1072. self.wndInventory.engelblack6cl.Show()
  1073. self.wndInventory.engelblack7.Hide()
  1074. self.wndInventory.engelblack7cl.Show()
  1075. self.wndInventory.engelblack8.Hide()
  1076. self.wndInventory.engelblack8cl.Show()
  1077. self.wndInventory.engelblack9.Hide()
  1078. self.wndInventory.engelblack9cl.Show()
  1079. elif player.GetEnvanter() == 9:#Hepsi kapali
  1080. self.wndInventory.engelblack.Show()#open
  1081. self.wndInventory.engelblackcl.Hide()
  1082. self.wndInventory.engelblack2.Hide()
  1083. self.wndInventory.engelblack2cl.Show()#close
  1084. self.wndInventory.engelblack3.Hide()
  1085. self.wndInventory.engelblack3cl.Show()
  1086. self.wndInventory.engelblack4.Hide()
  1087. self.wndInventory.engelblack4cl.Show()
  1088. self.wndInventory.engelblack5.Hide()
  1089. self.wndInventory.engelblack5cl.Show()
  1090. self.wndInventory.engelblack6.Hide()
  1091. self.wndInventory.engelblack6cl.Show()
  1092. self.wndInventory.engelblack7.Hide()
  1093. self.wndInventory.engelblack7cl.Show()
  1094. self.wndInventory.engelblack8.Hide()
  1095. self.wndInventory.engelblack8cl.Show()
  1096. self.wndInventory.engelblack9.Hide()
  1097. self.wndInventory.engelblack9cl.Show()
  1098. elif player.GetEnvanter() == 10:# 1 tane acyk
  1099. self.wndInventory.engelblack.Hide()#open
  1100. self.wndInventory.engelblackcl.Hide()
  1101. self.wndInventory.engelblack2.Show()
  1102. self.wndInventory.engelblack2cl.Hide()#close
  1103. self.wndInventory.engelblack3.Hide()
  1104. self.wndInventory.engelblack3cl.Show()
  1105. self.wndInventory.engelblack4.Hide()
  1106. self.wndInventory.engelblack4cl.Show()
  1107. self.wndInventory.engelblack5.Hide()
  1108. self.wndInventory.engelblack5cl.Show()
  1109. self.wndInventory.engelblack6.Hide()
  1110. self.wndInventory.engelblack6cl.Show()
  1111. self.wndInventory.engelblack7.Hide()
  1112. self.wndInventory.engelblack7cl.Show()
  1113. self.wndInventory.engelblack8.Hide()
  1114. self.wndInventory.engelblack8cl.Show()
  1115. self.wndInventory.engelblack9.Hide()
  1116. self.wndInventory.engelblack9cl.Show()
  1117. elif player.GetEnvanter() == 11:# 2 tane acyk
  1118. self.wndInventory.engelblack.Hide()#open
  1119. self.wndInventory.engelblackcl.Hide()#open
  1120. self.wndInventory.engelblack2.Hide()
  1121. self.wndInventory.engelblack2cl.Hide()#close
  1122. self.wndInventory.engelblack3.Show()
  1123. self.wndInventory.engelblack3cl.Hide()
  1124. self.wndInventory.engelblack4.Hide()
  1125. self.wndInventory.engelblack4cl.Show()
  1126. self.wndInventory.engelblack5.Hide()
  1127. self.wndInventory.engelblack5cl.Show()
  1128. self.wndInventory.engelblack6.Hide()
  1129. self.wndInventory.engelblack6cl.Show()
  1130. self.wndInventory.engelblack7.Hide()
  1131. self.wndInventory.engelblack7cl.Show()
  1132. self.wndInventory.engelblack8.Hide()
  1133. self.wndInventory.engelblack8cl.Show()
  1134. self.wndInventory.engelblack9.Hide()
  1135. self.wndInventory.engelblack9cl.Show()
  1136. elif player.GetEnvanter() == 12:
  1137. self.wndInventory.engelblack.Hide()#open
  1138. self.wndInventory.engelblackcl.Hide()#open
  1139. self.wndInventory.engelblack2.Hide()
  1140. self.wndInventory.engelblack2cl.Hide()#close
  1141. self.wndInventory.engelblack3.Hide()
  1142. self.wndInventory.engelblack3cl.Hide()
  1143. self.wndInventory.engelblack4.Show()###
  1144. self.wndInventory.engelblack4cl.Hide()
  1145. self.wndInventory.engelblack5.Hide()
  1146. self.wndInventory.engelblack5cl.Show()
  1147. self.wndInventory.engelblack6.Hide()
  1148. self.wndInventory.engelblack6cl.Show()
  1149. self.wndInventory.engelblack7.Hide()
  1150. self.wndInventory.engelblack7cl.Show()
  1151. self.wndInventory.engelblack8.Hide()
  1152. self.wndInventory.engelblack8cl.Show()
  1153. self.wndInventory.engelblack9.Hide()
  1154. self.wndInventory.engelblack9cl.Show()
  1155. elif player.GetEnvanter() == 13:
  1156. self.wndInventory.engelblack.Hide()#open
  1157. self.wndInventory.engelblackcl.Hide()#open
  1158. self.wndInventory.engelblack2.Hide()
  1159. self.wndInventory.engelblack2cl.Hide()#close
  1160. self.wndInventory.engelblack3.Hide()
  1161. self.wndInventory.engelblack3cl.Hide()
  1162. self.wndInventory.engelblack4.Hide()###
  1163. self.wndInventory.engelblack4cl.Hide()
  1164. self.wndInventory.engelblack5.Show()
  1165. self.wndInventory.engelblack5cl.Hide()
  1166. self.wndInventory.engelblack6.Hide()
  1167. self.wndInventory.engelblack6cl.Show()
  1168. self.wndInventory.engelblack7.Hide()
  1169. self.wndInventory.engelblack7cl.Show()
  1170. self.wndInventory.engelblack8.Hide()
  1171. self.wndInventory.engelblack8cl.Show()
  1172. self.wndInventory.engelblack9.Hide()
  1173. self.wndInventory.engelblack9cl.Show()
  1174. elif player.GetEnvanter() == 14:
  1175. self.wndInventory.engelblack.Hide()#open
  1176. self.wndInventory.engelblackcl.Hide()#open
  1177. self.wndInventory.engelblack2.Hide()
  1178. self.wndInventory.engelblack2cl.Hide()#close
  1179. self.wndInventory.engelblack3.Hide()
  1180. self.wndInventory.engelblack3cl.Hide()
  1181. self.wndInventory.engelblack4.Hide()###
  1182. self.wndInventory.engelblack4cl.Hide()
  1183. self.wndInventory.engelblack5.Hide()
  1184. self.wndInventory.engelblack5cl.Hide()
  1185. self.wndInventory.engelblack6.Show()#open
  1186. self.wndInventory.engelblack6cl.Hide()
  1187. self.wndInventory.engelblack7.Hide()
  1188. self.wndInventory.engelblack7cl.Show()
  1189. self.wndInventory.engelblack8.Hide()
  1190. self.wndInventory.engelblack8cl.Show()
  1191. self.wndInventory.engelblack9.Hide()
  1192. self.wndInventory.engelblack9cl.Show()
  1193. elif player.GetEnvanter() == 15:
  1194. self.wndInventory.engelblack.Hide()#open
  1195. self.wndInventory.engelblackcl.Hide()#open
  1196. self.wndInventory.engelblack2.Hide()
  1197. self.wndInventory.engelblack2cl.Hide()#close
  1198. self.wndInventory.engelblack3.Hide()
  1199. self.wndInventory.engelblack3cl.Hide()
  1200. self.wndInventory.engelblack4.Hide()###
  1201. self.wndInventory.engelblack4cl.Hide()
  1202. self.wndInventory.engelblack5.Hide()
  1203. self.wndInventory.engelblack5cl.Hide()
  1204. self.wndInventory.engelblack6.Hide()#open
  1205. self.wndInventory.engelblack6cl.Hide()
  1206. self.wndInventory.engelblack7.Show()
  1207. self.wndInventory.engelblack7cl.Hide()
  1208. self.wndInventory.engelblack8.Hide()
  1209. self.wndInventory.engelblack8cl.Show()
  1210. self.wndInventory.engelblack9.Hide()
  1211. self.wndInventory.engelblack9cl.Show()
  1212. elif player.GetEnvanter() == 16:
  1213. self.wndInventory.engelblack.Hide()#open
  1214. self.wndInventory.engelblackcl.Hide()#open
  1215. self.wndInventory.engelblack2.Hide()
  1216. self.wndInventory.engelblack2cl.Hide()#close
  1217. self.wndInventory.engelblack3.Hide()
  1218. self.wndInventory.engelblack3cl.Hide()
  1219. self.wndInventory.engelblack4.Hide()###
  1220. self.wndInventory.engelblack4cl.Hide()
  1221. self.wndInventory.engelblack5.Hide()
  1222. self.wndInventory.engelblack5cl.Hide()
  1223. self.wndInventory.engelblack6.Hide()#open
  1224. self.wndInventory.engelblack6cl.Hide()
  1225. self.wndInventory.engelblack7.Hide()
  1226. self.wndInventory.engelblack7cl.Hide()
  1227. self.wndInventory.engelblack8.Show()
  1228. self.wndInventory.engelblack8cl.Hide()
  1229. self.wndInventory.engelblack9.Hide()
  1230. self.wndInventory.engelblack9cl.Show()
  1231. elif player.GetEnvanter() == 17:
  1232. self.wndInventory.engelblack.Hide()#open
  1233. self.wndInventory.engelblackcl.Hide()#open
  1234. self.wndInventory.engelblack2.Hide()
  1235. self.wndInventory.engelblack2cl.Hide()#close
  1236. self.wndInventory.engelblack3.Hide()
  1237. self.wndInventory.engelblack3cl.Hide()
  1238. self.wndInventory.engelblack4.Hide()###
  1239. self.wndInventory.engelblack4cl.Hide()
  1240. self.wndInventory.engelblack5.Hide()
  1241. self.wndInventory.engelblack5cl.Hide()
  1242. self.wndInventory.engelblack6.Hide()#open
  1243. self.wndInventory.engelblack6cl.Hide()
  1244. self.wndInventory.engelblack7.Hide()
  1245. self.wndInventory.engelblack7cl.Hide()
  1246. self.wndInventory.engelblack8.Hide()
  1247. self.wndInventory.engelblack8cl.Hide()
  1248. self.wndInventory.engelblack9.Show()
  1249. self.wndInventory.engelblack9cl.Hide()
  1250. elif player.GetEnvanter() == 18:
  1251. self.wndInventory.engelblack.Hide()#open
  1252. self.wndInventory.engelblackcl.Hide()#open
  1253. self.wndInventory.engelblack2.Hide()
  1254. self.wndInventory.engelblack2cl.Hide()#close
  1255. self.wndInventory.engelblack3.Hide()
  1256. self.wndInventory.engelblack3cl.Hide()
  1257. self.wndInventory.engelblack4.Hide()###
  1258. self.wndInventory.engelblack4cl.Hide()
  1259. self.wndInventory.engelblack5.Hide()
  1260. self.wndInventory.engelblack5cl.Hide()
  1261. self.wndInventory.engelblack6.Hide()#open
  1262. self.wndInventory.engelblack6cl.Hide()
  1263. self.wndInventory.engelblack7.Hide()
  1264. self.wndInventory.engelblack7cl.Hide()
  1265. self.wndInventory.engelblack8.Hide()
  1266. self.wndInventory.engelblack8cl.Hide()
  1267. self.wndInventory.engelblack9.Hide()
  1268. self.wndInventory.engelblack9cl.Hide()
  1269. else:
  1270. self.wndInventory.engelblack.Hide()
  1271. self.wndInventory.engelblackcl.Hide()
  1272. self.wndInventory.engelblack2.Hide()
  1273. self.wndInventory.engelblack2cl.Hide()
  1274. self.wndInventory.engelblack3.Hide()
  1275. self.wndInventory.engelblack3cl.Hide()
  1276. self.wndInventory.engelblack4.Hide()
  1277. self.wndInventory.engelblack4cl.Hide()
  1278. self.wndInventory.engelblack5.Hide()
  1279. self.wndInventory.engelblack5cl.Hide()
  1280. self.wndInventory.engelblack6.Hide()
  1281. self.wndInventory.engelblack6cl.Hide()
  1282. self.wndInventory.engelblack7.Hide()
  1283. self.wndInventory.engelblack7cl.Hide()
  1284. self.wndInventory.engelblack8.Hide()
  1285. self.wndInventory.engelblack8cl.Hide()
  1286. self.wndInventory.engelblack9.Hide()
  1287. self.wndInventory.engelblack9cl.Hide()
  1288. self.wndInventory.RefreshBagSlotWindow()
  1289.  
  1290. def RefreshCharacter(self): ## Character 페이지의 얼굴, Inventory 페이지의 전신 그림 등의 Refresh
  1291. self.wndCharacter.RefreshCharacter()
  1292. self.wndTaskBar.RefreshQuickSlot()
  1293.  
  1294. def RefreshQuest(self):
  1295. self.wndCharacter.RefreshQuest()
  1296.  
  1297. def RefreshSafebox(self):
  1298. self.wndSafebox.RefreshSafebox()
  1299.  
  1300. # ITEM_MALL
  1301. def RefreshMall(self):
  1302. self.wndMall.RefreshMall()
  1303.  
  1304. def OpenItemMall(self):
  1305. if not self.mallPageDlg:
  1306. self.mallPageDlg = uiShop.MallPageDialog()
  1307.  
  1308. self.mallPageDlg.Open()
  1309. # END_OF_ITEM_MALL
  1310.  
  1311. def RefreshMessenger(self):
  1312. self.wndMessenger.RefreshMessenger()
  1313.  
  1314. def RefreshGuildInfoPage(self):
  1315. self.wndGuild.RefreshGuildInfoPage()
  1316.  
  1317. def RefreshGuildBoardPage(self):
  1318. self.wndGuild.RefreshGuildBoardPage()
  1319.  
  1320. def RefreshGuildMemberPage(self):
  1321. self.wndGuild.RefreshGuildMemberPage()
  1322.  
  1323. def RefreshGuildMemberPageGradeComboBox(self):
  1324. self.wndGuild.RefreshGuildMemberPageGradeComboBox()
  1325.  
  1326. def RefreshGuildSkillPage(self):
  1327. self.wndGuild.RefreshGuildSkillPage()
  1328.  
  1329. def RefreshGuildGradePage(self):
  1330. self.wndGuild.RefreshGuildGradePage()
  1331.  
  1332. def DeleteGuild(self):
  1333. self.wndMessenger.ClearGuildMember()
  1334. self.wndGuild.DeleteGuild()
  1335.  
  1336. def RefreshMobile(self):
  1337. self.dlgSystem.RefreshMobile()
  1338.  
  1339. def OnMobileAuthority(self):
  1340. self.dlgSystem.OnMobileAuthority()
  1341.  
  1342. def OnBlockMode(self, mode):
  1343. self.dlgSystem.OnBlockMode(mode)
  1344.  
  1345. ## Calling Functions
  1346. # PointReset
  1347. def OpenPointResetDialog(self):
  1348. self.dlgPointReset.Show()
  1349. self.dlgPointReset.SetTop()
  1350.  
  1351. def ClosePointResetDialog(self):
  1352. self.dlgPointReset.Close()
  1353.  
  1354. # Shop
  1355. def OpenShopDialog(self, vid):
  1356. self.wndInventory.Show()
  1357. self.wndInventory.SetTop()
  1358. self.dlgShop.Open(vid)
  1359. self.dlgShop.SetTop()
  1360.  
  1361. def CloseShopDialog(self):
  1362. self.dlgShop.Close()
  1363.  
  1364. def RefreshShopDialog(self):
  1365. self.dlgShop.Refresh()
  1366.  
  1367. if app.ENABLE_SHOW_CHEST_DROP:
  1368. def AddChestDropInfo(self, chestVnum, pageIndex, slotIndex, itemVnum, itemCount):
  1369. self.dlgChestDrop.AddChestDropItem(int(chestVnum), int(pageIndex), int(slotIndex), int(itemVnum), int(itemCount))
  1370.  
  1371. def RefreshChestDropInfo(self, chestVnum):
  1372. self.dlgChestDrop.RefreshItems(chestVnum)
  1373.  
  1374. ## Quest
  1375. def OpenCharacterWindowQuestPage(self):
  1376. self.wndCharacter.Show()
  1377. self.wndCharacter.SetState("QUEST")
  1378.  
  1379. def OpenQuestWindow(self, skin, idx):
  1380.  
  1381. wnds = ()
  1382.  
  1383. q = uiQuest.QuestDialog(skin, idx)
  1384. q.SetWindowName("QuestWindow" + str(idx))
  1385. q.Show()
  1386. if skin:
  1387. q.Lock()
  1388. wnds = self.__HideWindows()
  1389.  
  1390. # UNKNOWN_UPDATE
  1391. q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
  1392. # END_OF_UNKNOWN_UPDATE
  1393.  
  1394. if skin:
  1395. q.AddOnCloseEvent(q.Unlock)
  1396. q.AddOnCloseEvent(lambda key = self.wndQuestWindowNewKey:ui.__mem_func__(self.RemoveQuestDialog)(key))
  1397. self.wndQuestWindow[self.wndQuestWindowNewKey] = q
  1398.  
  1399. self.wndQuestWindowNewKey = self.wndQuestWindowNewKey + 1
  1400.  
  1401. # END_OF_UNKNOWN_UPDATE
  1402.  
  1403. def HideAllQuestWindow(self):
  1404. tempList = []
  1405. for i,v in self.wndQuestWindow.iteritems():
  1406. tempList.append(v)
  1407. for i in tempList:
  1408. i.OnCancel()
  1409.  
  1410. def RemoveQuestDialog(self, key):
  1411. del self.wndQuestWindow[key]
  1412.  
  1413. ## Exchange
  1414. def StartExchange(self):
  1415. self.dlgExchange.OpenDialog()
  1416. self.dlgExchange.Refresh()
  1417.  
  1418. def EndExchange(self):
  1419. self.dlgExchange.CloseDialog()
  1420.  
  1421. def RefreshExchange(self):
  1422. self.dlgExchange.Refresh()
  1423.  
  1424. def StartDice(self):
  1425. self.dlgDice.OpenDialog()
  1426. self.dlgDice.Refresh()
  1427.  
  1428. def EndDice(self):
  1429. self.dlgDice.CloseDialog()
  1430.  
  1431. def RefreshDice(self):
  1432. self.dlgDice.Refresh()
  1433.  
  1434. def AddDiceNumber(self, myNumber, targetNumber):
  1435. self.dlgDice.DiceAddNumber(myNumber, targetNumber)
  1436.  
  1437. ## Party
  1438. def AddPartyMember(self, pid, name):
  1439. self.wndParty.AddPartyMember(pid, name)
  1440.  
  1441. self.__ArrangeQuestButton()
  1442.  
  1443. def UpdatePartyMemberInfo(self, pid):
  1444. self.wndParty.UpdatePartyMemberInfo(pid)
  1445.  
  1446. def RemovePartyMember(self, pid):
  1447. self.wndParty.RemovePartyMember(pid)
  1448.  
  1449. ##!! 20061026.levites.퀘스트_위치_보정
  1450. self.__ArrangeQuestButton()
  1451.  
  1452. def LinkPartyMember(self, pid, vid):
  1453. self.wndParty.LinkPartyMember(pid, vid)
  1454.  
  1455. def UnlinkPartyMember(self, pid):
  1456. self.wndParty.UnlinkPartyMember(pid)
  1457.  
  1458. def UnlinkAllPartyMember(self):
  1459. self.wndParty.UnlinkAllPartyMember()
  1460.  
  1461. def ExitParty(self):
  1462. self.wndParty.ExitParty()
  1463.  
  1464. ##!! 20061026.levites.퀘스트_위치_보정
  1465. self.__ArrangeQuestButton()
  1466.  
  1467. def PartyHealReady(self):
  1468. self.wndParty.PartyHealReady()
  1469.  
  1470. def ChangePartyParameter(self, distributionMode):
  1471. self.wndParty.ChangePartyParameter(distributionMode)
  1472.  
  1473. ## Safebox
  1474. def AskSafeboxPassword(self):
  1475. if self.wndSafebox.IsShow():
  1476. return
  1477.  
  1478. # SAFEBOX_PASSWORD
  1479. self.dlgPassword.SetTitle(localeInfo.PASSWORD_TITLE)
  1480. self.dlgPassword.SetSendMessage("/safebox_password ")
  1481. # END_OF_SAFEBOX_PASSWORD
  1482.  
  1483. self.dlgPassword.ShowDialog()
  1484.  
  1485. def OpenSafeboxWindow(self, size):
  1486. self.dlgPassword.CloseDialog()
  1487. self.wndSafebox.ShowWindow(size)
  1488.  
  1489. def RefreshSafeboxMoney(self):
  1490. self.wndSafebox.RefreshSafeboxMoney()
  1491.  
  1492. def CommandCloseSafebox(self):
  1493. self.wndSafebox.CommandCloseSafebox()
  1494.  
  1495. # ITEM_MALL
  1496. def AskMallPassword(self):
  1497. if self.wndMall.IsShow():
  1498. return
  1499. self.dlgPassword.SetTitle(localeInfo.MALL_PASSWORD_TITLE)
  1500. self.dlgPassword.SetSendMessage("/mall_password ")
  1501. self.dlgPassword.ShowDialog()
  1502.  
  1503. def OpenMallWindow(self, size):
  1504. self.dlgPassword.CloseDialog()
  1505. self.wndMall.ShowWindow(size)
  1506.  
  1507. def CommandCloseMall(self):
  1508. self.wndMall.CommandCloseMall()
  1509. # END_OF_ITEM_MALL
  1510.  
  1511. ## Guild
  1512. def OnStartGuildWar(self, guildSelf, guildOpp):
  1513. self.wndGuild.OnStartGuildWar(guildSelf, guildOpp)
  1514.  
  1515. guildWarScoreBoard = uiGuild.GuildWarScoreBoard()
  1516. guildWarScoreBoard.Open(guildSelf, guildOpp)
  1517. guildWarScoreBoard.Show()
  1518. self.guildScoreBoardDict[uiGuild.GetGVGKey(guildSelf, guildOpp)] = guildWarScoreBoard
  1519.  
  1520. def OnEndGuildWar(self, guildSelf, guildOpp):
  1521. self.wndGuild.OnEndGuildWar(guildSelf, guildOpp)
  1522.  
  1523. key = uiGuild.GetGVGKey(guildSelf, guildOpp)
  1524.  
  1525. if not self.guildScoreBoardDict.has_key(key):
  1526. return
  1527.  
  1528. self.guildScoreBoardDict[key].Destroy()
  1529. del self.guildScoreBoardDict[key]
  1530.  
  1531. # GUILDWAR_MEMBER_COUNT
  1532. def UpdateMemberCount(self, gulidID1, memberCount1, guildID2, memberCount2):
  1533. key = uiGuild.GetGVGKey(gulidID1, guildID2)
  1534.  
  1535. if not self.guildScoreBoardDict.has_key(key):
  1536. return
  1537.  
  1538. self.guildScoreBoardDict[key].UpdateMemberCount(gulidID1, memberCount1, guildID2, memberCount2)
  1539. # END_OF_GUILDWAR_MEMBER_COUNT
  1540.  
  1541. def OnRecvGuildWarPoint(self, gainGuildID, opponentGuildID, point):
  1542. key = uiGuild.GetGVGKey(gainGuildID, opponentGuildID)
  1543. if not self.guildScoreBoardDict.has_key(key):
  1544. return
  1545.  
  1546. guildBoard = self.guildScoreBoardDict[key]
  1547. guildBoard.SetScore(gainGuildID, opponentGuildID, point)
  1548.  
  1549. ## PK Mode
  1550. def OnChangePKMode(self):
  1551. self.wndCharacter.RefreshAlignment()
  1552. self.dlgSystem.OnChangePKMode()
  1553.  
  1554. ## Refine
  1555. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type):
  1556. self.dlgRefineNew.Open(targetItemPos, nextGradeItemVnum, cost, prob, type)
  1557.  
  1558. def AppendMaterialToRefineDialog(self, vnum, count):
  1559. self.dlgRefineNew.AppendMaterial(vnum, count)
  1560.  
  1561. ## Show & Hide
  1562. def ShowDefaultWindows(self):
  1563. self.wndTaskBar.Show()
  1564. self.wndMiniMap.Show()
  1565. self.wndMiniMap.ShowMiniMap()
  1566. if self.wndEnergyBar:
  1567. self.wndEnergyBar.Show()
  1568. if app.ENABLE_MINI_GAME:
  1569. if self.wndMiniGame:
  1570. self.wndMiniGame.ShowMiniGameDialog()
  1571.  
  1572. def ShowAllWindows(self):
  1573. self.wndTaskBar.Show()
  1574. self.wndCharacter.Show()
  1575. self.wndInventory.Show()
  1576. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1577. self.wndDragonSoul.Show()
  1578. self.wndDragonSoulRefine.Show()
  1579. self.wndChat.Show()
  1580. self.yangText.Show()
  1581. self.wndMiniMap.Show()
  1582. if self.wndEnergyBar:
  1583. self.wndEnergyBar.Show()
  1584. if app.ENABLE_MINI_GAME:
  1585. if self.wndMiniGame:
  1586. self.wndMiniGame.ShowMiniGameDialog()
  1587. if self.wndExpandedTaskBar:
  1588. self.wndExpandedTaskBar.Show()
  1589. self.wndExpandedTaskBar.SetTop()
  1590.  
  1591. def HideAllWindows(self):
  1592. if self.wndTaskBar:
  1593. self.wndTaskBar.Hide()
  1594.  
  1595. if self.wndEnergyBar:
  1596. self.wndEnergyBar.Hide()
  1597.  
  1598. if self.wndCharacter:
  1599. self.wndCharacter.Hide()
  1600.  
  1601. if self.wndInventory:
  1602. self.wndInventory.Hide()
  1603.  
  1604. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1605. self.wndDragonSoul.Hide()
  1606. self.wndDragonSoulRefine.Hide()
  1607.  
  1608. if self.wndChat:
  1609. self.wndChat.Hide()
  1610.  
  1611. if self.yangText:
  1612. self.yangText.Hide()
  1613.  
  1614. if self.wndMiniMap:
  1615. self.wndMiniMap.Hide()
  1616.  
  1617. if self.wndMessenger:
  1618. self.wndMessenger.Hide()
  1619.  
  1620. if self.wndGuild:
  1621. self.wndGuild.Hide()
  1622.  
  1623. if self.wndExpandedTaskBar:
  1624. self.wndExpandedTaskBar.Hide()
  1625. if app.ENABLE_MINI_GAME:
  1626. if self.wndMiniGame:
  1627. self.wndMiniGame.HideMiniGameDialog()
  1628.  
  1629.  
  1630.  
  1631. def ShowMouseImage(self):
  1632. self.wndTaskBar.ShowMouseImage()
  1633.  
  1634. def HideMouseImage(self):
  1635. self.wndTaskBar.HideMouseImage()
  1636.  
  1637. def ToggleChat(self):
  1638. if True == self.wndChat.IsEditMode():
  1639. self.wndChat.CloseChat()
  1640. else:
  1641. # 웹페이지가 열렸을때는 채팅 입력이 안됨
  1642. if self.wndWeb and self.wndWeb.IsShow():
  1643. pass
  1644. else:
  1645. self.wndChat.OpenChat()
  1646.  
  1647. def IsOpenChat(self):
  1648. return self.wndChat.IsEditMode()
  1649.  
  1650. def SetChatFocus(self):
  1651. self.wndChat.SetChatFocus()
  1652.  
  1653. def OpenRestartDialog(self):
  1654. self.dlgRestart.OpenDialog()
  1655. self.dlgRestart.SetTop()
  1656.  
  1657. def CloseRestartDialog(self):
  1658. self.dlgRestart.Close()
  1659.  
  1660. def ToggleSystemDialog(self):
  1661. if False == self.dlgSystem.IsShow():
  1662. self.dlgSystem.OpenDialog()
  1663. self.dlgSystem.SetTop()
  1664. else:
  1665. self.dlgSystem.Close()
  1666.  
  1667. def OpenSystemDialog(self):
  1668. self.dlgSystem.OpenDialog()
  1669. self.dlgSystem.SetTop()
  1670.  
  1671. def ToggleMessenger(self):
  1672. if self.wndMessenger.IsShow():
  1673. self.wndMessenger.Hide()
  1674. else:
  1675. self.wndMessenger.SetTop()
  1676. self.wndMessenger.Show()
  1677.  
  1678. def ToggleMiniMap(self):
  1679. if app.IsPressed(app.DIK_LSHIFT) or app.IsPressed(app.DIK_RSHIFT):
  1680. if False == self.wndMiniMap.isShowMiniMap():
  1681. self.wndMiniMap.ShowMiniMap()
  1682. self.wndMiniMap.SetTop()
  1683. else:
  1684. self.wndMiniMap.HideMiniMap()
  1685.  
  1686. else:
  1687. self.wndMiniMap.ToggleAtlasWindow()
  1688.  
  1689. def PressMKey(self):
  1690. if app.IsPressed(app.DIK_LALT) or app.IsPressed(app.DIK_RALT):
  1691. self.ToggleMessenger()
  1692.  
  1693. else:
  1694. self.ToggleMiniMap()
  1695.  
  1696. def SetMapName(self, mapName):
  1697. self.wndMiniMap.SetMapName(mapName)
  1698.  
  1699. def MiniMapScaleUp(self):
  1700. self.wndMiniMap.ScaleUp()
  1701.  
  1702. def MiniMapScaleDown(self):
  1703. self.wndMiniMap.ScaleDown()
  1704.  
  1705. def ToggleCharacterWindow(self, state):
  1706. if False == player.IsObserverMode():
  1707. if False == self.wndCharacter.IsShow():
  1708. self.OpenCharacterWindowWithState(state)
  1709. else:
  1710. if state == self.wndCharacter.GetState():
  1711. self.wndCharacter.OverOutItem()
  1712. self.wndCharacter.Hide()
  1713. else:
  1714. self.wndCharacter.SetState(state)
  1715.  
  1716. def OpenCharacterWindowWithState(self, state):
  1717. if False == player.IsObserverMode():
  1718. self.wndCharacter.SetState(state)
  1719. self.wndCharacter.Show()
  1720. self.wndCharacter.SetTop()
  1721.  
  1722. def ToggleCharacterWindowStatusPage(self):
  1723. self.ToggleCharacterWindow("STATUS")
  1724.  
  1725. def ToggleInventoryWindow(self):
  1726. if False == player.IsObserverMode():
  1727. if False == self.wndInventory.IsShow():
  1728. self.wndInventory.Show()
  1729. self.wndInventory.SetTop()
  1730. else:
  1731. self.wndInventory.OverOutItem()
  1732. self.wndInventory.Close()
  1733.  
  1734. def TogglePetMain(self):
  1735. if FALSE == player.IsObserverMode():
  1736. if FALSE == self.wndExpandedTaskBar.IsShow():
  1737. self.wndExpandedTaskBar.Show()
  1738. self.wndExpandedTaskBar.SetTop()
  1739. else:
  1740. self.wndExpandedTaskBar.Close()
  1741. net.SendChatPacket("/gift")
  1742.  
  1743. def ToggleExpandedButton(self):
  1744. if False == player.IsObserverMode():
  1745. if False == self.wndExpandedTaskBar.IsShow():
  1746. self.wndExpandedTaskBar.Show()
  1747. self.wndExpandedTaskBar.SetTop()
  1748. else:
  1749. self.wndExpandedTaskBar.Close()
  1750.  
  1751. # 용혼석
  1752. def DragonSoulActivate(self, deck):
  1753. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1754. self.wndDragonSoul.ActivateDragonSoulByExtern(deck)
  1755.  
  1756. def DragonSoulDeactivate(self):
  1757. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1758. self.wndDragonSoul.DeactivateDragonSoul()
  1759.  
  1760. def Highligt_Item(self, inven_type, inven_pos):
  1761. if player.DRAGON_SOUL_INVENTORY == inven_type:
  1762. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1763. self.wndDragonSoul.HighlightSlot(inven_pos)
  1764.  
  1765. def DragonSoulGiveQuilification(self):
  1766. self.DRAGON_SOUL_IS_QUALIFIED = True
  1767. self.wndExpandedTaskBar.SetToolTipText(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, uiScriptLocale.TASKBAR_DRAGON_SOUL)
  1768.  
  1769. def ToggleDragonSoulWindow(self):
  1770. if False == player.IsObserverMode():
  1771. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1772. if False == self.wndDragonSoul.IsShow():
  1773. if self.DRAGON_SOUL_IS_QUALIFIED:
  1774. self.wndDragonSoul.Show()
  1775. else:
  1776. try:
  1777. self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED)
  1778. self.wndPopupDialog.Open()
  1779. except:
  1780. self.wndPopupDialog = uiCommon.PopupDialog()
  1781. self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED)
  1782. self.wndPopupDialog.Open()
  1783. else:
  1784. self.wndDragonSoul.Close()
  1785.  
  1786. def ToggleDragonSoulWindowWithNoInfo(self):
  1787. if False == player.IsObserverMode():
  1788. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1789. if False == self.wndDragonSoul.IsShow():
  1790. if self.DRAGON_SOUL_IS_QUALIFIED:
  1791. self.wndDragonSoul.Show()
  1792. else:
  1793. self.wndDragonSoul.Close()
  1794. if app.ENABLE_SPECIAL_STORAGE:
  1795. def ToggleSpecialStorageWindow(self):
  1796. if False == player.IsObserverMode():
  1797. if False == self.wndSpecialStorage.IsShow():
  1798. self.wndSpecialStorage.Show()
  1799. else:
  1800. self.wndSpecialStorage.Close()
  1801.  
  1802. def FailDragonSoulRefine(self, reason, inven_type, inven_pos):
  1803. if False == player.IsObserverMode():
  1804. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1805. if True == self.wndDragonSoulRefine.IsShow():
  1806. self.wndDragonSoulRefine.RefineFail(reason, inven_type, inven_pos)
  1807.  
  1808. def SucceedDragonSoulRefine(self, inven_type, inven_pos):
  1809. if False == player.IsObserverMode():
  1810. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1811. if True == self.wndDragonSoulRefine.IsShow():
  1812. self.wndDragonSoulRefine.RefineSucceed(inven_type, inven_pos)
  1813.  
  1814. def OpenDragonSoulRefineWindow(self):
  1815. if False == player.IsObserverMode():
  1816. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1817. if False == self.wndDragonSoulRefine.IsShow():
  1818. self.wndDragonSoulRefine.Show()
  1819. if None != self.wndDragonSoul:
  1820. if False == self.wndDragonSoul.IsShow():
  1821. self.wndDragonSoul.Show()
  1822.  
  1823. def CloseDragonSoulRefineWindow(self):
  1824. if False == player.IsObserverMode():
  1825. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1826. if True == self.wndDragonSoulRefine.IsShow():
  1827. self.wndDragonSoulRefine.Close()
  1828.  
  1829. # 용혼석 끝
  1830.  
  1831. def ToggleGuildWindow(self):
  1832. if not self.wndGuild.IsShow():
  1833. if self.wndGuild.CanOpen():
  1834. self.wndGuild.Open()
  1835. else:
  1836. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GUILD_YOU_DO_NOT_JOIN)
  1837. else:
  1838. self.wndGuild.OverOutItem()
  1839. self.wndGuild.Hide()
  1840.  
  1841. def ToggleChatLogWindow(self):
  1842. if self.wndChatLog.IsShow():
  1843. self.wndChatLog.Hide()
  1844. else:
  1845. self.wndChatLog.Show()
  1846.  
  1847. def CheckGameButton(self):
  1848. if self.wndGameButton:
  1849. self.wndGameButton.CheckGameButton()
  1850.  
  1851. def __OnClickStatusPlusButton(self):
  1852. self.ToggleCharacterWindow("STATUS")
  1853.  
  1854. def __OnClickSkillPlusButton(self):
  1855. self.ToggleCharacterWindow("SKILL")
  1856.  
  1857. def __OnClickQuestButton(self):
  1858. self.ToggleCharacterWindow("QUEST")
  1859.  
  1860. def __OnClickHelpButton(self):
  1861. player.SetPlayTime(1)
  1862. self.CheckGameButton()
  1863. self.OpenHelpWindow()
  1864.  
  1865. def __OnClickBuildButton(self):
  1866. self.BUILD_OpenWindow()
  1867.  
  1868. def OpenHelpWindow(self):
  1869. self.wndUICurtain.Show()
  1870. self.wndHelp.Open()
  1871.  
  1872. def CloseHelpWindow(self):
  1873. self.wndUICurtain.Hide()
  1874. self.wndHelp.Close()
  1875.  
  1876. def OpenWebWindow(self, url):
  1877. self.wndWeb.Open(url)
  1878.  
  1879. # 웹페이지를 열면 채팅을 닫는다
  1880. self.wndChat.CloseChat()
  1881.  
  1882. # show GIFT
  1883. def ShowGift(self):
  1884. self.wndTaskBar.ShowGift()
  1885.  
  1886. def CloseWbWindow(self):
  1887. self.wndWeb.Close()
  1888.  
  1889. if app.ENABLE_SASH_SYSTEM:
  1890. def ActSash(self, iAct, bWindow):
  1891. if iAct == 1:
  1892. if bWindow == True:
  1893. if not self.wndSashCombine.IsOpened():
  1894. self.wndSashCombine.Open()
  1895.  
  1896. if not self.wndInventory.IsShow():
  1897. self.wndInventory.Show()
  1898. else:
  1899. if not self.wndSashAbsorption.IsOpened():
  1900. self.wndSashAbsorption.Open()
  1901.  
  1902. if not self.wndInventory.IsShow():
  1903. self.wndInventory.Show()
  1904.  
  1905. self.wndInventory.RefreshBagSlotWindow()
  1906. elif iAct == 2:
  1907. if bWindow == True:
  1908. if self.wndSashCombine.IsOpened():
  1909. self.wndSashCombine.Close()
  1910. else:
  1911. if self.wndSashAbsorption.IsOpened():
  1912. self.wndSashAbsorption.Close()
  1913.  
  1914. self.wndInventory.RefreshBagSlotWindow()
  1915. elif iAct == 3 or iAct == 4:
  1916. if bWindow == True:
  1917. if self.wndSashCombine.IsOpened():
  1918. self.wndSashCombine.Refresh(iAct)
  1919. else:
  1920. if self.wndSashAbsorption.IsOpened():
  1921. self.wndSashAbsorption.Refresh(iAct)
  1922.  
  1923. self.wndInventory.RefreshBagSlotWindow()
  1924.  
  1925. if app.ENABLE_CHANGELOOK_SYSTEM:
  1926. def ActChangeLook(self, iAct):
  1927. if iAct == 1:
  1928. if not self.wndChangeLook.IsOpened():
  1929. self.wndChangeLook.Open()
  1930.  
  1931. if not self.wndInventory.IsShow():
  1932. self.wndInventory.Show()
  1933.  
  1934. self.wndInventory.RefreshBagSlotWindow()
  1935. elif iAct == 2:
  1936. if self.wndChangeLook.IsOpened():
  1937. self.wndChangeLook.Close()
  1938.  
  1939. self.wndInventory.RefreshBagSlotWindow()
  1940. elif iAct == 3 or iAct == 4:
  1941. if self.wndChangeLook.IsOpened():
  1942. self.wndChangeLook.Refresh()
  1943.  
  1944. self.wndInventory.RefreshBagSlotWindow()
  1945.  
  1946. def OpenCubeWindow(self):
  1947. self.wndCube.Open()
  1948.  
  1949. if FALSE == self.wndInventory.IsShow():
  1950. self.wndInventory.Show()
  1951.  
  1952. def UpdateCubeInfo(self, gold, itemVnum, count):
  1953. self.wndCube.UpdateInfo(gold, itemVnum, count)
  1954.  
  1955. def CloseCubeWindow(self):
  1956. self.wndCube.Close()
  1957.  
  1958. def FailedCubeWork(self):
  1959. self.wndCube.Refresh()
  1960.  
  1961. def SucceedCubeWork(self, itemVnum, count):
  1962. self.wndCube.Clear()
  1963.  
  1964. print "큐브 제작 성공! [%d:%d]" % (itemVnum, count)
  1965.  
  1966. if 0: # 결과 메시지 출력은 생략 한다
  1967. self.wndCubeResult.SetPosition(*self.wndCube.GetGlobalPosition())
  1968. self.wndCubeResult.SetCubeResultItem(itemVnum, count)
  1969. self.wndCubeResult.Open()
  1970. self.wndCubeResult.SetTop()
  1971.  
  1972. def __HideWindows(self):
  1973. hideWindows = self.wndTaskBar,\
  1974. self.wndCharacter,\
  1975. self.wndInventory,\
  1976. self.wndMiniMap,\
  1977. self.wndGuild,\
  1978. self.wndMessenger,\
  1979. self.wndChat,\
  1980. self.yangText,\
  1981. self.wndParty,\
  1982. self.wndGameButton,
  1983.  
  1984. if self.wndEnergyBar:
  1985. hideWindows += self.wndEnergyBar,
  1986. if app.ENABLE_MINI_GAME:
  1987. if self.wndMiniGame:
  1988. hideWindows += self.wndMiniGame,
  1989.  
  1990. if self.wndExpandedTaskBar:
  1991. hideWindows += self.wndExpandedTaskBar,
  1992.  
  1993. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1994. hideWindows += self.wndDragonSoul,\
  1995. self.wndDragonSoulRefine,
  1996.  
  1997. hideWindows = filter(lambda x:x.IsShow(), hideWindows)
  1998. map(lambda x:x.Hide(), hideWindows)
  1999. import sys
  2000.  
  2001. self.HideAllQuestButton()
  2002. self.HideAllWhisperButton()
  2003.  
  2004. if self.wndChat.IsEditMode():
  2005. self.wndChat.CloseChat()
  2006.  
  2007. return hideWindows
  2008.  
  2009. def __ShowWindows(self, wnds):
  2010. import sys
  2011. map(lambda x:x.Show(), wnds)
  2012. global IsQBHide
  2013. if not IsQBHide:
  2014. self.ShowAllQuestButton()
  2015. else:
  2016. self.HideAllQuestButton()
  2017.  
  2018. self.ShowAllWhisperButton()
  2019.  
  2020. def BINARY_OpenAtlasWindow(self):
  2021. if self.wndMiniMap:
  2022. self.wndMiniMap.ShowAtlas()
  2023.  
  2024. def BINARY_SetObserverMode(self, flag):
  2025. self.wndGameButton.SetObserverMode(flag)
  2026.  
  2027. # ACCESSORY_REFINE_ADD_METIN_STONE
  2028. def BINARY_OpenSelectItemWindow(self):
  2029. self.wndItemSelect.Open()
  2030. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  2031.  
  2032. #####################################################################################
  2033. ### Private Shop ###
  2034.  
  2035. def OpenPrivateShopInputNameDialog(self):
  2036. #if player.IsInSafeArea():
  2037. # chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_OPEN_PRIVATE_SHOP_IN_SAFE_AREA)
  2038. # return
  2039.  
  2040. inputDialog = uiCommon.InputDialog()
  2041. inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE)
  2042. inputDialog.SetMaxLength(32)
  2043. inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder))
  2044. inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog))
  2045. inputDialog.Open()
  2046. self.inputDialog = inputDialog
  2047.  
  2048. def ClosePrivateShopInputNameDialog(self):
  2049. self.inputDialog = None
  2050. return True
  2051.  
  2052. def OpenPrivateShopBuilder(self):
  2053.  
  2054. if not self.inputDialog:
  2055. return True
  2056.  
  2057. if not len(self.inputDialog.GetText()):
  2058. return True
  2059.  
  2060. self.privateShopBuilder.Open(self.inputDialog.GetText())
  2061. self.ClosePrivateShopInputNameDialog()
  2062. return True
  2063.  
  2064. def AppearPrivateShop(self, vid, text):
  2065.  
  2066. board = uiPrivateShopBuilder.PrivateShopAdvertisementBoard()
  2067. board.Open(vid, text)
  2068.  
  2069. self.privateShopAdvertisementBoardDict[vid] = board
  2070.  
  2071. def DisappearPrivateShop(self, vid):
  2072.  
  2073. if not self.privateShopAdvertisementBoardDict.has_key(vid):
  2074. return
  2075.  
  2076. del self.privateShopAdvertisementBoardDict[vid]
  2077. uiPrivateShopBuilder.DeleteADBoard(vid)
  2078.  
  2079. #####################################################################################
  2080. ### Equipment ###
  2081.  
  2082. def OpenEquipmentDialog(self, vid):
  2083. dlg = uiEquipmentDialog.EquipmentDialog()
  2084. dlg.SetItemToolTip(self.tooltipItem)
  2085. dlg.SetCloseEvent(ui.__mem_func__(self.CloseEquipmentDialog))
  2086. dlg.Open(vid)
  2087.  
  2088. self.equipmentDialogDict[vid] = dlg
  2089.  
  2090. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  2091. if not vid in self.equipmentDialogDict:
  2092. return
  2093. self.equipmentDialogDict[vid].SetEquipmentDialogItem(slotIndex, vnum, count)
  2094.  
  2095. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  2096. if not vid in self.equipmentDialogDict:
  2097. return
  2098. self.equipmentDialogDict[vid].SetEquipmentDialogSocket(slotIndex, socketIndex, value)
  2099.  
  2100. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  2101. if not vid in self.equipmentDialogDict:
  2102. return
  2103. self.equipmentDialogDict[vid].SetEquipmentDialogAttr(slotIndex, attrIndex, type, value)
  2104.  
  2105. def CloseEquipmentDialog(self, vid):
  2106. if not vid in self.equipmentDialogDict:
  2107. return
  2108. del self.equipmentDialogDict[vid]
  2109.  
  2110. #####################################################################################
  2111.  
  2112. #####################################################################################
  2113. ### Quest ###
  2114. def BINARY_ClearQuest(self, index):
  2115. btn = self.__FindQuestButton(index)
  2116. if 0 != btn:
  2117. self.__DestroyQuestButton(btn)
  2118.  
  2119. def RecvQuest(self, index, name):
  2120. # QUEST_LETTER_IMAGE
  2121. self.BINARY_RecvQuest(index, name, "file", localeInfo.GetLetterImageName())
  2122. # END_OF_QUEST_LETTER_IMAGE
  2123.  
  2124. def BINARY_RecvQuest(self, index, name, iconType, iconName):
  2125.  
  2126. btn = self.__FindQuestButton(index)
  2127. if 0 != btn:
  2128. self.__DestroyQuestButton(btn)
  2129.  
  2130. btn = uiWhisper.WhisperButton()
  2131.  
  2132. # QUEST_LETTER_IMAGE
  2133. ##!! 20061026.levites.퀘스트_이미지_교체
  2134. import item
  2135. if "item"==iconType:
  2136. item.SelectItem(int(iconName))
  2137. buttonImageFileName=item.GetIconImageFileName()
  2138. else:
  2139. buttonImageFileName=iconName
  2140.  
  2141. if iconName and (iconType not in ("item", "file")): # type "ex" implied
  2142. btn.SetUpVisual("d:/ymir work/ui/game/quest/questicon/%s" % (iconName.replace("open", "close")))
  2143. btn.SetOverVisual("d:/ymir work/ui/game/quest/questicon/%s" % (iconName))
  2144. btn.SetDownVisual("d:/ymir work/ui/game/quest/questicon/%s" % (iconName))
  2145. else:
  2146. if localeInfo.IsEUROPE():
  2147. btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
  2148. btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
  2149. btn.SetDownVisual(localeInfo.GetLetterOpenImageName())
  2150. else:
  2151. btn.SetUpVisual(buttonImageFileName)
  2152. btn.SetOverVisual(buttonImageFileName)
  2153. btn.SetDownVisual(buttonImageFileName)
  2154. btn.Flash()
  2155. # END_OF_QUEST_LETTER_IMAGE
  2156.  
  2157. if localeInfo.IsARABIC():
  2158. btn.SetToolTipText(name, 0, 35)
  2159. btn.ToolTipText.SetHorizontalAlignCenter()
  2160. else:
  2161. btn.SetToolTipText(name, -20, 35)
  2162. btn.ToolTipText.SetHorizontalAlignLeft()
  2163.  
  2164. listOfTypes = iconType.split(",")
  2165. if "blink" in listOfTypes:
  2166. btn.Flash()
  2167.  
  2168. listOfColors = {
  2169. "golden": 0xFFffa200,
  2170. "green": 0xFF00e600,
  2171. "blue": 0xFF0099ff,
  2172. "purple": 0xFFcc33ff,
  2173.  
  2174. "fucsia": 0xFFcc0099,
  2175. "aqua": 0xFF00ffff,
  2176. }
  2177. for k,v in listOfColors.iteritems():
  2178. if k in listOfTypes:
  2179. btn.ToolTipText.SetPackedFontColor(v)
  2180.  
  2181. btn.SetEvent(ui.__mem_func__(self.__StartQuest), btn)
  2182. btn.Show()
  2183.  
  2184. btn.index = index
  2185. btn.name = name
  2186.  
  2187. self.questButtonList.insert(0, btn)
  2188. self.__ArrangeQuestButton()
  2189.  
  2190. #chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.QUEST_APPEND)
  2191.  
  2192. def __ArrangeQuestButton(self):
  2193.  
  2194. screenWidth = wndMgr.GetScreenWidth()
  2195. screenHeight = wndMgr.GetScreenHeight()
  2196.  
  2197. ##!! 20061026.levites.퀘스트_위치_보정
  2198. if self.wndParty.IsShow():
  2199. xPos = 100 + 30
  2200. else:
  2201. xPos = 20
  2202.  
  2203. if localeInfo.IsARABIC():
  2204. xPos = xPos + 15
  2205.  
  2206. yPos = 170 * screenHeight / 600
  2207. yCount = (screenHeight - 330) / 63
  2208.  
  2209. count = 0
  2210. for btn in self.questButtonList:
  2211.  
  2212. btn.SetPosition(xPos + (int(count/yCount) * 100), yPos + (count%yCount * 63))
  2213. count += 1
  2214. global IsQBHide
  2215. if IsQBHide:
  2216. btn.Hide()
  2217. else:
  2218. btn.Show()
  2219.  
  2220. def __StartQuest(self, btn):
  2221. event.QuestButtonClick(btn.index)
  2222. self.__DestroyQuestButton(btn)
  2223.  
  2224. def __FindQuestButton(self, index):
  2225. for btn in self.questButtonList:
  2226. if btn.index == index:
  2227. return btn
  2228.  
  2229. return 0
  2230.  
  2231. def __DestroyQuestButton(self, btn):
  2232. btn.SetEvent(0)
  2233. self.questButtonList.remove(btn)
  2234. self.__ArrangeQuestButton()
  2235.  
  2236. def HideAllQuestButton(self):
  2237. for btn in self.questButtonList:
  2238. btn.Hide()
  2239.  
  2240. def ShowAllQuestButton(self):
  2241. for btn in self.questButtonList:
  2242. btn.Show()
  2243. #####################################################################################
  2244.  
  2245. #####################################################################################
  2246. ### Whisper ###
  2247.  
  2248. def __InitWhisper(self):
  2249. chat.InitWhisper(self)
  2250.  
  2251. ## 채팅창의 "메시지 보내기"를 눌렀을때 이름 없는 대화창을 여는 함수
  2252. ## 이름이 없기 때문에 기존의 WhisperDialogDict 와 별도로 관리된다.
  2253. def OpenWhisperDialogWithoutTarget(self):
  2254. if not self.dlgWhisperWithoutTarget:
  2255. dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog)
  2256. dlgWhisper.BindInterface(self)
  2257. dlgWhisper.LoadDialog()
  2258. dlgWhisper.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog)
  2259. dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30)
  2260. dlgWhisper.Show()
  2261. self.dlgWhisperWithoutTarget = dlgWhisper
  2262.  
  2263. self.windowOpenPosition = (self.windowOpenPosition+1) % 5
  2264.  
  2265. else:
  2266. self.dlgWhisperWithoutTarget.SetTop()
  2267. self.dlgWhisperWithoutTarget.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog)
  2268.  
  2269. ## 이름 없는 대화창에서 이름을 결정했을때 WhisperDialogDict에 창을 넣어주는 함수
  2270. def RegisterTemporaryWhisperDialog(self, name):
  2271. if not self.dlgWhisperWithoutTarget:
  2272. return
  2273.  
  2274. btn = self.__FindWhisperButton(name)
  2275. if 0 != btn:
  2276. self.__DestroyWhisperButton(btn)
  2277.  
  2278. elif self.whisperDialogDict.has_key(name):
  2279. oldDialog = self.whisperDialogDict[name]
  2280. oldDialog.Destroy()
  2281. del self.whisperDialogDict[name]
  2282.  
  2283. self.whisperDialogDict[name] = self.dlgWhisperWithoutTarget
  2284. self.dlgWhisperWithoutTarget.OpenWithTarget(name)
  2285. self.dlgWhisperWithoutTarget = None
  2286. self.__CheckGameMaster(name)
  2287.  
  2288. ## 캐릭터 메뉴의 1:1 대화 하기를 눌렀을때 이름을 가지고 바로 창을 여는 함수
  2289. def OpenWhisperDialog(self, name):
  2290. if not self.whisperDialogDict.has_key(name):
  2291. dlg = self.__MakeWhisperDialog(name)
  2292. dlg.OpenWithTarget(name)
  2293. dlg.chatLine.SetFocus()
  2294. dlg.Show()
  2295.  
  2296. self.__CheckGameMaster(name)
  2297. btn = self.__FindWhisperButton(name)
  2298. if 0 != btn:
  2299. self.__DestroyWhisperButton(btn)
  2300.  
  2301. ## 다른 캐릭터로부터 메세지를 받았을때 일단 버튼만 띄워 두는 함수
  2302. def RecvWhisper(self, name):
  2303. if not self.whisperDialogDict.has_key(name):
  2304. btn = self.__FindWhisperButton(name)
  2305. if 0 == btn:
  2306. btn = self.__MakeWhisperButton(name)
  2307. btn.Flash()
  2308.  
  2309. chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name))
  2310.  
  2311. else:
  2312. btn.Flash()
  2313. elif self.IsGameMasterName(name):
  2314. dlg = self.whisperDialogDict[name]
  2315. dlg.SetGameMasterLook()
  2316.  
  2317. def MakeWhisperButton(self, name):
  2318. self.__MakeWhisperButton(name)
  2319.  
  2320. ## 버튼을 눌렀을때 창을 여는 함수
  2321. def ShowWhisperDialog(self, btn):
  2322. try:
  2323. self.__MakeWhisperDialog(btn.name)
  2324. dlgWhisper = self.whisperDialogDict[btn.name]
  2325. dlgWhisper.OpenWithTarget(btn.name)
  2326. dlgWhisper.Show()
  2327. self.__CheckGameMaster(btn.name)
  2328. except:
  2329. import dbg
  2330. dbg.TraceError("interface.ShowWhisperDialog - Failed to find key")
  2331.  
  2332. ## 버튼 초기화
  2333. self.__DestroyWhisperButton(btn)
  2334.  
  2335. ## WhisperDialog 창에서 최소화 명령을 수행했을때 호출되는 함수
  2336. ## 창을 최소화 합니다.
  2337. def MinimizeWhisperDialog(self, name):
  2338.  
  2339. if 0 != name:
  2340. self.__MakeWhisperButton(name)
  2341.  
  2342. self.CloseWhisperDialog(name)
  2343.  
  2344. ## WhisperDialog 창에서 닫기 명령을 수행했을때 호출되는 함수
  2345. ## 창을 지웁니다.
  2346. def CloseWhisperDialog(self, name):
  2347.  
  2348. if 0 == name:
  2349.  
  2350. if self.dlgWhisperWithoutTarget:
  2351. self.dlgWhisperWithoutTarget.Destroy()
  2352. self.dlgWhisperWithoutTarget = None
  2353.  
  2354. return
  2355.  
  2356. try:
  2357. dlgWhisper = self.whisperDialogDict[name]
  2358. dlgWhisper.Destroy()
  2359. del self.whisperDialogDict[name]
  2360. except:
  2361. import dbg
  2362. dbg.TraceError("interface.CloseWhisperDialog - Failed to find key")
  2363.  
  2364. ## 버튼의 개수가 바뀌었을때 버튼을 재정렬 하는 함수
  2365. def __ArrangeWhisperButton(self):
  2366.  
  2367. screenWidth = wndMgr.GetScreenWidth()
  2368. screenHeight = wndMgr.GetScreenHeight()
  2369.  
  2370. xPos = screenWidth - 70
  2371. yPos = 170 * screenHeight / 600
  2372. yCount = (screenHeight - 330) / 63
  2373. #yCount = (screenHeight - 285) / 63
  2374.  
  2375. count = 0
  2376. for button in self.whisperButtonList:
  2377.  
  2378. button.SetPosition(xPos + (int(count/yCount) * -50), yPos + (count%yCount * 63))
  2379. count += 1
  2380.  
  2381. ## 이름으로 Whisper 버튼을 찾아 리턴해 주는 함수
  2382. ## 버튼은 딕셔너리로 하지 않는 것은 정렬 되어 버려 순서가 유지 되지 않으며
  2383. ## 이로 인해 ToolTip들이 다른 버튼들에 의해 가려지기 때문이다.
  2384. def __FindWhisperButton(self, name):
  2385. for button in self.whisperButtonList:
  2386. if button.name == name:
  2387. return button
  2388.  
  2389. return 0
  2390.  
  2391. ## 창을 만듭니다.
  2392. def __MakeWhisperDialog(self, name):
  2393. dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog)
  2394. dlgWhisper.BindInterface(self)
  2395. dlgWhisper.LoadDialog()
  2396. dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30)
  2397. self.whisperDialogDict[name] = dlgWhisper
  2398.  
  2399. self.windowOpenPosition = (self.windowOpenPosition+1) % 5
  2400.  
  2401. return dlgWhisper
  2402.  
  2403. ## 버튼을 만듭니다.
  2404. def __MakeWhisperDialog(self, name):
  2405. dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog)
  2406. dlgWhisper.BindInterface(self)
  2407. dlgWhisper.LoadDialog()
  2408. dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30)
  2409. self.whisperDialogDict[name] = dlgWhisper
  2410.  
  2411. self.windowOpenPosition = (self.windowOpenPosition+1) % 5
  2412.  
  2413. return dlgWhisper
  2414.  
  2415. def __MakeWhisperButton(self, name):
  2416. whisperButton = uiWhisper.WhisperButton()
  2417. whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub")
  2418. whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub")
  2419. whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub")
  2420. if self.IsGameMasterName(name):
  2421. whisperButton.SetToolTipTextWithColor(name, 0xffffa200)
  2422. else:
  2423. whisperButton.SetToolTipText(name)
  2424. whisperButton.ToolTipText.SetHorizontalAlignCenter()
  2425. whisperButton.SetEvent(ui.__mem_func__(self.ShowWhisperDialog), whisperButton)
  2426. whisperButton.Show()
  2427. whisperButton.name = name
  2428. self.whisperButtonList.insert(0, whisperButton)
  2429. self.__ArrangeWhisperButton()
  2430. return whisperButton
  2431.  
  2432. def __DestroyWhisperButton(self, button):
  2433. button.SetEvent(0)
  2434. self.whisperButtonList.remove(button)
  2435. self.__ArrangeWhisperButton()
  2436.  
  2437. def HideAllWhisperButton(self):
  2438. for btn in self.whisperButtonList:
  2439. btn.Hide()
  2440.  
  2441. def ShowAllWhisperButton(self):
  2442. for btn in self.whisperButtonList:
  2443. btn.Show()
  2444.  
  2445. def __CheckGameMaster(self, name):
  2446. if not self.listGMName.has_key(name):
  2447. return
  2448. if self.whisperDialogDict.has_key(name):
  2449. dlg = self.whisperDialogDict[name]
  2450. dlg.SetGameMasterLook()
  2451.  
  2452. def RegisterGameMasterName(self, name):
  2453. if self.listGMName.has_key(name):
  2454. return
  2455. self.listGMName[name] = "GM"
  2456.  
  2457. def IsGameMasterName(self, name):
  2458. if self.listGMName.has_key(name):
  2459. return True
  2460. else:
  2461. return False
  2462.  
  2463. #####################################################################################
  2464.  
  2465. #####################################################################################
  2466. ### Guild Building ###
  2467.  
  2468. def BUILD_OpenWindow(self):
  2469. self.wndGuildBuilding = uiGuild.BuildGuildBuildingWindow()
  2470. self.wndGuildBuilding.Open()
  2471. self.wndGuildBuilding.wnds = self.__HideWindows()
  2472. self.wndGuildBuilding.SetCloseEvent(ui.__mem_func__(self.BUILD_CloseWindow))
  2473.  
  2474. def BUILD_CloseWindow(self):
  2475. self.__ShowWindows(self.wndGuildBuilding.wnds)
  2476. self.wndGuildBuilding = None
  2477.  
  2478. def BUILD_OnUpdate(self):
  2479. if not self.wndGuildBuilding:
  2480. return
  2481.  
  2482. if self.wndGuildBuilding.IsPositioningMode():
  2483. import background
  2484. x, y, z = background.GetPickingPoint()
  2485. self.wndGuildBuilding.SetBuildingPosition(x, y, z)
  2486.  
  2487. def BUILD_OnMouseLeftButtonDown(self):
  2488. if not self.wndGuildBuilding:
  2489. return
  2490.  
  2491. # GUILD_BUILDING
  2492. if self.wndGuildBuilding.IsPositioningMode():
  2493. self.wndGuildBuilding.SettleCurrentPosition()
  2494. return True
  2495. elif self.wndGuildBuilding.IsPreviewMode():
  2496. pass
  2497. else:
  2498. return True
  2499. # END_OF_GUILD_BUILDING
  2500. return False
  2501.  
  2502. def BUILD_OnMouseLeftButtonUp(self):
  2503. if not self.wndGuildBuilding:
  2504. return
  2505.  
  2506. if not self.wndGuildBuilding.IsPreviewMode():
  2507. return True
  2508.  
  2509. return False
  2510.  
  2511. def BULID_EnterGuildArea(self, areaID):
  2512. # GUILD_BUILDING
  2513. mainCharacterName = player.GetMainCharacterName()
  2514. masterName = guild.GetGuildMasterName()
  2515.  
  2516. if mainCharacterName != masterName:
  2517. return
  2518.  
  2519. if areaID != player.GetGuildID():
  2520. return
  2521. # END_OF_GUILD_BUILDING
  2522.  
  2523. self.wndGameButton.ShowBuildButton()
  2524.  
  2525. if app.ENABLE_MINI_GAME:
  2526. if app.ENABLE_FISH_EVENT:
  2527. def MiniGameFishUse(self, shape, useCount):
  2528. if self.wndMiniGame:
  2529. self.wndMiniGame.MiniGameFishUse(shape, useCount)
  2530.  
  2531. def MiniGameFishAdd(self, pos, shape):
  2532. if self.wndMiniGame:
  2533. self.wndMiniGame.MiniGameFishAdd(pos, shape)
  2534.  
  2535. def MiniGameFishReward(self, vnum):
  2536. if self.wndMiniGame:
  2537. self.wndMiniGame.MiniGameFishReward(vnum)
  2538.  
  2539. def MiniGameFishCount(self, count):
  2540. if self.wndMiniGame:
  2541. self.wndMiniGame.MiniGameFishCount(count)
  2542.  
  2543. def SetFishEventStatus(self, isEnable):
  2544. if isEnable:
  2545. self.miniGameList.append( 1 )
  2546.  
  2547. def IntegrationEventBanner(self):
  2548. if True in self.miniGameList:
  2549. if not self.wndMiniGame:
  2550. self.wndMiniGame = uiMiniGame.MiniGameWindow()
  2551.  
  2552. if app.ENABLE_FISH_EVENT:
  2553. if self.tooltipItem:
  2554. if self.wndMiniGame:
  2555. self.wndMiniGame.SetItemToolTip(self.tooltipItem)
  2556.  
  2557. if app.WJ_ENABLE_TRADABLE_ICON:
  2558. if self.wndMiniGame:
  2559. self.wndMiniGame.BindInterface(self)
  2560.  
  2561. if self.wndInventory:
  2562. if self.wndMiniGame:
  2563. self.wndMiniGame.BindInventory(self.wndInventory)
  2564.  
  2565. self.wndMiniGame.IntegrationMiniGame(True)
  2566. else:
  2567. if self.wndMiniGame:
  2568. self.wndMiniGame.IntegrationMiniGame(False)
  2569.  
  2570. def BULID_ExitGuildArea(self, areaID):
  2571. self.wndGameButton.HideBuildButton()
  2572.  
  2573.  
  2574. #####################################################################################
  2575.  
  2576. def IsEditLineFocus(self):
  2577. if self.ChatWindow.chatLine.IsFocus():
  2578. return 1
  2579.  
  2580. if self.ChatWindow.chatToLine.IsFocus():
  2581. return 1
  2582.  
  2583. return 0
  2584.  
  2585. def EmptyFunction(self):
  2586. pass
  2587.  
  2588. if __name__ == "__main__":
  2589.  
  2590. import app
  2591. import wndMgr
  2592. import systemSetting
  2593. import mouseModule
  2594. import grp
  2595. import ui
  2596. import localeInfo
  2597.  
  2598. app.SetMouseHandler(mouseModule.mouseController)
  2599. app.SetHairColorEnable(True)
  2600. wndMgr.SetMouseHandler(mouseModule.mouseController)
  2601. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2602. app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2603. mouseModule.mouseController.Create()
  2604.  
  2605. class TestGame(ui.Window):
  2606. def __init__(self):
  2607. ui.Window.__init__(self)
  2608.  
  2609. localeInfo.LoadLocaleData()
  2610. player.SetItemData(0, 27001, 10)
  2611. player.SetItemData(1, 27004, 10)
  2612.  
  2613. self.interface = Interface()
  2614. self.interface.MakeInterface()
  2615. self.interface.ShowDefaultWindows()
  2616. self.interface.RefreshInventory()
  2617. #self.interface.OpenCubeWindow()
  2618.  
  2619. def __del__(self):
  2620. ui.Window.__del__(self)
  2621.  
  2622. def OnUpdate(self):
  2623. app.UpdateGame()
  2624.  
  2625. def OnRender(self):
  2626. app.RenderGame()
  2627. grp.PopState()
  2628. grp.SetInterfaceRenderState()
  2629.  
  2630. game = TestGame()
  2631. game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2632. game.Show()
  2633.  
  2634. app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement