1. ##
  2. ## Interface
  3. ##
  4. import constInfo
  5. import systemSetting
  6. import wndMgr
  7. import chat
  8. import app
  9. import player
  10. import uiAcce
  11. import uiTaskBar
  12. import uiCharacter
  13. import uiInventory
  14. import uiDragonSoul
  15. import uiChat
  16. import uiMessenger
  17. import guild
  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 uiCards
  40. import uiOfflineShop
  41. import uiOfflineShopBuilder
  42. import miniMap
  43. # ACCESSORY_REFINE_ADD_METIN_STONE
  44. import uiSelectItem
  45. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  46. import uiScriptLocale
  47. import event
  48. import localeInfo
  49. import uiguildstorage
  50. if app.ENABLE_MELEY_LAIR_DUNGEON:
  51. import uidragonlairranking
  52. IsQBHide = 0
  53. statutahta1 = 0
  54. class Interface(object):
  55. CHARACTER_STATUS_TAB = 1
  56. CHARACTER_SKILL_TAB = 2
  57. def __init__(self):
  58. systemSetting.SetInterfaceHandler(self)
  59. self.windowOpenPosition = 0
  60. self.dlgWhisperWithoutTarget = None
  61. self.inputDialog = None
  62. self.tipBoard = None
  63. self.bigBoard = None
  64. self.wndGiftBox = None
  65. # ITEM_MALL
  66. self.mallPageDlg = None
  67. # END_OF_ITEM_MALL
  68. self.wndWeb = None
  69. self.wndTaskBar = None
  70. self.wndCharacter = None
  71. self.wndInventory = None
  72. self.wndExpandedTaskBar = None
  73. self.wndDragonSoul = None
  74. self.wndDragonSoulRefine = None
  75. self.wndChat = None
  76. self.wndMessenger = None
  77. self.wndMiniMap = None
  78. self.wndGuild = None
  79. self.wndGuildBuilding = None
  80. # OFFLINE_SHOP
  81. self.wndOfflineShopAdminPanel = None
  82. # END_OF_OFFLINE_SHOP
  83. self.listGMName = {}
  84. self.wndQuestWindow = {}
  85. self.wndQuestWindowNewKey = 0
  86. self.privateShopAdvertisementBoardDict = {}
  87. self.guildScoreBoardDict = {}
  88. self.equipmentDialogDict = {}
  89. self.offlineShopAdvertisementBoardDict = {}
  90. event.SetInterfaceWindow(self)
  91. def __del__(self):
  92. systemSetting.DestroyInterfaceHandler()
  93. event.SetInterfaceWindow(None)
  94. def SetStream(self, stream):
  95. self.stream = stream
  96. def __OnClickGiftButton(self):
  97. if self.wndGameButton:
  98. if not self.wndGiftBox.IsShow():
  99. self.wndGiftBox.Open()
  100. else:
  101. self.wndGiftBox.Close()
  102. def ClearGift(self):
  103. if self.wndGameButton:
  104. self.wndGameButton.HideGiftButton()
  105. if self.wndGiftBox:
  106. self.wndGiftBox.Clear()
  107. self.wndGiftBox.Refresh()
  108. def OpenGift(self,i):
  109. if self.wndGameButton:
  110. self.wndGameButton.ShowGiftButton()
  111. ################################
  112. ## Make Windows & Dialogs
  113. def __MakeUICurtain(self):
  114. wndUICurtain = ui.Bar("TOP_MOST")
  115. wndUICurtain.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight())
  116. wndUICurtain.SetColor(0x77000000)
  117. wndUICurtain.Hide()
  118. self.wndUICurtain = wndUICurtain
  119. def __MakeMessengerWindow(self):
  120. self.wndMessenger = uiMessenger.MessengerWindow()
  121. from _weakref import proxy
  122. self.wndMessenger.SetWhisperButtonEvent(lambda n,i=proxy(self):i.OpenWhisperDialog(n))
  123. self.wndMessenger.SetGuildButtonEvent(ui.__mem_func__(self.ToggleGuildWindow))
  124. def __MakeGuildWindow(self):
  125. self.wndGuild = uiGuild.GuildWindow()
  126. def __MakeChatWindow(self):
  127. wndChat = uiChat.ChatWindow()
  128. wndChat.SetSize(wndChat.CHAT_WINDOW_WIDTH, 0)
  129. wndChat.SetPosition(wndMgr.GetScreenWidth()/2 - wndChat.CHAT_WINDOW_WIDTH/2 + 46, wndMgr.GetScreenHeight() - wndChat.EDIT_LINE_HEIGHT - 47)
  130. wndChat.SetHeight(200)
  131. wndChat.Refresh()
  132. wndChat.Show()
  133. self.wndChat = wndChat
  134. self.wndChat.BindInterface(self)
  135. self.wndChat.SetSendWhisperEvent(ui.__mem_func__(self.OpenWhisperDialogWithoutTarget))
  136. self.wndChat.SetOpenChatLogEvent(ui.__mem_func__(self.ToggleChatLogWindow))
  137. def __MakeTaskBar(self):
  138. wndTaskBar = uiTaskBar.TaskBar()
  139. wndTaskBar.LoadWindow()
  140. self.wndTaskBar = wndTaskBar
  141. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHARACTER, ui.__mem_func__(self.ToggleCharacterWindowStatusPage))
  142. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_INVENTORY, ui.__mem_func__(self.ToggleInventoryWindow))
  143. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_MESSENGER, ui.__mem_func__(self.ToggleMessenger))
  144. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_SYSTEM, ui.__mem_func__(self.ToggleSystemDialog))
  145. if uiTaskBar.TaskBar.IS_EXPANDED:
  146. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_EXPAND, ui.__mem_func__(self.ToggleExpandedButton))
  147. self.wndExpandedTaskBar = uiTaskBar.ExpandedTaskBar()
  148. self.wndExpandedTaskBar.LoadWindow()
  149. self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, ui.__mem_func__(self.ToggleDragonSoulWindow))
  150. #self.wndExpandedTaskBar.SetToggleButtonEvent(uiTaskBar.ExpandedTaskBar.BUTTON_PET_GUI, ui.__mem_func__(self.TogglePetMain))
  151. else:
  152. self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHAT, ui.__mem_func__(self.ToggleChat))
  153. self.wndEnergyBar = None
  154. import app
  155. if app.ENABLE_ENERGY_SYSTEM:
  156. wndEnergyBar = uiTaskBar.EnergyBar()
  157. wndEnergyBar.LoadWindow()
  158. self.wndEnergyBar = wndEnergyBar
  159. def __MakeParty(self):
  160. wndParty = uiParty.PartyWindow()
  161. wndParty.Hide()
  162. self.wndParty = wndParty
  163. def __MakeGameButtonWindow(self):
  164. wndGameButton = uiGameButton.GameButtonWindow()
  165. wndGameButton.SetTop()
  166. wndGameButton.Show()
  167. wndGameButton.SetButtonEvent("STATUS", ui.__mem_func__(self.__OnClickStatusPlusButton))
  168. wndGameButton.SetButtonEvent("SKILL", ui.__mem_func__(self.__OnClickSkillPlusButton))
  169. wndGameButton.SetButtonEvent("QUEST", ui.__mem_func__(self.__OnClickQuestButton))
  170. wndGameButton.SetButtonEvent("HELP", ui.__mem_func__(self.__OnClickHelpButton))
  171. wndGameButton.SetButtonEvent("BUILD", ui.__mem_func__(self.__OnClickBuildButton))
  172. wndGameButton.SetButtonEvent("GIFT", ui.__mem_func__(self.__OnClickGiftButton))
  173. self.wndGameButton = wndGameButton
  174. def __IsChatOpen(self):
  175. return TRUE
  176. def __MakeWindows(self):
  177. wndCharacter = uiCharacter.CharacterWindow()
  178. wndInventory = uiInventory.InventoryWindow()
  179. wndInventory.BindInterfaceClass(self)
  180. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  181. wndDragonSoul = uiDragonSoul.DragonSoulWindow()
  182. wndDragonSoulRefine = uiDragonSoul.DragonSoulRefineWindow()
  183. else:
  184. wndDragonSoul = None
  185. wndDragonSoulRefine = None
  186. wndMiniMap = uiMiniMap.MiniMap()
  187. wndSafebox = uiSafebox.SafeboxWindow()
  188. # ITEM_MALL
  189. wndMall = uiSafebox.MallWindow()
  190. self.wndMall = wndMall
  191. # END_OF_ITEM_MALL
  192. wndChatLog = uiChat.ChatLogWindow()
  193. wndChatLog.BindInterface(self)
  194. # OFFLINE_SHOP_ADMIN_PANEL
  195. wndOfflineShopAdminPanel = uiOfflineShop.OfflineShopAdminPanelWindow()
  196. wndOfflineShopAdminPanel.BindInterfaceClass(self)
  197. self.wndOfflineShopAdminPanel = wndOfflineShopAdminPanel
  198. # END_OF_OFFLINE_SHOP_ADMIN_PANEL
  199. self.wndCharacter = wndCharacter
  200. self.wndInventory = wndInventory
  201. self.wndDragonSoul = wndDragonSoul
  202. self.wndDragonSoulRefine = wndDragonSoulRefine
  203. self.wndMiniMap = wndMiniMap
  204. self.wndSafebox = wndSafebox
  205. self.wndChatLog = wndChatLog
  206. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  207. self.wndDragonSoul.SetDragonSoulRefineWindow(self.wndDragonSoulRefine)
  208. self.wndDragonSoulRefine.SetInventoryWindows(self.wndInventory, self.wndDragonSoul)
  209. self.wndInventory.SetDragonSoulRefineWindow(self.wndDragonSoulRefine)
  210. def __MakeDialogs(self):
  211. self.dlgExchange = uiExchange.ExchangeDialog()
  212. self.dlgExchange.LoadDialog()
  213. self.dlgExchange.SetCenterPosition()
  214. self.dlgExchange.Hide()
  215. self.dlgPointReset = uiPointReset.PointResetDialog()
  216. self.dlgPointReset.LoadDialog()
  217. self.dlgPointReset.Hide()
  218. self.dlgShop = uiShop.ShopDialog()
  219. self.dlgShop.LoadDialog()
  220. self.dlgShop.Hide()
  221. self.dlgOfflineShop = uiOfflineShop.OfflineShopDialog()
  222. self.dlgOfflineShop.LoadDialog()
  223. self.dlgOfflineShop.Hide()
  224. self.dlgRestart = uiRestart.RestartDialog()
  225. self.dlgRestart.LoadDialog()
  226. self.dlgRestart.Hide()
  227. self.dlgSystem = uiSystem.SystemDialog(self.stream)
  228. self.dlgSystem.LoadDialog()
  229. self.dlgSystem.SetOpenHelpWindowEvent(ui.__mem_func__(self.OpenHelpWindow))
  230. self.dlgSystem.Hide()
  231. self.dlgPassword = uiSafebox.PasswordDialog()
  232. self.dlgPassword.Hide()
  233. self.hyperlinkItemTooltip = uiToolTip.HyperlinkItemToolTip()
  234. self.hyperlinkItemTooltip.Hide()
  235. self.GuildStorageWindow = uiguildstorage.GuildStorage()
  236. self.GuildStorageWindow.Show()
  237. self.tooltipItem = uiToolTip.ItemToolTip()
  238. self.tooltipItem.Hide()
  239. self.tooltipSkill = uiToolTip.SkillToolTip()
  240. self.tooltipSkill.Hide()
  241. self.privateShopBuilder = uiPrivateShopBuilder.PrivateShopBuilder()
  242. self.privateShopBuilder.Hide()
  243. self.offlineShopBuilder = uiOfflineShopBuilder.OfflineShopBuilder()
  244. self.offlineShopBuilder.Hide()
  245. self.dlgRefineNew = uiRefine.RefineDialogNew()
  246. self.dlgRefineNew.Hide()
  247. def __MakeHelpWindow(self):
  248. self.wndHelp = uiHelp.HelpWindow()
  249. self.wndHelp.LoadDialog()
  250. self.wndHelp.SetCloseEvent(ui.__mem_func__(self.CloseHelpWindow))
  251. self.wndHelp.Hide()
  252. def __MakeTipBoard(self):
  253. self.tipBoard = uiTip.TipBoard()
  254. self.tipBoard.Hide()
  255. self.bigBoard = uiTip.BigBoard()
  256. self.bigBoard.Hide()
  257. def __MakeWebWindow(self):
  258. if constInfo.IN_GAME_SHOP_ENABLE:
  259. import uiWeb
  260. self.wndWeb = uiWeb.WebWindow()
  261. self.wndWeb.LoadWindow()
  262. self.wndWeb.Hide()
  263. if app.ENABLE_MELEY_LAIR_DUNGEON:
  264. def __MakeMeleyRanking(self):
  265. self.wndMeleyRanking = uidragonlairranking.Window()
  266. self.wndMeleyRanking.LoadWindow()
  267. self.wndMeleyRanking.Hide()
  268. def __MakeAcceWindow(self):
  269. self.wndAcce = uiAcce.AcceWindow()
  270. self.wndAcce.LoadWindow()
  271. self.wndAcce.Hide()
  272. self.wndAcceAbs = uiAcce.AcceAbsorbWindow()
  273. self.wndAcceAbs.LoadWindow()
  274. self.wndAcceAbs.Hide()
  275. def __MakeCubeWindow(self):
  276. self.wndCube = uiCube.CubeWindow()
  277. self.wndCube.LoadWindow()
  278. self.wndCube.Hide()
  279. def __MakeCubeResultWindow(self):
  280. self.wndCubeResult = uiCube.CubeResultWindow()
  281. self.wndCubeResult.LoadWindow()
  282. self.wndCubeResult.Hide()
  283. def __MakeCardsInfoWindow(self):
  284. self.wndCardsInfo = uiCards.CardsInfoWindow()
  285. self.wndCardsInfo.LoadWindow()
  286. self.wndCardsInfo.Hide()
  287. def __MakeCardsWindow(self):
  288. self.wndCards = uiCards.CardsWindow()
  289. self.wndCards.LoadWindow()
  290. self.wndCards.Hide()
  291. def __MakeCardsIconWindow(self):
  292. self.wndCardsIcon = uiCards.IngameWindow()
  293. self.wndCardsIcon.LoadWindow()
  294. self.wndCardsIcon.Hide()
  295. # ACCESSORY_REFINE_ADD_METIN_STONE
  296. def __MakeItemSelectWindow(self):
  297. self.wndItemSelect = uiSelectItem.SelectItemWindow()
  298. self.wndItemSelect.Hide()
  299. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  300. def MakeInterface(self):
  301. self.__MakeMessengerWindow()
  302. self.__MakeGuildWindow()
  303. self.__MakeChatWindow()
  304. self.__MakeParty()
  305. self.__MakeWindows()
  306. self.__MakeDialogs()
  307. self.__MakeUICurtain()
  308. self.__MakeTaskBar()
  309. self.__MakeGameButtonWindow()
  310. self.__MakeHelpWindow()
  311. self.__MakeTipBoard()
  312. self.__MakeWebWindow()
  313. if app.ENABLE_MELEY_LAIR_DUNGEON:
  314. self.__MakeMeleyRanking()
  315. self.__MakeAcceWindow()
  316. self.__MakeCubeWindow()
  317. self.__MakeCubeResultWindow()
  318. self.__MakeCardsInfoWindow()
  319. self.__MakeCardsWindow()
  320. self.__MakeCardsIconWindow()
  321. import uiGift
  322. wndGiftBox=uiGift.GiftDialog()
  323. wndGiftBox.Hide()
  324. self.wndGiftBox=wndGiftBox
  325. # ACCESSORY_REFINE_ADD_METIN_STONE
  326. self.__MakeItemSelectWindow()
  327. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  328. self.questButtonList = []
  329. self.whisperButtonList = []
  330. self.whisperDialogDict = {}
  331. self.privateShopAdvertisementBoardDict = {}
  332. self.wndInventory.SetItemToolTip(self.tooltipItem)
  333. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  334. self.wndDragonSoul.SetItemToolTip(self.tooltipItem)
  335. self.wndDragonSoulRefine.SetItemToolTip(self.tooltipItem)
  336. self.wndSafebox.SetItemToolTip(self.tooltipItem)
  337. self.wndAcce.SetItemToolTip(self.tooltipItem)
  338. self.wndAcceAbs.SetItemToolTip(self.tooltipItem)
  339. self.wndCube.SetItemToolTip(self.tooltipItem)
  340. self.wndCubeResult.SetItemToolTip(self.tooltipItem)
  341. # ITEM_MALL
  342. self.wndMall.SetItemToolTip(self.tooltipItem)
  343. # END_OF_ITEM_MALL
  344. self.wndCharacter.SetSkillToolTip(self.tooltipSkill)
  345. self.wndTaskBar.SetItemToolTip(self.tooltipItem)
  346. self.wndTaskBar.SetSkillToolTip(self.tooltipSkill)
  347. self.wndGuild.SetSkillToolTip(self.tooltipSkill)
  348. # ACCESSORY_REFINE_ADD_METIN_STONE
  349. self.wndItemSelect.SetItemToolTip(self.tooltipItem)
  350. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  351. self.dlgShop.SetItemToolTip(self.tooltipItem)
  352. self.dlgExchange.SetItemToolTip(self.tooltipItem)
  353. self.privateShopBuilder.SetItemToolTip(self.tooltipItem)
  354. self.dlgOfflineShop.SetItemToolTip(self.tooltipItem)
  355. self.offlineShopBuilder.SetItemToolTip(self.tooltipItem)
  356. self.__InitWhisper()
  357. self.DRAGON_SOUL_IS_QUALIFIED = TRUE
  358. def MakeHyperlinkTooltip(self, hyperlink):
  359. tokens = hyperlink.split(":")
  360. if tokens and len(tokens):
  361. type = tokens[0]
  362. if "item" == type:
  363. self.hyperlinkItemTooltip.SetHyperlinkItem(tokens)
  364. else:# if click on [PN]
  365. self.OpenWhisperDialog(str(type))
  366. ## Make Windows & Dialogs
  367. ################################
  368. def Close(self):
  369. if self.dlgWhisperWithoutTarget:
  370. self.dlgWhisperWithoutTarget.Destroy()
  371. del self.dlgWhisperWithoutTarget
  372. if self.GuildStorageWindow:
  373. self.GuildStorageWindow.Hide()
  374. del self.GuildStorageWindow
  375. if self.dlgWhisperWithoutTarget:
  376. self.dlgWhisperWithoutTarget.Destroy()
  377. del self.dlgWhisperWithoutTarget
  378. if uiQuest.QuestDialog.__dict__.has_key("QuestCurtain"):
  379. uiQuest.QuestDialog.QuestCurtain.Close()
  380. if self.wndQuestWindow:
  381. for key, eachQuestWindow in self.wndQuestWindow.items():
  382. eachQuestWindow.nextCurtainMode = -1
  383. eachQuestWindow.CloseSelf()
  384. eachQuestWindow = None
  385. self.wndQuestWindow = {}
  386. if self.wndChat:
  387. self.wndChat.Destroy()
  388. if self.wndTaskBar:
  389. self.wndTaskBar.Destroy()
  390. if self.wndExpandedTaskBar:
  391. self.wndExpandedTaskBar.Destroy()
  392. if self.wndEnergyBar:
  393. self.wndEnergyBar.Destroy()
  394. if self.wndCharacter:
  395. self.wndCharacter.Destroy()
  396. if self.wndInventory:
  397. self.wndInventory.Destroy()
  398. if self.wndDragonSoul:
  399. self.wndDragonSoul.Destroy()
  400. if self.wndDragonSoulRefine:
  401. self.wndDragonSoulRefine.Destroy()
  402. if self.dlgExchange:
  403. self.dlgExchange.Destroy()
  404. if self.dlgPointReset:
  405. self.dlgPointReset.Destroy()
  406. if self.wndGiftBox:
  407. self.wndGiftBox.Clear()
  408. self.wndGiftBox.Hide()
  409. self.wndGiftBox.Destroy()
  410. del self.wndGiftBox
  411. if self.dlgShop:
  412. self.dlgShop.Destroy()
  413. if self.dlgRestart:
  414. self.dlgRestart.Destroy()
  415. if self.dlgSystem:
  416. self.dlgSystem.Destroy()
  417. if self.dlgPassword:
  418. self.dlgPassword.Destroy()
  419. if self.wndMiniMap:
  420. self.wndMiniMap.Destroy()
  421. if self.wndSafebox:
  422. self.wndSafebox.Destroy()
  423. if self.wndWeb:
  424. self.wndWeb.Destroy()
  425. self.wndWeb = None
  426. if self.wndMall:
  427. self.wndMall.Destroy()
  428. if self.wndParty:
  429. self.wndParty.Destroy()
  430. if self.wndHelp:
  431. self.wndHelp.Destroy()
  432. if app.ENABLE_MELEY_LAIR_DUNGEON:
  433. if self.wndMeleyRanking:
  434. self.wndMeleyRanking.Destroy()
  435. if self.wndCardsInfo:
  436. self.wndCardsInfo.Destroy()
  437. if self.wndCards:
  438. self.wndCards.Destroy()
  439. if self.wndCardsIcon:
  440. self.wndCardsIcon.Destroy()
  441. if self.wndAcce:
  442. self.wndAcce.Destroy()
  443. if self.wndAcceAbs:
  444. self.wndAcceAbs.Destroy()
  445. if self.wndCube:
  446. self.wndCube.Destroy()
  447. if self.wndCubeResult:
  448. self.wndCubeResult.Destroy()
  449. if self.wndMessenger:
  450. self.wndMessenger.Destroy()
  451. if self.wndGuild:
  452. self.wndGuild.Destroy()
  453. if self.privateShopBuilder:
  454. self.privateShopBuilder.Destroy()
  455. if self.dlgRefineNew:
  456. self.dlgRefineNew.Destroy()
  457. if self.wndGuildBuilding:
  458. self.wndGuildBuilding.Destroy()
  459. if self.wndGameButton:
  460. self.wndGameButton.Destroy()
  461. # ITEM_MALL
  462. if self.mallPageDlg:
  463. self.mallPageDlg.Destroy()
  464. # END_OF_ITEM_MALL
  465. # ACCESSORY_REFINE_ADD_METIN_STONE
  466. if self.wndItemSelect:
  467. self.wndItemSelect.Destroy()
  468. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  469. if (self.dlgOfflineShop):
  470. self.dlgOfflineShop.Destroy()
  471. if (self.offlineShopBuilder):
  472. self.offlineShopBuilder.Destroy()
  473. # OFFLINE_SHOP_ADMIN_PANEL
  474. if (self.wndOfflineShopAdminPanel):
  475. self.wndOfflineShopAdminPanel.Destroy()
  476. # END_OF_OFFLINE_SHOP_ADMIN_PANEL
  477. self.wndChatLog.Destroy()
  478. for btn in self.questButtonList:
  479. btn.SetEvent(0)
  480. for btn in self.whisperButtonList:
  481. btn.SetEvent(0)
  482. for dlg in self.whisperDialogDict.itervalues():
  483. dlg.Destroy()
  484. for brd in self.guildScoreBoardDict.itervalues():
  485. brd.Destroy()
  486. for dlg in self.equipmentDialogDict.itervalues():
  487. dlg.Destroy()
  488. # ITEM_MALL
  489. del self.mallPageDlg
  490. # END_OF_ITEM_MALL
  491. del self.wndGuild
  492. del self.wndMessenger
  493. del self.wndUICurtain
  494. del self.wndChat
  495. del self.wndTaskBar
  496. if self.wndExpandedTaskBar:
  497. del self.wndExpandedTaskBar
  498. del self.wndEnergyBar
  499. del self.wndCharacter
  500. del self.wndInventory
  501. if self.wndDragonSoul:
  502. del self.wndDragonSoul
  503. if self.wndDragonSoulRefine:
  504. del self.wndDragonSoulRefine
  505. del self.dlgExchange
  506. del self.dlgPointReset
  507. del self.dlgShop
  508. del self.dlgRestart
  509. del self.dlgSystem
  510. del self.dlgPassword
  511. del self.hyperlinkItemTooltip
  512. del self.tooltipItem
  513. del self.tooltipSkill
  514. del self.wndMiniMap
  515. del self.wndSafebox
  516. del self.wndMall
  517. del self.wndParty
  518. del self.wndHelp
  519. if app.ENABLE_MELEY_LAIR_DUNGEON:
  520. del self.wndMeleyRanking
  521. del self.wndCardsInfo
  522. del self.wndCards
  523. del self.wndCardsIcon
  524. del self.wndAcce
  525. del self.wndAcceAbs
  526. del self.wndCube
  527. del self.wndCubeResult
  528. del self.privateShopBuilder
  529. del self.inputDialog
  530. del self.wndChatLog
  531. del self.dlgRefineNew
  532. del self.wndGuildBuilding
  533. del self.wndGameButton
  534. del self.tipBoard
  535. del self.bigBoard
  536. del self.wndItemSelect
  537. del self.dlgOfflineShop
  538. del self.wndOfflineShopAdminPanel
  539. self.questButtonList = []
  540. self.whisperButtonList = []
  541. self.whisperDialogDict = {}
  542. self.privateShopAdvertisementBoardDict = {}
  543. self.guildScoreBoardDict = {}
  544. self.equipmentDialogDict = {}
  545. self.offlineShopAdvertisementBoardDict = {}
  546. uiChat.DestroyChatInputSetWindow()
  547. ## Self
  548. def SetOpenBoniSwitcherEvent(self, event):
  549. self.wndInventory.SetOpenBoniSwitcherEvent(event)
  550. ## Skill
  551. def OnUseSkill(self, slotIndex, coolTime):
  552. self.wndCharacter.OnUseSkill(slotIndex, coolTime)
  553. self.wndTaskBar.OnUseSkill(slotIndex, coolTime)
  554. self.wndGuild.OnUseSkill(slotIndex, coolTime)
  555. def OnActivateSkill(self, slotIndex):
  556. self.wndCharacter.OnActivateSkill(slotIndex)
  557. self.wndTaskBar.OnActivateSkill(slotIndex)
  558. def OnDeactivateSkill(self, slotIndex):
  559. self.wndCharacter.OnDeactivateSkill(slotIndex)
  560. self.wndTaskBar.OnDeactivateSkill(slotIndex)
  561. def OnChangeCurrentSkill(self, skillSlotNumber):
  562. self.wndTaskBar.OnChangeCurrentSkill(skillSlotNumber)
  563. if app.SKILL_COOLTIME_UPDATE:
  564. def SkillClearCoolTime(self, slotIndex):
  565. self.wndCharacter.SkillClearCoolTime(slotIndex)
  566. self.wndTaskBar.SkillClearCoolTime(slotIndex)
  567. def SelectMouseButtonEvent(self, dir, event):
  568. self.wndTaskBar.SelectMouseButtonEvent(dir, event)
  569. ## Refresh
  570. def RefreshAlignment(self):
  571. self.wndCharacter.RefreshAlignment()
  572. def RefreshStatus(self):
  573. self.wndTaskBar.RefreshStatus()
  574. self.wndCharacter.RefreshStatus()
  575. self.wndInventory.RefreshStatus()
  576. if self.wndEnergyBar:
  577. self.wndEnergyBar.RefreshStatus()
  578. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  579. self.wndDragonSoul.RefreshStatus()
  580. def RefreshStamina(self):
  581. self.wndTaskBar.RefreshStamina()
  582. def RefreshSkill(self):
  583. self.wndCharacter.RefreshSkill()
  584. self.wndTaskBar.RefreshSkill()
  585. def RefreshInventory(self):
  586. self.wndTaskBar.RefreshQuickSlot()
  587. self.wndInventory.RefreshItemSlot()
  588. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  589. self.wndDragonSoul.RefreshItemSlot()
  590. def RefreshCharacter(self): ## Character 페이지의 얼굴, Inventory 페이지의 전신 그림 등의 Refresh
  591. self.wndCharacter.RefreshCharacter()
  592. self.wndTaskBar.RefreshQuickSlot()
  593. def RefreshQuest(self):
  594. self.wndCharacter.RefreshQuest()
  595. def RefreshSafebox(self):
  596. self.wndSafebox.RefreshSafebox()
  597. # ITEM_MALL
  598. def RefreshMall(self):
  599. self.wndMall.RefreshMall()
  600. def OpenItemMall(self):
  601. if not self.mallPageDlg:
  602. self.mallPageDlg = uiShop.MallPageDialog()
  603. self.mallPageDlg.Open()
  604. # END_OF_ITEM_MALL
  605. def RefreshMessenger(self):
  606. self.wndMessenger.RefreshMessenger()
  607. def RefreshGuildInfoPage(self):
  608. self.wndGuild.RefreshGuildInfoPage()
  609. def RefreshGuildBoardPage(self):
  610. self.wndGuild.RefreshGuildBoardPage()
  611. def RefreshGuildMemberPage(self):
  612. self.wndGuild.RefreshGuildMemberPage()
  613. def RefreshGuildMemberPageGradeComboBox(self):
  614. self.wndGuild.RefreshGuildMemberPageGradeComboBox()
  615. def RefreshGuildSkillPage(self):
  616. self.wndGuild.RefreshGuildSkillPage()
  617. def RefreshGuildGradePage(self):
  618. self.wndGuild.RefreshGuildGradePage()
  619. def DeleteGuild(self):
  620. self.wndMessenger.ClearGuildMember()
  621. self.wndGuild.DeleteGuild()
  622. def RefreshMobile(self):
  623. self.dlgSystem.RefreshMobile()
  624. def OnMobileAuthority(self):
  625. self.dlgSystem.OnMobileAuthority()
  626. def OnBlockMode(self, mode):
  627. self.dlgSystem.OnBlockMode(mode)
  628. ## Calling Functions
  629. # PointReset
  630. def OpenPointResetDialog(self):
  631. self.dlgPointReset.Show()
  632. self.dlgPointReset.SetTop()
  633. def ClosePointResetDialog(self):
  634. self.dlgPointReset.Close()
  635. # Shop
  636. def OpenShopDialog(self, vid):
  637. self.wndInventory.Show()
  638. self.wndInventory.SetTop()
  639. self.dlgShop.Open(vid)
  640. self.dlgShop.SetTop()
  641. def CloseShopDialog(self):
  642. self.dlgShop.Close()
  643. def RefreshShopDialog(self):
  644. self.dlgShop.Refresh()
  645. # OfflineShop
  646. def OpenOfflineShopDialog(self, vid):
  647. self.wndInventory.Show()
  648. self.wndInventory.SetTop()
  649. self.dlgOfflineShop.Open(vid)
  650. self.dlgOfflineShop.SetTop()
  651. def CloseOfflineShopDialog(self):
  652. self.dlgOfflineShop.Close()
  653. def RefreshOfflineShopDialog(self):
  654. self.dlgOfflineShop.Refresh()
  655. ## Quest
  656. def OpenCharacterWindowQuestPage(self):
  657. self.wndCharacter.Show()
  658. self.wndCharacter.SetState("QUEST")
  659. def OpenQuestWindow(self, skin, idx):
  660. wnds = ()
  661. q = uiQuest.QuestDialog(skin, idx)
  662. q.SetWindowName("QuestWindow" + str(idx))
  663. q.Show()
  664. if skin:
  665. q.Lock()
  666. wnds = self.__HideWindows()
  667. # UNKNOWN_UPDATE
  668. q.AddOnDoneEvent(lambda tmp_self, args=wnds: self.__ShowWindows(args))
  669. # END_OF_UNKNOWN_UPDATE
  670. if skin:
  671. q.AddOnCloseEvent(q.Unlock)
  672. q.AddOnCloseEvent(lambda key = self.wndQuestWindowNewKey:ui.__mem_func__(self.RemoveQuestDialog)(key))
  673. self.wndQuestWindow[self.wndQuestWindowNewKey] = q
  674. self.wndQuestWindowNewKey = self.wndQuestWindowNewKey + 1
  675. # END_OF_UNKNOWN_UPDATE
  676. def RemoveQuestDialog(self, key):
  677. del self.wndQuestWindow[key]
  678. ## Exchange
  679. def StartExchange(self):
  680. self.dlgExchange.OpenDialog()
  681. self.dlgExchange.Refresh()
  682. def EndExchange(self):
  683. self.dlgExchange.CloseDialog()
  684. def RefreshExchange(self):
  685. self.dlgExchange.Refresh()
  686. ## Party
  687. def AddPartyMember(self, pid, name):
  688. self.wndParty.AddPartyMember(pid, name)
  689. self.__ArrangeQuestButton()
  690. def UpdatePartyMemberInfo(self, pid):
  691. self.wndParty.UpdatePartyMemberInfo(pid)
  692. def RemovePartyMember(self, pid):
  693. self.wndParty.RemovePartyMember(pid)
  694. ##!! 20061026.levites.퀘스트_위치_보정
  695. self.__ArrangeQuestButton()
  696. def LinkPartyMember(self, pid, vid):
  697. self.wndParty.LinkPartyMember(pid, vid)
  698. def UnlinkPartyMember(self, pid):
  699. self.wndParty.UnlinkPartyMember(pid)
  700. def UnlinkAllPartyMember(self):
  701. self.wndParty.UnlinkAllPartyMember()
  702. def ExitParty(self):
  703. self.wndParty.ExitParty()
  704. ##!! 20061026.levites.퀘스트_위치_보정
  705. self.__ArrangeQuestButton()
  706. def PartyHealReady(self):
  707. self.wndParty.PartyHealReady()
  708. def ChangePartyParameter(self, distributionMode):
  709. self.wndParty.ChangePartyParameter(distributionMode)
  710. ## Safebox
  711. def AskSafeboxPassword(self):
  712. if self.wndSafebox.IsShow():
  713. return
  714. # SAFEBOX_PASSWORD
  715. self.dlgPassword.SetTitle(localeInfo.PASSWORD_TITLE)
  716. self.dlgPassword.SetSendMessage("/safebox_password ")
  717. # END_OF_SAFEBOX_PASSWORD
  718. self.dlgPassword.ShowDialog()
  719. def OpenSafeboxWindow(self, size):
  720. self.dlgPassword.CloseDialog()
  721. self.wndSafebox.ShowWindow(size)
  722. def RefreshSafeboxMoney(self):
  723. self.wndSafebox.RefreshSafeboxMoney()
  724. def CommandCloseSafebox(self):
  725. self.wndSafebox.CommandCloseSafebox()
  726. # ITEM_MALL
  727. def AskMallPassword(self):
  728. if self.wndMall.IsShow():
  729. return
  730. self.dlgPassword.SetTitle(localeInfo.MALL_PASSWORD_TITLE)
  731. self.dlgPassword.SetSendMessage("/mall_password ")
  732. self.dlgPassword.ShowDialog()
  733. def OpenMallWindow(self, size):
  734. self.dlgPassword.CloseDialog()
  735. self.wndMall.ShowWindow(size)
  736. def CommandCloseMall(self):
  737. self.wndMall.CommandCloseMall()
  738. # END_OF_ITEM_MALL
  739. ## Guild
  740. def OnStartGuildWar(self, guildSelf, guildOpp):
  741. self.wndGuild.OnStartGuildWar(guildSelf, guildOpp)
  742. guildWarScoreBoard = uiGuild.GuildWarScoreBoard()
  743. guildWarScoreBoard.Open(guildSelf, guildOpp)
  744. guildWarScoreBoard.Show()
  745. self.guildScoreBoardDict[uiGuild.GetGVGKey(guildSelf, guildOpp)] = guildWarScoreBoard
  746. def OnEndGuildWar(self, guildSelf, guildOpp):
  747. self.wndGuild.OnEndGuildWar(guildSelf, guildOpp)
  748. key = uiGuild.GetGVGKey(guildSelf, guildOpp)
  749. if not self.guildScoreBoardDict.has_key(key):
  750. return
  751. self.guildScoreBoardDict[key].Destroy()
  752. del self.guildScoreBoardDict[key]
  753. # GUILDWAR_MEMBER_COUNT
  754. def UpdateMemberCount(self, gulidID1, memberCount1, guildID2, memberCount2):
  755. key = uiGuild.GetGVGKey(gulidID1, guildID2)
  756. if not self.guildScoreBoardDict.has_key(key):
  757. return
  758. self.guildScoreBoardDict[key].UpdateMemberCount(gulidID1, memberCount1, guildID2, memberCount2)
  759. # END_OF_GUILDWAR_MEMBER_COUNT
  760. def OnRecvGuildWarPoint(self, gainGuildID, opponentGuildID, point):
  761. key = uiGuild.GetGVGKey(gainGuildID, opponentGuildID)
  762. if not self.guildScoreBoardDict.has_key(key):
  763. return
  764. guildBoard = self.guildScoreBoardDict[key]
  765. guildBoard.SetScore(gainGuildID, opponentGuildID, point)
  766. ## PK Mode
  767. def OnChangePKMode(self):
  768. self.wndCharacter.RefreshAlignment()
  769. self.dlgSystem.OnChangePKMode()
  770. ## Refine
  771. def OpenRefineDialog(self, targetItemPos, nextGradeItemVnum, cost, prob, type):
  772. self.dlgRefineNew.Open(targetItemPos, nextGradeItemVnum, cost, prob, type)
  773. def AppendMaterialToRefineDialog(self, vnum, count):
  774. self.dlgRefineNew.AppendMaterial(vnum, count)
  775. ## Show & Hide
  776. def ShowDefaultWindows(self):
  777. self.wndTaskBar.Show()
  778. self.wndMiniMap.Show()
  779. self.wndMiniMap.ShowMiniMap()
  780. if self.wndEnergyBar:
  781. self.wndEnergyBar.Show()
  782. def ShowAllWindows(self):
  783. self.wndTaskBar.Show()
  784. self.wndCharacter.Show()
  785. self.wndInventory.Show()
  786. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  787. self.wndDragonSoul.Show()
  788. self.wndDragonSoulRefine.Show()
  789. self.wndChat.Show()
  790. self.wndMiniMap.Show()
  791. if self.wndEnergyBar:
  792. self.wndEnergyBar.Show()
  793. if self.wndExpandedTaskBar:
  794. self.wndExpandedTaskBar.Show()
  795. self.wndExpandedTaskBar.SetTop()
  796. def HideAllWindows(self):
  797. if self.wndTaskBar:
  798. self.wndTaskBar.Hide()
  799. if self.wndEnergyBar:
  800. self.wndEnergyBar.Hide()
  801. if app.ENABLE_DETAILS_UI:
  802. if self.wndCharacter:
  803. self.wndCharacter.Close()
  804. else:
  805. if self.wndCharacter:
  806. self.wndCharacter.Hide()
  807. if self.wndInventory:
  808. self.wndInventory.Hide()
  809. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  810. self.wndDragonSoul.Hide()
  811. self.wndDragonSoulRefine.Hide()
  812. if self.wndChat:
  813. self.wndChat.Hide()
  814. if self.wndMiniMap:
  815. self.wndMiniMap.Hide()
  816. if self.wndMessenger:
  817. self.wndMessenger.Hide()
  818. if self.wndGuild:
  819. self.wndGuild.Hide()
  820. if self.wndExpandedTaskBar:
  821. self.wndExpandedTaskBar.Hide()
  822. def ShowMouseImage(self):
  823. self.wndTaskBar.ShowMouseImage()
  824. def HideMouseImage(self):
  825. self.wndTaskBar.HideMouseImage()
  826. def ToggleChat(self):
  827. if TRUE == self.wndChat.IsEditMode():
  828. self.wndChat.CloseChat()
  829. else:
  830. # 웹페이지가 열렸을때는 채팅 입력이 안됨
  831. if self.wndWeb and self.wndWeb.IsShow():
  832. pass
  833. else:
  834. self.wndChat.OpenChat()
  835. def IsOpenChat(self):
  836. return self.wndChat.IsEditMode()
  837. def SetChatFocus(self):
  838. self.wndChat.SetChatFocus()
  839. def OpenRestartDialog(self):
  840. self.dlgRestart.OpenDialog()
  841. self.dlgRestart.SetTop()
  842. def CloseRestartDialog(self):
  843. self.dlgRestart.Close()
  844. def ToggleSystemDialog(self):
  845. if FALSE == self.dlgSystem.IsShow():
  846. self.dlgSystem.OpenDialog()
  847. self.dlgSystem.SetTop()
  848. else:
  849. self.dlgSystem.Close()
  850. def OpenSystemDialog(self):
  851. self.dlgSystem.OpenDialog()
  852. self.dlgSystem.SetTop()
  853. def ToggleMessenger(self):
  854. if self.wndMessenger.IsShow():
  855. self.wndMessenger.Hide()
  856. else:
  857. self.wndMessenger.SetTop()
  858. self.wndMessenger.Show()
  859. def ToggleMiniMap(self):
  860. if app.IsPressed(app.DIK_LSHIFT) or app.IsPressed(app.DIK_RSHIFT):
  861. if FALSE == self.wndMiniMap.isShowMiniMap():
  862. self.wndMiniMap.ShowMiniMap()
  863. self.wndMiniMap.SetTop()
  864. else:
  865. self.wndMiniMap.HideMiniMap()
  866. else:
  867. self.wndMiniMap.ToggleAtlasWindow()
  868. def PressMKey(self):
  869. if app.IsPressed(app.DIK_LALT) or app.IsPressed(app.DIK_RALT):
  870. self.ToggleMessenger()
  871. else:
  872. self.ToggleMiniMap()
  873. def SetMapName(self, mapName):
  874. self.wndMiniMap.SetMapName(mapName)
  875. def MiniMapScaleUp(self):
  876. self.wndMiniMap.ScaleUp()
  877. def MiniMapScaleDown(self):
  878. self.wndMiniMap.ScaleDown()
  879. def ToggleCharacterWindow(self, state):
  880. if False == player.IsObserverMode():
  881. if False == self.wndCharacter.IsShow():
  882. self.OpenCharacterWindowWithState(state)
  883. else:
  884. if state == self.wndCharacter.GetState():
  885. self.wndCharacter.OverOutItem()
  886. if app.ENABLE_DETAILS_UI:
  887. self.wndCharacter.Close()
  888. else:
  889. self.wndCharacter.Hide()
  890. else:
  891. self.wndCharacter.SetState(state)
  892. def OpenCharacterWindowWithState(self, state):
  893. if FALSE == player.IsObserverMode():
  894. self.wndCharacter.SetState(state)
  895. self.wndCharacter.Show()
  896. self.wndCharacter.SetTop()
  897. def ToggleCharacterWindowStatusPage(self):
  898. self.ToggleCharacterWindow("STATUS")
  899. def TogglePetMain(self):
  900. if FALSE == player.IsObserverMode():
  901. if FALSE == self.wndExpandedTaskBar.IsShow():
  902. self.wndExpandedTaskBar.Show()
  903. self.wndExpandedTaskBar.SetTop()
  904. else:
  905. self.wndExpandedTaskBar.Close()
  906. net.SendChatPacket("/gift")
  907. def ToggleInventoryWindow(self):
  908. if FALSE == player.IsObserverMode():
  909. if FALSE == self.wndInventory.IsShow():
  910. self.wndInventory.Show()
  911. self.wndInventory.SetTop()
  912. else:
  913. self.wndInventory.OverOutItem()
  914. self.wndInventory.Close()
  915. def ToggleExpandedButton(self):
  916. if FALSE == player.IsObserverMode():
  917. if FALSE == self.wndExpandedTaskBar.IsShow():
  918. self.wndExpandedTaskBar.Show()
  919. self.wndExpandedTaskBar.SetTop()
  920. else:
  921. self.wndExpandedTaskBar.Close()
  922. # 용혼석
  923. def DragonSoulActivate(self, deck):
  924. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  925. self.wndDragonSoul.ActivateDragonSoulByExtern(deck)
  926. def DragonSoulDeactivate(self):
  927. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  928. self.wndDragonSoul.DeactivateDragonSoul()
  929. def Highligt_Item(self, inven_type, inven_pos):
  930. if player.DRAGON_SOUL_INVENTORY == inven_type:
  931. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  932. self.wndDragonSoul.HighlightSlot(inven_pos)
  933. def DragonSoulGiveQuilification(self):
  934. self.DRAGON_SOUL_IS_QUALIFIED = TRUE
  935. self.wndExpandedTaskBar.SetToolTipText(uiTaskBar.ExpandedTaskBar.BUTTON_DRAGON_SOUL, uiScriptLocale.TASKBAR_DRAGON_SOUL)
  936. def ToggleDragonSoulWindow(self):
  937. if FALSE == player.IsObserverMode():
  938. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  939. if FALSE == self.wndDragonSoul.IsShow():
  940. if self.DRAGON_SOUL_IS_QUALIFIED:
  941. self.wndDragonSoul.Show()
  942. else:
  943. try:
  944. self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED)
  945. self.wndPopupDialog.Open()
  946. except:
  947. self.wndPopupDialog = uiCommon.PopupDialog()
  948. self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED)
  949. self.wndPopupDialog.Open()
  950. else:
  951. self.wndDragonSoul.Close()
  952. def ToggleDragonSoulWindowWithNoInfo(self):
  953. if FALSE == player.IsObserverMode():
  954. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  955. if FALSE == self.wndDragonSoul.IsShow():
  956. if self.DRAGON_SOUL_IS_QUALIFIED:
  957. self.wndDragonSoul.Show()
  958. else:
  959. self.wndDragonSoul.Close()
  960. def FailDragonSoulRefine(self, reason, inven_type, inven_pos):
  961. if FALSE == player.IsObserverMode():
  962. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  963. if TRUE == self.wndDragonSoulRefine.IsShow():
  964. self.wndDragonSoulRefine.RefineFail(reason, inven_type, inven_pos)
  965. def SucceedDragonSoulRefine(self, inven_type, inven_pos):
  966. if FALSE == player.IsObserverMode():
  967. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  968. if TRUE == self.wndDragonSoulRefine.IsShow():
  969. self.wndDragonSoulRefine.RefineSucceed(inven_type, inven_pos)
  970. def OpenDragonSoulRefineWindow(self):
  971. if FALSE == player.IsObserverMode():
  972. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  973. if FALSE == self.wndDragonSoulRefine.IsShow():
  974. self.wndDragonSoulRefine.Show()
  975. if None != self.wndDragonSoul:
  976. if FALSE == self.wndDragonSoul.IsShow():
  977. self.wndDragonSoul.Show()
  978. def CloseDragonSoulRefineWindow(self):
  979. if FALSE == player.IsObserverMode():
  980. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  981. if TRUE == self.wndDragonSoulRefine.IsShow():
  982. self.wndDragonSoulRefine.Close()
  983. # Offline Shop Admin Panel
  984. def ToggleOfflineShopAdminPanelWindow(self):
  985. if (self.wndOfflineShopAdminPanel.IsShow() == True):
  986. self.wndOfflineShopAdminPanel.Close()
  987. else:
  988. self.wndOfflineShopAdminPanel.Show()
  989. # 용혼석 끝
  990. def ToggleGuildWindow(self):
  991. if not self.wndGuild.IsShow():
  992. if self.wndGuild.CanOpen():
  993. self.wndGuild.Open()
  994. else:
  995. chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.GUILD_YOU_DO_NOT_JOIN)
  996. else:
  997. self.wndGuild.OverOutItem()
  998. self.wndGuild.Hide()
  999. def ToggleChatLogWindow(self):
  1000. if self.wndChatLog.IsShow():
  1001. self.wndChatLog.Hide()
  1002. else:
  1003. self.wndChatLog.Show()
  1004. def CheckGameButton(self):
  1005. if self.wndGameButton:
  1006. self.wndGameButton.CheckGameButton()
  1007. def __OnClickStatusPlusButton(self):
  1008. self.ToggleCharacterWindow("STATUS")
  1009. def __OnClickSkillPlusButton(self):
  1010. self.ToggleCharacterWindow("SKILL")
  1011. def __OnClickQuestButton(self):
  1012. self.ToggleCharacterWindow("QUEST")
  1013. def __OnClickHelpButton(self):
  1014. player.SetPlayTime(1)
  1015. self.CheckGameButton()
  1016. self.OpenHelpWindow()
  1017. def __OnClickBuildButton(self):
  1018. self.BUILD_OpenWindow()
  1019. def OpenHelpWindow(self):
  1020. self.wndUICurtain.Show()
  1021. self.wndHelp.Open()
  1022. def CloseHelpWindow(self):
  1023. self.wndUICurtain.Hide()
  1024. self.wndHelp.Close()
  1025. def OpenAcceWindow(self):
  1026. self.wndAcce.Open()
  1027. if self.wndInventory.IsShow() == FALSE:
  1028. self.wndInventory.Show()
  1029. def UpdateAcceInfo(self, gold, itemVnum, count, rItemVnum, rCount):
  1030. self.wndAcce.UpdateInfo(gold, itemVnum, count, rItemVnum, rCount)
  1031. def CloseAcceWindow(self):
  1032. self.wndAcce.Close()
  1033. def FailedAcceWork(self):
  1034. self.wndAcce.Clear()
  1035. def SucceedAcceWork(self, itemVnum, count):
  1036. self.wndAcce.ClearSuccess()
  1037. print "Making acce has succesfully! [%d:%d]" % (itemVnum, count)
  1038. def OpenAcceAbsWindow(self):
  1039. self.wndAcceAbs.Open()
  1040. if self.wndInventory.IsShow() == FALSE:
  1041. self.wndInventory.Show()
  1042. def SucceedAcceAbsWork(self):
  1043. self.wndAcceAbs.Clear()
  1044. def OpenWebWindow(self, url):
  1045. self.wndWeb.Open(url)
  1046. # 웹페이지를 열면 채팅을 닫는다
  1047. self.wndChat.CloseChat()
  1048. if app.ENABLE_MELEY_LAIR_DUNGEON:
  1049. def OpenMeleyRanking(self):
  1050. self.wndMeleyRanking.Open()
  1051. def RankMeleyRanking(self, line, name, members, time):
  1052. self.wndMeleyRanking.AddRank(line, name, members, time)
  1053. # show GIFT
  1054. def ShowGift(self):
  1055. self.wndTaskBar.ShowGift()
  1056. def CloseWbWindow(self):
  1057. self.wndWeb.Close()
  1058. def OpenCardsInfoWindow(self):
  1059. self.wndCardsInfo.Open()
  1060. def OpenCardsWindow(self, safemode):
  1061. self.wndCards.Open(safemode)
  1062. def UpdateCardsInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points):
  1063. self.wndCards.UpdateCardsInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, hand_4, hand_4_v, hand_5, hand_5_v, cards_left, points)
  1064. def UpdateCardsFieldInfo(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  1065. self.wndCards.UpdateCardsFieldInfo(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  1066. def CardsPutReward(self, hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points):
  1067. self.wndCards.CardsPutReward(hand_1, hand_1_v, hand_2, hand_2_v, hand_3, hand_3_v, points)
  1068. def CardsShowIcon(self):
  1069. self.wndCardsIcon.Show()
  1070. def OpenCubeWindow(self):
  1071. self.wndCube.Open()
  1072. if FALSE == self.wndInventory.IsShow():
  1073. self.wndInventory.Show()
  1074. def UpdateCubeInfo(self, gold, itemVnum, count):
  1075. self.wndCube.UpdateInfo(gold, itemVnum, count)
  1076. def CloseCubeWindow(self):
  1077. self.wndCube.Close()
  1078. def FailedCubeWork(self):
  1079. self.wndCube.Refresh()
  1080. def SucceedCubeWork(self, itemVnum, count):
  1081. self.wndCube.Clear()
  1082. print "큐브 제작 성공! [%d:%d]" % (itemVnum, count)
  1083. if 0: # 결과 메시지 출력은 생략 한다
  1084. self.wndCubeResult.SetPosition(*self.wndCube.GetGlobalPosition())
  1085. self.wndCubeResult.SetCubeResultItem(itemVnum, count)
  1086. self.wndCubeResult.Open()
  1087. self.wndCubeResult.SetTop()
  1088. def __HideWindows(self):
  1089. hideWindows = self.wndTaskBar,\
  1090. self.wndCharacter,\
  1091. self.wndInventory,\
  1092. self.wndMiniMap,\
  1093. self.wndGuild,\
  1094. self.wndMessenger,\
  1095. self.wndChat,\
  1096. self.wndParty,\
  1097. self.wndGameButton,
  1098. if self.wndEnergyBar:
  1099. hideWindows += self.wndEnergyBar,
  1100. if self.wndExpandedTaskBar:
  1101. hideWindows += self.wndExpandedTaskBar,
  1102. if app.ENABLE_DRAGON_SOUL_SYSTEM:
  1103. hideWindows += self.wndDragonSoul,\
  1104. self.wndDragonSoulRefine,
  1105. hideWindows = filter(lambda x:x.IsShow(), hideWindows)
  1106. map(lambda x:x.Hide(), hideWindows)
  1107. import sys
  1108. self.HideAllQuestButton()
  1109. self.HideAllWhisperButton()
  1110. if self.wndChat.IsEditMode():
  1111. self.wndChat.CloseChat()
  1112. return hideWindows
  1113. def __ShowWindows(self, wnds):
  1114. import sys
  1115. map(lambda x:x.Show(), wnds)
  1116. global IsQBHide
  1117. if not IsQBHide:
  1118. self.ShowAllQuestButton()
  1119. else:
  1120. self.HideAllQuestButton()
  1121. self.ShowAllWhisperButton()
  1122. def BINARY_OpenAtlasWindow(self):
  1123. if self.wndMiniMap:
  1124. self.wndMiniMap.ShowAtlas()
  1125. def BINARY_SetObserverMode(self, flag):
  1126. self.wndGameButton.SetObserverMode(flag)
  1127. # ACCESSORY_REFINE_ADD_METIN_STONE
  1128. def BINARY_OpenSelectItemWindow(self):
  1129. self.wndItemSelect.Open()
  1130. # END_OF_ACCESSORY_REFINE_ADD_METIN_STONE
  1131. #####################################################################################
  1132. ### Private Shop ###
  1133. def OpenPrivateShopInputNameDialog(self):
  1134. #if player.IsInSafeArea():
  1135. # chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CANNOT_OPEN_PRIVATE_SHOP_IN_SAFE_AREA)
  1136. # return
  1137. inputDialog = uiCommon.InputDialogShop()
  1138. inputDialog.SetTitle(localeInfo.PRIVATE_SHOP_INPUT_NAME_DIALOG_TITLE)
  1139. inputDialog.SetMaxLength(32)
  1140. inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenPrivateShopBuilder))
  1141. inputDialog.SetCancelEvent(ui.__mem_func__(self.ClosePrivateShopInputNameDialog))
  1142. inputDialog.Open()
  1143. self.inputDialog = inputDialog
  1144. def ClosePrivateShopInputNameDialog(self):
  1145. self.inputDialog.Close()
  1146. return True
  1147. def OpenPrivateShopBuilder(self):
  1148. if not self.inputDialog:
  1149. return True
  1150. if not len(self.inputDialog.GetText()):
  1151. return True
  1152. self.privateShopBuilder.Open(self.inputDialog.GetText(), self.inputDialog.GetType())
  1153. self.ClosePrivateShopInputNameDialog()
  1154. return True
  1155. def AppearPrivateShop(self, vid, text):
  1156. board = uiPrivateShopBuilder.PrivateShopAdvertisementBoard()
  1157. board.Open(vid, text)
  1158. self.privateShopAdvertisementBoardDict[vid] = board
  1159. def DisappearPrivateShop(self, vid):
  1160. if not self.privateShopAdvertisementBoardDict.has_key(vid):
  1161. return
  1162. del self.privateShopAdvertisementBoardDict[vid]
  1163. uiPrivateShopBuilder.DeleteADBoard(vid)
  1164. #####################################################################################
  1165. ### Offline Shop ###
  1166. def OpenOfflineShopInputNameDialog(self):
  1167. inputDialog = uiOfflineShop.OfflineShopInputDialog()
  1168. inputDialog.SetAcceptEvent(ui.__mem_func__(self.OpenOfflineShopBuilder))
  1169. inputDialog.SetCancelEvent(ui.__mem_func__(self.CloseOfflineShopInputNameDialog))
  1170. inputDialog.Open()
  1171. self.inputDialog = inputDialog
  1172. def CloseOfflineShopInputNameDialog(self):
  1173. self.inputDialog = None
  1174. return True
  1175. def OpenOfflineShopBuilder(self):
  1176. if (not self.inputDialog):
  1177. return True
  1178. if (not len(self.inputDialog.GetTitle())):
  1179. return True
  1180. if (self.inputDialog.GetTime() < 0 or self.inputDialog.GetTime() == 0):
  1181. return True
  1182. self.offlineShopBuilder.Open(self.inputDialog.GetTitle(), self.inputDialog.GetTime())
  1183. self.CloseOfflineShopInputNameDialog()
  1184. return True
  1185. def AppearOfflineShop(self, vid, text):
  1186. board = uiOfflineShopBuilder.OfflineShopAdvertisementBoard()
  1187. board.Open(vid, text)
  1188. self.offlineShopAdvertisementBoardDict[vid] = board
  1189. def DisappearOfflineShop(self, vid):
  1190. if (not self.offlineShopAdvertisementBoardDict.has_key(vid)):
  1191. return
  1192. del self.offlineShopAdvertisementBoardDict[vid]
  1193. uiOfflineShopBuilder.DeleteADBoard(vid)
  1194. #####################################################################################
  1195. ### Equipment ###
  1196. def OpenEquipmentDialog(self, vid):
  1197. dlg = uiEquipmentDialog.EquipmentDialog()
  1198. dlg.SetItemToolTip(self.tooltipItem)
  1199. dlg.SetCloseEvent(ui.__mem_func__(self.CloseEquipmentDialog))
  1200. dlg.Open(vid)
  1201. self.equipmentDialogDict[vid] = dlg
  1202. def SetEquipmentDialogItem(self, vid, slotIndex, vnum, count):
  1203. if not vid in self.equipmentDialogDict:
  1204. return
  1205. self.equipmentDialogDict[vid].SetEquipmentDialogItem(slotIndex, vnum, count)
  1206. def SetEquipmentDialogSocket(self, vid, slotIndex, socketIndex, value):
  1207. if not vid in self.equipmentDialogDict:
  1208. return
  1209. self.equipmentDialogDict[vid].SetEquipmentDialogSocket(slotIndex, socketIndex, value)
  1210. def SetEquipmentDialogAttr(self, vid, slotIndex, attrIndex, type, value):
  1211. if not vid in self.equipmentDialogDict:
  1212. return
  1213. self.equipmentDialogDict[vid].SetEquipmentDialogAttr(slotIndex, attrIndex, type, value)
  1214. def CloseEquipmentDialog(self, vid):
  1215. if not vid in self.equipmentDialogDict:
  1216. return
  1217. del self.equipmentDialogDict[vid]
  1218. #####################################################################################
  1219. #####################################################################################
  1220. ### Quest ###
  1221. def BINARY_ClearQuest(self, index):
  1222. btn = self.__FindQuestButton(index)
  1223. if 0 != btn:
  1224. self.__DestroyQuestButton(btn)
  1225. def RecvQuest(self, index, name):
  1226. # QUEST_LETTER_IMAGE
  1227. self.BINARY_RecvQuest(index, name, "file", localeInfo.GetLetterImageName())
  1228. # END_OF_QUEST_LETTER_IMAGE
  1229. def BINARY_RecvQuest(self, index, name, iconType, iconName):
  1230. btn = self.__FindQuestButton(index)
  1231. if 0 != btn:
  1232. self.__DestroyQuestButton(btn)
  1233. btn = uiWhisper.WhisperButton()
  1234. # QUEST_LETTER_IMAGE
  1235. ##!! 20061026.levites.퀘스트_이미지_교체
  1236. import item
  1237. if "item"==iconType:
  1238. item.SelectItem(int(iconName))
  1239. buttonImageFileName=item.GetIconImageFileName()
  1240. else:
  1241. buttonImageFileName=iconName
  1242. if localeInfo.IsEUROPE():
  1243. if "highlight" == iconType:
  1244. btn.SetUpVisual("locale/ymir_ui/highlighted_quest.tga")
  1245. btn.SetOverVisual("locale/ymir_ui/highlighted_quest_r.tga")
  1246. btn.SetDownVisual("locale/ymir_ui/highlighted_quest_r.tga")
  1247. else:
  1248. btn.SetUpVisual(localeInfo.GetLetterCloseImageName())
  1249. btn.SetOverVisual(localeInfo.GetLetterOpenImageName())
  1250. btn.SetDownVisual(localeInfo.GetLetterOpenImageName())
  1251. else:
  1252. btn.SetUpVisual(buttonImageFileName)
  1253. btn.SetOverVisual(buttonImageFileName)
  1254. btn.SetDownVisual(buttonImageFileName)
  1255. btn.Flash()
  1256. # END_OF_QUEST_LETTER_IMAGE
  1257. if localeInfo.IsARABIC():
  1258. btn.SetToolTipText(name, 0, 35)
  1259. btn.ToolTipText.SetHorizontalAlignCenter()
  1260. else:
  1261. btn.SetToolTipText(name, -20, 35)
  1262. btn.ToolTipText.SetHorizontalAlignLeft()
  1263. btn.SetEvent(ui.__mem_func__(self.__StartQuest), btn)
  1264. btn.Show()
  1265. btn.index = index
  1266. btn.name = name
  1267. self.questButtonList.insert(0, btn)
  1268. self.__ArrangeQuestButton()
  1269. #chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.QUEST_APPEND)
  1270. def __ArrangeQuestButton(self):
  1271. screenWidth = wndMgr.GetScreenWidth()
  1272. screenHeight = wndMgr.GetScreenHeight()
  1273. ##!! 20061026.levites.퀘스트_위치_보정
  1274. if self.wndParty.IsShow():
  1275. xPos = 100 + 30
  1276. else:
  1277. xPos = 20
  1278. if localeInfo.IsARABIC():
  1279. xPos = xPos + 15
  1280. yPos = 170 * screenHeight / 600
  1281. yCount = (screenHeight - 330) / 63
  1282. count = 0
  1283. for btn in self.questButtonList:
  1284. btn.SetPosition(xPos + (int(count/yCount) * 100), yPos + (count%yCount * 63))
  1285. count += 1
  1286. global IsQBHide
  1287. if IsQBHide:
  1288. btn.Hide()
  1289. else:
  1290. btn.Show()
  1291. def __StartQuest(self, btn):
  1292. event.QuestButtonClick(btn.index)
  1293. self.__DestroyQuestButton(btn)
  1294. def __FindQuestButton(self, index):
  1295. for btn in self.questButtonList:
  1296. if btn.index == index:
  1297. return btn
  1298. return 0
  1299. def __DestroyQuestButton(self, btn):
  1300. btn.SetEvent(0)
  1301. self.questButtonList.remove(btn)
  1302. self.__ArrangeQuestButton()
  1303. def HideAllQuestButton(self):
  1304. for btn in self.questButtonList:
  1305. btn.Hide()
  1306. def ShowAllQuestButton(self):
  1307. for btn in self.questButtonList:
  1308. btn.Show()
  1309. #####################################################################################
  1310. #####################################################################################
  1311. ### Whisper ###
  1312. def __InitWhisper(self):
  1313. chat.InitWhisper(self)
  1314. ## 채팅창의 "메시지 보내기"를 눌렀을때 이름 없는 대화창을 여는 함수
  1315. ## 이름이 없기 때문에 기존의 WhisperDialogDict 와 별도로 관리된다.
  1316. def OpenWhisperDialogWithoutTarget(self):
  1317. if not self.dlgWhisperWithoutTarget:
  1318. dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog)
  1319. dlgWhisper.BindInterface(self)
  1320. dlgWhisper.LoadDialog()
  1321. dlgWhisper.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog)
  1322. dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30)
  1323. dlgWhisper.Show()
  1324. self.dlgWhisperWithoutTarget = dlgWhisper
  1325. self.windowOpenPosition = (self.windowOpenPosition+1) % 5
  1326. else:
  1327. self.dlgWhisperWithoutTarget.SetTop()
  1328. self.dlgWhisperWithoutTarget.OpenWithoutTarget(self.RegisterTemporaryWhisperDialog)
  1329. ## 이름 없는 대화창에서 이름을 결정했을때 WhisperDialogDict에 창을 넣어주는 함수
  1330. def RegisterTemporaryWhisperDialog(self, name):
  1331. if not self.dlgWhisperWithoutTarget:
  1332. return
  1333. btn = self.__FindWhisperButton(name)
  1334. if 0 != btn:
  1335. self.__DestroyWhisperButton(btn)
  1336. elif self.whisperDialogDict.has_key(name):
  1337. oldDialog = self.whisperDialogDict[name]
  1338. oldDialog.Destroy()
  1339. del self.whisperDialogDict[name]
  1340. self.whisperDialogDict[name] = self.dlgWhisperWithoutTarget
  1341. self.dlgWhisperWithoutTarget.OpenWithTarget(name)
  1342. self.dlgWhisperWithoutTarget = None
  1343. self.__CheckGameMaster(name)
  1344. ## 캐릭터 메뉴의 1:1 대화 하기를 눌렀을때 이름을 가지고 바로 창을 여는 함수
  1345. def OpenWhisperDialog(self, name):
  1346. if not self.whisperDialogDict.has_key(name):
  1347. dlg = self.__MakeWhisperDialog(name)
  1348. dlg.OpenWithTarget(name)
  1349. dlg.chatLine.SetFocus()
  1350. dlg.Show()
  1351. self.__CheckGameMaster(name)
  1352. btn = self.__FindWhisperButton(name)
  1353. if 0 != btn:
  1354. self.__DestroyWhisperButton(btn)
  1355. ## 다른 캐릭터로부터 메세지를 받았을때 일단 버튼만 띄워 두는 함수
  1356. def RecvWhisper(self, name):
  1357. if not self.whisperDialogDict.has_key(name):
  1358. btn = self.__FindWhisperButton(name)
  1359. if 0 == btn:
  1360. btn = self.__MakeWhisperButton(name)
  1361. btn.Flash()
  1362. chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name))
  1363. else:
  1364. btn.Flash()
  1365. elif self.IsGameMasterName(name):
  1366. dlg = self.whisperDialogDict[name]
  1367. dlg.SetGameMasterLook()
  1368. def MakeWhisperButton(self, name):
  1369. self.__MakeWhisperButton(name)
  1370. ## 버튼을 눌렀을때 창을 여는 함수
  1371. def ShowWhisperDialog(self, btn):
  1372. try:
  1373. self.__MakeWhisperDialog(btn.name)
  1374. dlgWhisper = self.whisperDialogDict[btn.name]
  1375. dlgWhisper.OpenWithTarget(btn.name)
  1376. dlgWhisper.Show()
  1377. self.__CheckGameMaster(btn.name)
  1378. except:
  1379. import dbg
  1380. dbg.TraceError("interface.ShowWhisperDialog - Failed to find key")
  1381. ## 버튼 초기화
  1382. self.__DestroyWhisperButton(btn)
  1383. ## WhisperDialog 창에서 최소화 명령을 수행했을때 호출되는 함수
  1384. ## 창을 최소화 합니다.
  1385. def MinimizeWhisperDialog(self, name):
  1386. if 0 != name:
  1387. self.__MakeWhisperButton(name)
  1388. self.CloseWhisperDialog(name)
  1389. ## WhisperDialog 창에서 닫기 명령을 수행했을때 호출되는 함수
  1390. ## 창을 지웁니다.
  1391. def CloseWhisperDialog(self, name):
  1392. if 0 == name:
  1393. if self.dlgWhisperWithoutTarget:
  1394. self.dlgWhisperWithoutTarget.Destroy()
  1395. self.dlgWhisperWithoutTarget = None
  1396. return
  1397. try:
  1398. dlgWhisper = self.whisperDialogDict[name]
  1399. dlgWhisper.Destroy()
  1400. del self.whisperDialogDict[name]
  1401. except:
  1402. import dbg
  1403. dbg.TraceError("interface.CloseWhisperDialog - Failed to find key")
  1404. ## 버튼의 개수가 바뀌었을때 버튼을 재정렬 하는 함수
  1405. def __ArrangeWhisperButton(self):
  1406. screenWidth = wndMgr.GetScreenWidth()
  1407. screenHeight = wndMgr.GetScreenHeight()
  1408. xPos = screenWidth - 70
  1409. yPos = 170 * screenHeight / 600
  1410. yCount = (screenHeight - 330) / 63
  1411. #yCount = (screenHeight - 285) / 63
  1412. count = 0
  1413. for button in self.whisperButtonList:
  1414. button.SetPosition(xPos + (int(count/yCount) * -50), yPos + (count%yCount * 63))
  1415. count += 1
  1416. ## 이름으로 Whisper 버튼을 찾아 리턴해 주는 함수
  1417. ## 버튼은 딕셔너리로 하지 않는 것은 정렬 되어 버려 순서가 유지 되지 않으며
  1418. ## 이로 인해 ToolTip들이 다른 버튼들에 의해 가려지기 때문이다.
  1419. def __FindWhisperButton(self, name):
  1420. for button in self.whisperButtonList:
  1421. if button.name == name:
  1422. return button
  1423. return 0
  1424. ## 창을 만듭니다.
  1425. def __MakeWhisperDialog(self, name):
  1426. dlgWhisper = uiWhisper.WhisperDialog(self.MinimizeWhisperDialog, self.CloseWhisperDialog)
  1427. dlgWhisper.BindInterface(self)
  1428. dlgWhisper.LoadDialog()
  1429. dlgWhisper.SetPosition(self.windowOpenPosition*30,self.windowOpenPosition*30)
  1430. self.whisperDialogDict[name] = dlgWhisper
  1431. self.windowOpenPosition = (self.windowOpenPosition+1) % 5
  1432. return dlgWhisper
  1433. ## 버튼을 만듭니다.
  1434. def __MakeWhisperButton(self, name):
  1435. whisperButton = uiWhisper.WhisperButton()
  1436. import chr
  1437. if self.listGMName.has_key(name):
  1438. whisperButton.SetUpVisual("d:/ymir work/ui/gm_whisper.tga")
  1439. whisperButton.SetOverVisual("d:/ymir work/ui/gm_whisper.tga")
  1440. whisperButton.SetDownVisual("d:/ymir work/ui/gm_whisper.tga")
  1441. else:
  1442. whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub")
  1443. whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub")
  1444. whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub")
  1445. if self.IsGameMasterName(name):
  1446. whisperButton.SetToolTipTextWithColor(name, 0xffffa200)
  1447. else:
  1448. whisperButton.SetToolTipText(name)
  1449. whisperButton.ToolTipText.SetHorizontalAlignCenter()
  1450. whisperButton.SetEvent(ui.__mem_func__(self.ShowWhisperDialog), whisperButton)
  1451. whisperButton.Show()
  1452. whisperButton.name = name
  1453. self.whisperButtonList.insert(0, whisperButton)
  1454. self.__ArrangeWhisperButton()
  1455. return whisperButton
  1456. def __DestroyWhisperButton(self, button):
  1457. button.SetEvent(0)
  1458. self.whisperButtonList.remove(button)
  1459. self.__ArrangeWhisperButton()
  1460. def HideAllWhisperButton(self):
  1461. for btn in self.whisperButtonList:
  1462. btn.Hide()
  1463. def ShowAllWhisperButton(self):
  1464. for btn in self.whisperButtonList:
  1465. btn.Show()
  1466. def __CheckGameMaster(self, name):
  1467. if not self.listGMName.has_key(name):
  1468. return
  1469. if self.whisperDialogDict.has_key(name):
  1470. dlg = self.whisperDialogDict[name]
  1471. dlg.SetGameMasterLook()
  1472. def RegisterGameMasterName(self, name):
  1473. if self.listGMName.has_key(name):
  1474. return
  1475. self.listGMName[name] = "GM"
  1476. def IsGameMasterName(self, name):
  1477. if self.listGMName.has_key(name):
  1478. return TRUE
  1479. else:
  1480. return FALSE
  1481. #####################################################################################
  1482. #####################################################################################
  1483. ### Guild Building ###
  1484. def BUILD_OpenWindow(self):
  1485. self.wndGuildBuilding = uiGuild.BuildGuildBuildingWindow()
  1486. self.wndGuildBuilding.Open()
  1487. self.wndGuildBuilding.wnds = self.__HideWindows()
  1488. self.wndGuildBuilding.SetCloseEvent(ui.__mem_func__(self.BUILD_CloseWindow))
  1489. def BUILD_CloseWindow(self):
  1490. self.__ShowWindows(self.wndGuildBuilding.wnds)
  1491. self.wndGuildBuilding = None
  1492. def BUILD_OnUpdate(self):
  1493. if not self.wndGuildBuilding:
  1494. return
  1495. if self.wndGuildBuilding.IsPositioningMode():
  1496. import background
  1497. x, y, z = background.GetPickingPoint()
  1498. self.wndGuildBuilding.SetBuildingPosition(x, y, z)
  1499. def BUILD_OnMouseLeftButtonDown(self):
  1500. if not self.wndGuildBuilding:
  1501. return
  1502. # GUILD_BUILDING
  1503. if self.wndGuildBuilding.IsPositioningMode():
  1504. self.wndGuildBuilding.SettleCurrentPosition()
  1505. return TRUE
  1506. elif self.wndGuildBuilding.IsPreviewMode():
  1507. pass
  1508. else:
  1509. return TRUE
  1510. # END_OF_GUILD_BUILDING
  1511. return FALSE
  1512. def BUILD_OnMouseLeftButtonUp(self):
  1513. if not self.wndGuildBuilding:
  1514. return
  1515. if not self.wndGuildBuilding.IsPreviewMode():
  1516. return TRUE
  1517. return FALSE
  1518. def BULID_EnterGuildArea(self, areaID):
  1519. # GUILD_BUILDING
  1520. mainCharacterName = player.GetMainCharacterName()
  1521. masterName = guild.GetGuildMasterName()
  1522. if mainCharacterName != masterName:
  1523. return
  1524. if areaID != player.GetGuildID():
  1525. return
  1526. # END_OF_GUILD_BUILDING
  1527. self.wndGameButton.ShowBuildButton()
  1528. def BULID_ExitGuildArea(self, areaID):
  1529. self.wndGameButton.HideBuildButton()
  1530. #####################################################################################
  1531. def IsEditLineFocus(self):
  1532. if self.ChatWindow.chatLine.IsFocus():
  1533. return 1
  1534. if self.ChatWindow.chatToLine.IsFocus():
  1535. return 1
  1536. return 0
  1537. def EmptyFunction(self):
  1538. pass
  1539. if __name__ == "__main__":
  1540. import app
  1541. import wndMgr
  1542. import systemSetting
  1543. import mouseModule
  1544. import grp
  1545. import ui
  1546. import localeInfo
  1547. app.SetMouseHandler(mouseModule.mouseController)
  1548. app.SetHairColorEnable(TRUE)
  1549. wndMgr.SetMouseHandler(mouseModule.mouseController)
  1550. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  1551. app.Create(localeInfo.APP_TITLE, systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  1552. mouseModule.mouseController.Create()
  1553. class TestGame(ui.Window):
  1554. def __init__(self):
  1555. ui.Window.__init__(self)
  1556. localeInfo.LoadLocaleData()
  1557. player.SetItemData(0, 27001, 10)
  1558. player.SetItemData(1, 27004, 10)
  1559. self.interface = Interface()
  1560. self.interface.MakeInterface()
  1561. self.interface.ShowDefaultWindows()
  1562. self.interface.RefreshInventory()
  1563. #self.interface.OpenCubeWindow()
  1564. def __del__(self):
  1565. ui.Window.__del__(self)
  1566. def OnUpdate(self):
  1567. app.UpdateGame()
  1568. def OnRender(self):
  1569. app.RenderGame()
  1570. grp.PopState()
  1571. grp.SetInterfaceRenderState()
  1572. game = TestGame()
  1573. game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  1574. game.Show()
  1575. app.Loop()
Comments powered by Disqus