1. import app
  2. import ui
  3. import guild
  4. import net
  5. import wndMgr
  6. import grp
  7. import grpText
  8. import uiPickMoney
  9. import localeInfo
  10. import player
  11. import skill
  12. import mouseModule
  13. import uiUploadMark
  14. import uiCommon
  15. import uiToolTip
  16. import playerSettingModule
  17. import constInfo
  18. import background
  19. import miniMap
  20. import chr
  21. import uiScriptLocale
  22. import event
  23. import chat
  24. from _weakref import proxy
  25. DISABLE_GUILD_SKILL = False
  26. DISABLE_DECLARE_WAR = False
  27. def NumberToMoneyString(n):
  28. return localeInfo.NumberToMoneyString(n)
  29. if (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"):
  30. def NumberToMoneyString(n):
  31. if n <= 0 :
  32. return "0"
  33. return "%s" % (','.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]))
  34. MATERIAL_STONE_INDEX = 0
  35. MATERIAL_LOG_INDEX = 1
  36. MATERIAL_PLYWOOD_INDEX = 2
  37. MATERIAL_STONE_ID = 90010
  38. MATERIAL_LOG_ID = 90011
  39. MATERIAL_PLYWOOD_ID = 90012
  40. BUILDING_DATA_LIST = []
  41. def GetGVGKey(srcGuildID, dstGuildID):
  42. minID = min(srcGuildID, dstGuildID)
  43. maxID = max(srcGuildID, dstGuildID)
  44. return minID*1000 + maxID
  45. def unsigned32(n):
  46. return n & 0xFFFFFFFFL
  47. class DeclareGuildWarDialog(ui.ScriptWindow):
  48. def __init__(self):
  49. ui.ScriptWindow.__init__(self)
  50. self.type=0
  51. self.__CreateDialog()
  52. def __del__(self):
  53. ui.ScriptWindow.__del__(self)
  54. def Open(self):
  55. self.inputValue.SetFocus()
  56. self.SetCenterPosition()
  57. self.SetTop()
  58. self.Show()
  59. def Close(self):
  60. self.ClearDictionary()
  61. self.board = None
  62. self.acceptButton = None
  63. self.cancelButton = None
  64. self.inputSlot = None
  65. self.inputValue = None
  66. self.Hide()
  67. def __CreateDialog(self):
  68. try:
  69. pyScrLoader = ui.PythonScriptLoader()
  70. if localeInfo.IsVIETNAM() :
  71. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "declareguildwardialog.py")
  72. else:
  73. pyScrLoader.LoadScriptFile(self, "uiscript/declareguildwardialog.py")
  74. except:
  75. import exception
  76. exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript")
  77. try:
  78. getObject = self.GetChild
  79. self.board = getObject("Board")
  80. self.typeButtonList=[]
  81. self.typeButtonList.append(getObject("NormalButton"))
  82. self.typeButtonList.append(getObject("WarpButton"))
  83. self.typeButtonList.append(getObject("CTFButton"))
  84. self.acceptButton = getObject("AcceptButton")
  85. self.cancelButton = getObject("CancelButton")
  86. self.inputSlot = getObject("InputSlot")
  87. self.inputValue = getObject("InputValue")
  88. gameType=getObject("GameType")
  89. except:
  90. import exception
  91. exception.Abort("DeclareGuildWarWindow.__CreateDialog - BindObject")
  92. if constInfo.GUILD_WAR_TYPE_SELECT_ENABLE==0:
  93. gameType.Hide()
  94. self.typeButtonList[0].SAFE_SetEvent(self.__OnClickTypeButtonNormal)
  95. self.typeButtonList[1].SAFE_SetEvent(self.__OnClickTypeButtonWarp)
  96. self.typeButtonList[2].SAFE_SetEvent(self.__OnClickTypeButtonCTF)
  97. self.typeButtonList[0].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_NORMAL_TITLE, localeInfo.GUILDWAR_NORMAL_DESCLIST))
  98. self.typeButtonList[1].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_WARP_TITLE, localeInfo.GUILDWAR_WARP_DESCLIST))
  99. self.typeButtonList[2].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_CTF_TITLE, localeInfo.GUILDWAR_CTF_DESCLIST))
  100. self.__ClickRadioButton(self.typeButtonList, 0)
  101. self.SetAcceptEvent(ui.__mem_func__(self.__OnOK))
  102. self.SetCancelEvent(ui.__mem_func__(self.__OnCancel))
  103. def __OnOK(self):
  104. text = self.GetText()
  105. type = self.GetType()
  106. if ""==text:
  107. return
  108. net.SendChatPacket("/war %s %d" % (text, type))
  109. self.Close()
  110. return 1
  111. def __OnCancel(self):
  112. self.Close()
  113. return 1
  114. def __OnClickTypeButtonNormal(self):
  115. self.__ClickTypeRadioButton(0)
  116. def __OnClickTypeButtonWarp(self):
  117. self.__ClickTypeRadioButton(1)
  118. def __OnClickTypeButtonCTF(self):
  119. self.__ClickTypeRadioButton(2)
  120. def __ClickTypeRadioButton(self, type):
  121. self.__ClickRadioButton(self.typeButtonList, type)
  122. self.type=type
  123. def __ClickRadioButton(self, buttonList, buttonIndex):
  124. try:
  125. selButton=buttonList[buttonIndex]
  126. except IndexError:
  127. return
  128. for eachButton in buttonList:
  129. eachButton.SetUp()
  130. selButton.Down()
  131. def SetTitle(self, name):
  132. self.board.SetTitleName(name)
  133. def SetNumberMode(self):
  134. self.inputValue.SetNumberMode()
  135. def SetSecretMode(self):
  136. self.inputValue.SetSecret()
  137. def SetFocus(self):
  138. self.inputValue.SetFocus()
  139. def SetMaxLength(self, length):
  140. width = length * 6 + 10
  141. self.inputValue.SetMax(length)
  142. self.SetSlotWidth(width)
  143. self.SetBoardWidth(max(width + 50, 160))
  144. def SetSlotWidth(self, width):
  145. self.inputSlot.SetSize(width, self.inputSlot.GetHeight())
  146. self.inputValue.SetSize(width, self.inputValue.GetHeight())
  147. def SetBoardWidth(self, width):
  148. self.board.SetSize(max(width + 50, 160), self.GetHeight())
  149. self.SetSize(max(width + 50, 160), self.GetHeight())
  150. self.UpdateRect()
  151. def SetAcceptEvent(self, event):
  152. self.acceptButton.SetEvent(event)
  153. self.inputValue.OnIMEReturn = event
  154. def SetCancelEvent(self, event):
  155. self.board.SetCloseEvent(event)
  156. self.cancelButton.SetEvent(event)
  157. self.inputValue.OnPressEscapeKey = event
  158. def GetType(self):
  159. return self.type
  160. def GetText(self):
  161. return self.inputValue.GetText()
  162. def __CreateGameTypeToolTip(self, title, descList):
  163. toolTip = uiToolTip.ToolTip()
  164. toolTip.SetTitle(title)
  165. toolTip.AppendSpace(5)
  166. for desc in descList:
  167. toolTip.AutoAppendTextLine(desc)
  168. toolTip.AlignHorizonalCenter()
  169. return toolTip
  170. class AcceptGuildWarDialog(ui.ScriptWindow):
  171. def __init__(self):
  172. ui.ScriptWindow.__init__(self)
  173. self.type=0
  174. self.__CreateDialog()
  175. def __del__(self):
  176. print "---------------------------------------------------------------------------- DELETE AcceptGuildWarDialog"
  177. ui.ScriptWindow.__del__(self)
  178. def Open(self, guildName, warType):
  179. self.guildName=guildName
  180. self.warType=warType
  181. self.__ClickSelectedTypeRadioButton()
  182. self.inputValue.SetText(guildName)
  183. self.SetCenterPosition()
  184. self.SetTop()
  185. self.Show()
  186. def GetGuildName(self):
  187. return self.guildName
  188. def Close(self):
  189. self.ClearDictionary()
  190. self.board = None
  191. self.acceptButton = None
  192. self.cancelButton = None
  193. self.inputSlot = None
  194. self.inputValue = None
  195. self.Hide()
  196. def __ClickSelectedTypeRadioButton(self):
  197. self.__ClickTypeRadioButton(self.warType)
  198. def __CreateDialog(self):
  199. try:
  200. pyScrLoader = ui.PythonScriptLoader()
  201. pyScrLoader.LoadScriptFile(self, "uiscript/acceptguildwardialog.py")
  202. except:
  203. import exception
  204. exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript")
  205. try:
  206. getObject = self.GetChild
  207. self.board = getObject("Board")
  208. self.typeButtonList=[]
  209. self.typeButtonList.append(getObject("NormalButton"))
  210. self.typeButtonList.append(getObject("WarpButton"))
  211. self.typeButtonList.append(getObject("CTFButton"))
  212. self.acceptButton = getObject("AcceptButton")
  213. self.cancelButton = getObject("CancelButton")
  214. self.inputSlot = getObject("InputSlot")
  215. self.inputValue = getObject("InputValue")
  216. gameType=getObject("GameType")
  217. except:
  218. import exception
  219. exception.Abort("DeclareGuildWarWindow.__CreateDialog - BindObject")
  220. if constInfo.GUILD_WAR_TYPE_SELECT_ENABLE==0:
  221. gameType.Hide()
  222. self.typeButtonList[0].SAFE_SetEvent(self.__OnClickTypeButtonNormal)
  223. self.typeButtonList[1].SAFE_SetEvent(self.__OnClickTypeButtonWarp)
  224. self.typeButtonList[2].SAFE_SetEvent(self.__OnClickTypeButtonCTF)
  225. self.typeButtonList[0].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_NORMAL_TITLE, localeInfo.GUILDWAR_NORMAL_DESCLIST))
  226. self.typeButtonList[1].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_WARP_TITLE, localeInfo.GUILDWAR_WARP_DESCLIST))
  227. self.typeButtonList[2].SetToolTipWindow(self.__CreateGameTypeToolTip(localeInfo.GUILDWAR_CTF_TITLE, localeInfo.GUILDWAR_CTF_DESCLIST))
  228. self.__ClickRadioButton(self.typeButtonList, 0)
  229. def __OnClickTypeButtonNormal(self):
  230. self.__ClickSelectedTypeRadioButton()
  231. def __OnClickTypeButtonWarp(self):
  232. self.__ClickSelectedTypeRadioButton()
  233. def __OnClickTypeButtonCTF(self):
  234. self.__ClickSelectedTypeRadioButton()
  235. def __ClickTypeRadioButton(self, type):
  236. self.__ClickRadioButton(self.typeButtonList, type)
  237. self.type=type
  238. def __ClickRadioButton(self, buttonList, buttonIndex):
  239. try:
  240. selButton=buttonList[buttonIndex]
  241. except IndexError:
  242. return
  243. for eachButton in buttonList:
  244. eachButton.SetUp()
  245. selButton.Down()
  246. def SetTitle(self, name):
  247. self.board.SetTitleName(name)
  248. def SetNumberMode(self):
  249. self.inputValue.SetNumberMode()
  250. def SetSecretMode(self):
  251. self.inputValue.SetSecret()
  252. def SetFocus(self):
  253. self.inputValue.SetFocus()
  254. def SetMaxLength(self, length):
  255. width = length * 6 + 10
  256. self.inputValue.SetMax(length)
  257. self.SetSlotWidth(width)
  258. self.SetBoardWidth(max(width + 50, 160))
  259. def SetSlotWidth(self, width):
  260. self.inputSlot.SetSize(width, self.inputSlot.GetHeight())
  261. self.inputValue.SetSize(width, self.inputValue.GetHeight())
  262. def SetBoardWidth(self, width):
  263. self.board.SetSize(max(width + 50, 160), self.GetHeight())
  264. self.SetSize(max(width + 50, 160), self.GetHeight())
  265. self.UpdateRect()
  266. def SAFE_SetAcceptEvent(self, event):
  267. self.SetAcceptEvent(ui.__mem_func__(event))
  268. def SAFE_SetCancelEvent(self, event):
  269. self.SetCancelEvent(ui.__mem_func__(event))
  270. def SetAcceptEvent(self, event):
  271. self.acceptButton.SetEvent(event)
  272. self.inputValue.OnIMEReturn = event
  273. def SetCancelEvent(self, event):
  274. self.board.SetCloseEvent(event)
  275. self.cancelButton.SetEvent(event)
  276. self.inputValue.OnPressEscapeKey = event
  277. def GetType(self):
  278. return self.type
  279. def GetText(self):
  280. return self.inputValue.GetText()
  281. def __CreateGameTypeToolTip(self, title, descList):
  282. toolTip = uiToolTip.ToolTip()
  283. toolTip.SetTitle(title)
  284. toolTip.AppendSpace(5)
  285. for desc in descList:
  286. toolTip.AutoAppendTextLine(desc)
  287. toolTip.AlignHorizonalCenter()
  288. return toolTip
  289. class GuildWarScoreBoard(ui.ThinBoard):
  290. def __init__(self):
  291. ui.ThinBoard.__init__(self)
  292. self.Initialize()
  293. def __del__(self):
  294. ui.ThinBoard.__del__(self)
  295. def Initialize(self):
  296. self.allyGuildID = 0
  297. self.enemyGuildID = 0
  298. self.allyDataDict = {}
  299. self.enemyDataDict = {}
  300. def Open(self, allyGuildID, enemyGuildID):
  301. self.allyGuildID = allyGuildID
  302. self.enemyGuildID = enemyGuildID
  303. self.SetPosition(10, wndMgr.GetScreenHeight() - 100)
  304. mark = ui.MarkBox()
  305. mark.SetParent(self)
  306. mark.SetIndex(allyGuildID)
  307. mark.SetPosition(10, 10 + 18*0)
  308. mark.Show()
  309. scoreText = ui.TextLine()
  310. scoreText.SetParent(self)
  311. scoreText.SetPosition(30, 10 + 18*0)
  312. scoreText.SetHorizontalAlignLeft()
  313. scoreText.Show()
  314. self.allyDataDict["NAME"] = guild.GetGuildName(allyGuildID)
  315. self.allyDataDict["SCORE"] = 0
  316. self.allyDataDict["MEMBER_COUNT"] = -1
  317. self.allyDataDict["MARK"] = mark
  318. self.allyDataDict["TEXT"] = scoreText
  319. mark = ui.MarkBox()
  320. mark.SetParent(self)
  321. mark.SetIndex(enemyGuildID)
  322. mark.SetPosition(10, 10 + 18*1)
  323. mark.Show()
  324. scoreText = ui.TextLine()
  325. scoreText.SetParent(self)
  326. scoreText.SetPosition(30, 10 + 18*1)
  327. scoreText.SetHorizontalAlignLeft()
  328. scoreText.Show()
  329. self.enemyDataDict["NAME"] = guild.GetGuildName(enemyGuildID)
  330. self.enemyDataDict["SCORE"] = 0
  331. self.enemyDataDict["MEMBER_COUNT"] = -1
  332. self.enemyDataDict["MARK"] = mark
  333. self.enemyDataDict["TEXT"] = scoreText
  334. self.__RefreshName()
  335. self.Show()
  336. def __GetDataDict(self, ID):
  337. if self.allyGuildID == ID:
  338. return self.allyDataDict
  339. if self.enemyGuildID == ID:
  340. return self.enemyDataDict
  341. return None
  342. def SetScore(self, gainGuildID, opponetGuildID, point):
  343. dataDict = self.__GetDataDict(gainGuildID)
  344. if not dataDict:
  345. return
  346. dataDict["SCORE"] = point
  347. self.__RefreshName()
  348. def UpdateMemberCount(self, guildID1, memberCount1, guildID2, memberCount2):
  349. dataDict1 = self.__GetDataDict(guildID1)
  350. dataDict2 = self.__GetDataDict(guildID2)
  351. if dataDict1:
  352. dataDict1["MEMBER_COUNT"] = memberCount1
  353. if dataDict2:
  354. dataDict2["MEMBER_COUNT"] = memberCount2
  355. self.__RefreshName()
  356. def __RefreshName(self):
  357. nameMaxLen = max(len(self.allyDataDict["NAME"]), len(self.enemyDataDict["NAME"]))
  358. if -1 == self.allyDataDict["MEMBER_COUNT"] or -1 == self.enemyDataDict["MEMBER_COUNT"]:
  359. self.SetSize(30+nameMaxLen*6+8*5, 50)
  360. self.allyDataDict["TEXT"].SetText("%s %d" % (self.allyDataDict["NAME"], self.allyDataDict["SCORE"]))
  361. self.enemyDataDict["TEXT"].SetText("%s %d" % (self.enemyDataDict["NAME"], self.enemyDataDict["SCORE"]))
  362. else:
  363. self.SetSize(30+nameMaxLen*6+8*5+15, 50)
  364. self.allyDataDict["TEXT"].SetText("%s(%d) %d" % (self.allyDataDict["NAME"], self.allyDataDict["MEMBER_COUNT"], self.allyDataDict["SCORE"]))
  365. self.enemyDataDict["TEXT"].SetText("%s(%d) %d" % (self.enemyDataDict["NAME"], self.enemyDataDict["MEMBER_COUNT"], self.enemyDataDict["SCORE"]))
  366. class MouseReflector(ui.Window):
  367. def __init__(self, parent):
  368. ui.Window.__init__(self)
  369. self.SetParent(parent)
  370. self.AddFlag("not_pick")
  371. self.width = self.height = 0
  372. self.isDown = False
  373. def Down(self):
  374. self.isDown = True
  375. def Up(self):
  376. self.isDown = False
  377. def OnRender(self):
  378. if self.isDown:
  379. grp.SetColor(ui.WHITE_COLOR)
  380. else:
  381. grp.SetColor(ui.HALF_WHITE_COLOR)
  382. x, y = self.GetGlobalPosition()
  383. grp.RenderBar(x+2, y+2, self.GetWidth()-4, self.GetHeight()-4)
  384. class EditableTextSlot(ui.ImageBox):
  385. def __init__(self, parent, x, y):
  386. ui.ImageBox.__init__(self)
  387. self.SetParent(parent)
  388. self.SetPosition(x, y)
  389. self.LoadImage("d:/ymir work/ui/public/Parameter_Slot_02.sub")
  390. self.mouseReflector = MouseReflector(self)
  391. self.mouseReflector.SetSize(self.GetWidth(), self.GetHeight())
  392. self.Enable = True
  393. self.textLine = ui.MakeTextLine(self)
  394. self.event = lambda *arg: None
  395. self.arg = 0
  396. self.Show()
  397. self.mouseReflector.UpdateRect()
  398. def __del__(self):
  399. ui.ImageBox.__del__(self)
  400. def SetText(self, text):
  401. self.textLine.SetText(text)
  402. def SetEvent(self, event, arg):
  403. self.event = event
  404. self.arg = arg
  405. def Disable(self):
  406. self.Enable = False
  407. def OnMouseOverIn(self):
  408. if not self.Enable:
  409. return
  410. self.mouseReflector.Show()
  411. def OnMouseOverOut(self):
  412. if not self.Enable:
  413. return
  414. self.mouseReflector.Hide()
  415. def OnMouseLeftButtonDown(self):
  416. if not self.Enable:
  417. return
  418. self.mouseReflector.Down()
  419. def OnMouseLeftButtonUp(self):
  420. if not self.Enable:
  421. return
  422. self.mouseReflector.Up()
  423. self.event(self.arg)
  424. class CheckBox(ui.ImageBox):
  425. def __init__(self, parent, x, y, event, filename = "d:/ymir work/ui/public/Parameter_Slot_01.sub"):
  426. ui.ImageBox.__init__(self)
  427. self.SetParent(parent)
  428. self.SetPosition(x, y)
  429. self.LoadImage(filename)
  430. self.mouseReflector = MouseReflector(self)
  431. self.mouseReflector.SetSize(self.GetWidth(), self.GetHeight())
  432. image = ui.MakeImageBox(self, "d:/ymir work/ui/public/check_image.sub", 0, 0)
  433. image.AddFlag("not_pick")
  434. image.SetWindowHorizontalAlignCenter()
  435. image.SetWindowVerticalAlignCenter()
  436. image.Hide()
  437. self.Enable = True
  438. self.image = image
  439. self.event = event
  440. self.Show()
  441. self.mouseReflector.UpdateRect()
  442. def __del__(self):
  443. ui.ImageBox.__del__(self)
  444. def SetCheck(self, flag):
  445. if flag:
  446. self.image.Show()
  447. else:
  448. self.image.Hide()
  449. def Disable(self):
  450. self.Enable = False
  451. def OnMouseOverIn(self):
  452. if not self.Enable:
  453. return
  454. self.mouseReflector.Show()
  455. def OnMouseOverOut(self):
  456. if not self.Enable:
  457. return
  458. self.mouseReflector.Hide()
  459. def OnMouseLeftButtonDown(self):
  460. if not self.Enable:
  461. return
  462. self.mouseReflector.Down()
  463. def OnMouseLeftButtonUp(self):
  464. if not self.Enable:
  465. return
  466. self.mouseReflector.Up()
  467. self.event()
  468. class ChangeGradeNameDialog(ui.ScriptWindow):
  469. def __init__(self):
  470. ui.ScriptWindow.__init__(self)
  471. def Open(self):
  472. self.gradeNameSlot.SetText("")
  473. self.gradeNameSlot.SetFocus()
  474. xMouse, yMouse = wndMgr.GetMousePosition()
  475. self.SetPosition(xMouse - self.GetWidth()/2, yMouse + 50)
  476. self.SetTop()
  477. self.Show()
  478. def Close(self):
  479. self.gradeNameSlot.KillFocus()
  480. self.Hide()
  481. return True
  482. def SetGradeNumber(self, gradeNumber):
  483. self.gradeNumber = gradeNumber
  484. def GetGradeNumber(self):
  485. return self.gradeNumber
  486. def GetGradeName(self):
  487. return self.gradeNameSlot.GetText()
  488. def OnPressEscapeKey(self):
  489. self.Close()
  490. return True
  491. class CommentSlot(ui.Window):
  492. TEXT_LIMIT = 35
  493. def __init__(self):
  494. ui.Window.__init__(self)
  495. self.slotImage = ui.MakeImageBox(self, "d:/ymir work/ui/public/Parameter_Slot_06.sub", 0, 0)
  496. self.slotImage.AddFlag("not_pick")
  497. self.slotSimpleText = ui.MakeTextLine(self)
  498. self.slotSimpleText.SetPosition(2, 0)
  499. self.slotSimpleText.SetWindowHorizontalAlignLeft()
  500. self.slotSimpleText.SetHorizontalAlignLeft()
  501. self.bar = ui.SlotBar()
  502. self.bar.SetParent(self)
  503. self.bar.AddFlag("not_pick")
  504. self.bar.Hide()
  505. self.slotFullText = ui.MakeTextLine(self)
  506. self.slotFullText.SetPosition(2, 0)
  507. self.slotFullText.SetWindowHorizontalAlignLeft()
  508. self.slotFullText.SetHorizontalAlignLeft()
  509. self.SetSize(self.slotImage.GetWidth(), self.slotImage.GetHeight())
  510. self.len = 0
  511. def SetText(self, text):
  512. self.len = len(text)
  513. if len(text) > self.TEXT_LIMIT:
  514. limitText = grpText.GetSplitingTextLine(text, self.TEXT_LIMIT-3, 0)
  515. self.slotSimpleText.SetText(limitText + "...")
  516. self.bar.SetSize(self.len * 6 + 5, 17)
  517. else:
  518. self.slotSimpleText.SetText(text)
  519. self.slotFullText.SetText(text)
  520. self.slotFullText.SetPosition(2, 0)
  521. self.slotFullText.Hide()
  522. def OnMouseOverIn(self):
  523. if self.len > self.TEXT_LIMIT:
  524. self.bar.Show()
  525. self.slotFullText.Show()
  526. def OnMouseOverOut(self):
  527. if self.len > self.TEXT_LIMIT:
  528. self.bar.Hide()
  529. self.slotFullText.Hide()
  530. class GuildWindow(ui.ScriptWindow):
  531. JOB_NAME = { 0 : localeInfo.JOB_WARRIOR,
  532. 1 : localeInfo.JOB_ASSASSIN,
  533. 2 : localeInfo.JOB_SURA,
  534. 3 : localeInfo.JOB_SHAMAN, }
  535. GUILD_SKILL_PASSIVE_SLOT = 0
  536. GUILD_SKILL_ACTIVE_SLOT = 1
  537. GUILD_SKILL_AFFECT_SLOT = 2
  538. GRADE_SLOT_NAME = 0
  539. GRADE_ADD_MEMBER_AUTHORITY = 1
  540. GRADE_REMOVE_MEMBER_AUTHORITY = 2
  541. GRADE_NOTICE_AUTHORITY = 3
  542. GRADE_SKILL_AUTHORITY = 4
  543. MEMBER_LINE_COUNT = 13
  544. class PageWindow(ui.ScriptWindow):
  545. def __init__(self, parent, filename):
  546. ui.ScriptWindow.__init__(self)
  547. self.SetParent(parent)
  548. self.filename = filename
  549. def GetScriptFileName(self):
  550. return self.filename
  551. def __init__(self):
  552. ui.ScriptWindow.__init__(self)
  553. self.isLoaded=0
  554. self.__Initialize()
  555. def __del__(self):
  556. ui.ScriptWindow.__del__(self)
  557. print " ==================================== DESTROIED GUILD WINDOW"
  558. def __Initialize(self):
  559. self.board = None
  560. self.pageName = None
  561. self.tabDict = None
  562. self.tabButtonDict = None
  563. self.pickDialog = None
  564. self.questionDialog = None
  565. self.offerDialog = None
  566. self.popupDialog = None
  567. self.moneyDialog = None
  568. self.changeGradeNameDialog = None
  569. self.popup = None
  570. self.popupMessage = None
  571. self.commentSlot = None
  572. self.pageWindow = None
  573. self.tooltipSkill = None
  574. self.memberLinePos = 0
  575. self.enemyGuildNameList = []
  576. def Open(self):
  577. self.Show()
  578. self.SetTop()
  579. guildID = net.GetGuildID()
  580. self.largeMarkBox.SetIndex(guildID)
  581. self.largeMarkBox.SetScale(3)
  582. def Close(self):
  583. self.__CloseAllGuildMemberPageGradeComboBox()
  584. self.offerDialog.Close()
  585. self.popupDialog.Hide()
  586. self.changeGradeNameDialog.Hide()
  587. self.tooltipSkill.Hide()
  588. self.Hide()
  589. self.pickDialog = None
  590. self.questionDialog = None
  591. self.popup = None
  592. def Destroy(self):
  593. self.ClearDictionary()
  594. if self.offerDialog:
  595. self.offerDialog.Destroy()
  596. if self.popupDialog:
  597. self.popupDialog.ClearDictionary()
  598. if self.changeGradeNameDialog:
  599. self.changeGradeNameDialog.ClearDictionary()
  600. if self.pageWindow:
  601. for window in self.pageWindow.values():
  602. window.ClearDictionary()
  603. self.__Initialize()
  604. def Show(self):
  605. if self.isLoaded==0:
  606. self.isLoaded=1
  607. self.__LoadWindow()
  608. self.RefreshGuildInfoPage()
  609. self.RefreshGuildBoardPage()
  610. self.RefreshGuildMemberPage()
  611. self.RefreshGuildSkillPage()
  612. self.RefreshGuildGradePage()
  613. ui.ScriptWindow.Show(self)
  614. def __LoadWindow(self):
  615. global DISABLE_GUILD_SKILL
  616. try:
  617. pyScrLoader = ui.PythonScriptLoader()
  618. if localeInfo.IsARABIC() :
  619. pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow.py")
  620. else:
  621. pyScrLoader.LoadScriptFile(self, "uiscript/guildwindow.py")
  622. self.popupDialog = ui.ScriptWindow()
  623. pyScrLoader.LoadScriptFile(self.popupDialog, "UIScript/PopupDialog.py")
  624. self.changeGradeNameDialog = ChangeGradeNameDialog()
  625. pyScrLoader.LoadScriptFile(self.changeGradeNameDialog, "uiscript/changegradenamedialog.py")
  626. if localeInfo.IsARABIC():
  627. self.pageWindow = {
  628. "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"),
  629. "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
  630. "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
  631. "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
  632. "SKILL" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildskillpage.py"),
  633. "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
  634. }
  635. elif localeInfo.IsJAPAN() :
  636. self.pageWindow = {
  637. "GUILD_INFO" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildinfopage.py"),
  638. "BOARD" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_boardpage.py"),
  639. "MEMBER" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_memberpage.py"),
  640. "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
  641. "SKILL" : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"),
  642. "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
  643. }
  644. elif localeInfo.IsVIETNAM() : # ´ÙÇ¥½Ã
  645. self.pageWindow = {
  646. "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"),
  647. "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
  648. "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
  649. "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
  650. "SKILL" : self.PageWindow(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "guildwindow_guildskillpage.py"),
  651. "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
  652. }
  653. elif localeInfo.IsEUROPE() and not app.GetLocalePath() == "locale/ca" :
  654. self.pageWindow = {
  655. "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage_eu.py"),
  656. "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
  657. "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
  658. "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
  659. "SKILL" : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"),
  660. "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
  661. }
  662. else:
  663. self.pageWindow = {
  664. "GUILD_INFO" : self.PageWindow(self, "uiscript/guildwindow_guildinfopage.py"),
  665. "BOARD" : self.PageWindow(self, "uiscript/guildwindow_boardpage.py"),
  666. "MEMBER" : self.PageWindow(self, "uiscript/guildwindow_memberpage.py"),
  667. "BASE_INFO" : self.PageWindow(self, "uiscript/guildwindow_baseinfopage.py"),
  668. "SKILL" : self.PageWindow(self, "uiscript/guildwindow_guildskillpage.py"),
  669. "GRADE" : self.PageWindow(self, "uiscript/guildwindow_gradepage.py"),
  670. }
  671. for window in self.pageWindow.values():
  672. pyScrLoader.LoadScriptFile(window, window.GetScriptFileName())
  673. except:
  674. import exception
  675. exception.Abort("GuildWindow.__LoadWindow.LoadScript")
  676. try:
  677. getObject = self.GetChild
  678. self.board = getObject("Board")
  679. self.pageName = {
  680. "GUILD_INFO" : localeInfo.GUILD_TILE_INFO,
  681. "BOARD" : localeInfo.GUILD_TILE_BOARD,
  682. "MEMBER" : localeInfo.GUILD_TILE_MEMBER,
  683. "BASE_INFO" : localeInfo.GUILD_TILE_BASEINFO,
  684. "SKILL" : localeInfo.GUILD_TILE_SKILL,
  685. "GRADE" : localeInfo.GUILD_TILE_GRADE,
  686. }
  687. self.tabDict = {
  688. "GUILD_INFO" : getObject("Tab_01"),
  689. "BOARD" : getObject("Tab_02"),
  690. "MEMBER" : getObject("Tab_03"),
  691. "BASE_INFO" : getObject("Tab_04"),
  692. "SKILL" : getObject("Tab_05"),
  693. "GRADE" : getObject("Tab_06"),
  694. }
  695. self.tabButtonDict = {
  696. "GUILD_INFO" : getObject("Tab_Button_01"),
  697. "BOARD" : getObject("Tab_Button_02"),
  698. "MEMBER" : getObject("Tab_Button_03"),
  699. "BASE_INFO" : getObject("Tab_Button_04"),
  700. "SKILL" : getObject("Tab_Button_05"),
  701. "GRADE" : getObject("Tab_Button_06"),
  702. }
  703. ## QuestionDialog
  704. self.popupMessage = self.popupDialog.GetChild("message")
  705. self.popupDialog.GetChild("accept").SetEvent(ui.__mem_func__(self.popupDialog.Hide))
  706. ## ChangeGradeName
  707. self.changeGradeNameDialog.GetChild("AcceptButton").SetEvent(ui.__mem_func__(self.OnChangeGradeName))
  708. self.changeGradeNameDialog.GetChild("CancelButton").SetEvent(ui.__mem_func__(self.changeGradeNameDialog.Hide))
  709. self.changeGradeNameDialog.GetChild("Board").SetCloseEvent(ui.__mem_func__(self.changeGradeNameDialog.Hide))
  710. self.changeGradeNameDialog.gradeNameSlot = self.changeGradeNameDialog.GetChild("GradeNameValue")
  711. self.changeGradeNameDialog.gradeNameSlot.OnIMEReturn = ui.__mem_func__(self.OnChangeGradeName)
  712. self.changeGradeNameDialog.gradeNameSlot.OnPressEscapeKey = ui.__mem_func__(self.changeGradeNameDialog.Close)
  713. ## Comment
  714. self.commentSlot = self.pageWindow["BOARD"].GetChild("CommentValue")
  715. self.commentSlot.OnIMEReturn = ui.__mem_func__(self.OnPostComment)
  716. #self.commentSlot.OnKeyDown = ui.__mem_func__(self.OnKeyDownInBoardPage)
  717. self.commentSlot.OnKeyDown = lambda key, argSelf=self: argSelf.OnKeyDownInBoardPage(key)
  718. ## RefreshButton
  719. self.pageWindow["BOARD"].GetChild("RefreshButton").SetEvent(ui.__mem_func__(self.OnRefreshComments))
  720. ## ScrollBar
  721. scrollBar = self.pageWindow["MEMBER"].GetChild("ScrollBar")
  722. scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScrollMemberLine))
  723. self.pageWindow["MEMBER"].scrollBar = scrollBar
  724. except:
  725. import exception
  726. exception.Abort("GuildWindow.__LoadWindow.BindObject")
  727. self.__MakeInfoPage()
  728. self.__MakeBoardPage()
  729. self.__MakeMemberPage()
  730. self.__MakeBaseInfoPage()
  731. self.__MakeSkillPage()
  732. self.__MakeGradePage()
  733. for page in self.pageWindow.values():
  734. page.UpdateRect()
  735. for key, btn in self.tabButtonDict.items():
  736. btn.SetEvent(self.SelectPage, key)
  737. self.tabButtonDict["BASE_INFO"].Disable()
  738. if DISABLE_GUILD_SKILL:
  739. self.tabButtonDict["SKILL"].Disable()
  740. self.board.SetCloseEvent(ui.__mem_func__(self.Close))
  741. self.board.SetTitleColor(0xffffffff)
  742. self.SelectPage("GUILD_INFO")
  743. self.offerDialog = uiPickMoney.PickMoneyDialog()
  744. self.offerDialog.LoadDialog()
  745. self.offerDialog.SetMax(9)
  746. self.offerDialog.SetTitleName(localeInfo.GUILD_OFFER_EXP)
  747. self.offerDialog.SetAcceptEvent(ui.__mem_func__(self.OnOffer))
  748. def __MakeInfoPage(self):
  749. page = self.pageWindow["GUILD_INFO"]
  750. try:
  751. page.nameSlot = page.GetChild("GuildNameValue")
  752. page.masterNameSlot = page.GetChild("GuildMasterNameValue")
  753. page.guildLevelSlot = page.GetChild("GuildLevelValue")
  754. page.curExpSlot = page.GetChild("CurrentExperienceValue")
  755. page.lastExpSlot = page.GetChild("LastExperienceValue")
  756. page.memberCountSlot = page.GetChild("GuildMemberCountValue")
  757. page.levelAverageSlot = page.GetChild("GuildMemberLevelAverageValue")
  758. page.uploadMarkButton = page.GetChild("UploadGuildMarkButton")
  759. page.uploadSymbolButton = page.GetChild("UploadGuildSymbolButton")
  760. page.declareWarButton = page.GetChild("DeclareWarButton")
  761. # page.Toplanti = page.GetChild("Toplantibutton")
  762. # wayaq = player.GetMainCharacterName()
  763. # wayamk = guild.GetGuildMasterName()
  764. # if wayaq == wayamk:
  765. # page.Toplanti.Show()
  766. # else:
  767. # page.Toplanti.Hide()
  768. try:
  769. page.guildMoneySlot = page.GetChild("GuildMoneyValue")
  770. except KeyError:
  771. page.guildMoneySlot = None
  772. try:
  773. page.GetChild("DepositButton").SetEvent(ui.__mem_func__(self.__OnClickDepositButton))
  774. page.GetChild("WithdrawButton").SetEvent(ui.__mem_func__(self.__OnClickWithdrawButton))
  775. except KeyError:
  776. pass
  777. page.uploadMarkButton.SetEvent(ui.__mem_func__(self.__OnClickSelectGuildMarkButton))
  778. page.uploadSymbolButton.SetEvent(ui.__mem_func__(self.__OnClickSelectGuildSymbolButton))
  779. page.declareWarButton.SetEvent(ui.__mem_func__(self.__OnClickDeclareWarButton))
  780. # page.Toplanti.SetEvent(ui.__mem_func__(self.Toplanti))
  781. page.GetChild("OfferButton").SetEvent(ui.__mem_func__(self.__OnClickOfferButton))
  782. page.GetChild("EnemyGuildCancel1").Hide()
  783. page.GetChild("EnemyGuildCancel2").Hide()
  784. page.GetChild("EnemyGuildCancel3").Hide()
  785. page.GetChild("EnemyGuildCancel4").Hide()
  786. page.GetChild("EnemyGuildCancel5").Hide()
  787. page.GetChild("EnemyGuildCancel6").Hide()
  788. self.enemyGuildNameList.append(page.GetChild("EnemyGuildName1"))
  789. self.enemyGuildNameList.append(page.GetChild("EnemyGuildName2"))
  790. self.enemyGuildNameList.append(page.GetChild("EnemyGuildName3"))
  791. self.enemyGuildNameList.append(page.GetChild("EnemyGuildName4"))
  792. self.enemyGuildNameList.append(page.GetChild("EnemyGuildName5"))
  793. self.enemyGuildNameList.append(page.GetChild("EnemyGuildName6"))
  794. self.largeMarkBox = page.GetChild("LargeGuildMark")
  795. except:
  796. import exception
  797. exception.Abort("GuildWindow.__MakeInfoPage")
  798. self.largeMarkBox.AddFlag("not_pick")
  799. self.markSelectDialog=uiUploadMark.MarkSelectDialog()
  800. self.markSelectDialog.SAFE_SetSelectEvent(self.__OnSelectMark)
  801. self.symbolSelectDialog=uiUploadMark.SymbolSelectDialog()
  802. self.symbolSelectDialog.SAFE_SetSelectEvent(self.__OnSelectSymbol)
  803. def __MakeBoardPage(self):
  804. i = 0
  805. lineStep = 20
  806. page = self.pageWindow["BOARD"]
  807. page.boardDict = {}
  808. for i in xrange(12):
  809. yPos = 25 + i * lineStep
  810. ## NoticeMark
  811. if localeInfo.IsJAPAN():
  812. noticeMarkImage = ui.MakeImageBox(page, "d:/ymir work/ui/game/guild/notice_mark.sub", 15, yPos+3)
  813. else:
  814. noticeMarkImage = ui.MakeImageBox(page, "d:/ymir work/ui/game/guild/notice_mark.sub", 5, yPos+3)
  815. noticeMarkImage.Hide()
  816. page.Children.append(noticeMarkImage)
  817. ## Name
  818. if localeInfo.IsJAPAN():
  819. nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 9, yPos)
  820. else:
  821. nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 15, yPos)
  822. nameSlot = ui.MakeTextLine(nameSlotImage)
  823. page.Children.append(nameSlotImage)
  824. page.Children.append(nameSlot)
  825. ## Delete Button
  826. deleteButton = ui.MakeButton(page, 340, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub")
  827. deleteButton.SetEvent(ui.__mem_func__(self.OnDeleteComment), i)
  828. page.Children.append(deleteButton)
  829. ## Comment
  830. commentSlot = CommentSlot()
  831. commentSlot.SetParent(page)
  832. commentSlot.SetPosition(114, yPos)
  833. commentSlot.Show()
  834. page.Children.append(commentSlot)
  835. boardSlotList = []
  836. boardSlotList.append(noticeMarkImage)
  837. boardSlotList.append(nameSlot)
  838. boardSlotList.append(commentSlot)
  839. page.boardDict[i] = boardSlotList
  840. ## PostComment - Have to make this here for that fit tooltip's position.
  841. postCommentButton = ui.MakeButton(page, 337, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub")
  842. postCommentButton.SetEvent(ui.__mem_func__(self.OnPostComment))
  843. page.Children.append(postCommentButton)
  844. def __MakeMemberPage(self):
  845. page = self.pageWindow["MEMBER"]
  846. lineStep = 20
  847. page.memberDict = {}
  848. for i in xrange(self.MEMBER_LINE_COUNT):
  849. inverseLineIndex = self.MEMBER_LINE_COUNT - i - 1
  850. yPos = 28 + inverseLineIndex*lineStep
  851. ## Name
  852. if localeInfo.IsJAPAN():
  853. nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 15, yPos)
  854. else:
  855. nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 10, yPos)
  856. nameSlot = ui.MakeTextLine(nameSlotImage)
  857. page.Children.append(nameSlotImage)
  858. page.Children.append(nameSlot)
  859. ## Grade
  860. gradeSlot = ui.ComboBox()
  861. gradeSlot.SetParent(page)
  862. if localeInfo.IsJAPAN():
  863. gradeSlot.SetPosition(117, yPos-1)
  864. else:
  865. gradeSlot.SetPosition(101, yPos-1)
  866. gradeSlot.SetSize(61, 18)
  867. gradeSlot.SetEvent(lambda gradeNumber, lineIndex=inverseLineIndex, argSelf=proxy(self): argSelf.OnChangeMemberGrade(lineIndex, gradeNumber))
  868. gradeSlot.Show()
  869. page.Children.append(gradeSlot)
  870. ## Job
  871. if localeInfo.IsJAPAN():
  872. jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 181, yPos)
  873. else:
  874. jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 170, yPos)
  875. jobSlot = ui.MakeTextLine(jobSlotImage)
  876. page.Children.append(jobSlotImage)
  877. page.Children.append(jobSlot)
  878. ## Level
  879. if localeInfo.IsJAPAN():
  880. levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 221, yPos)
  881. else:
  882. levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 210, yPos)
  883. levelSlot = ui.MakeTextLine(levelSlotImage)
  884. page.Children.append(levelSlotImage)
  885. page.Children.append(levelSlot)
  886. ## Offer
  887. if localeInfo.IsJAPAN():
  888. offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 261, yPos)
  889. else:
  890. offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 250, yPos)
  891. offerSlot = ui.MakeTextLine(offerSlotImage)
  892. page.Children.append(offerSlotImage)
  893. page.Children.append(offerSlot)
  894. ## General Enable
  895. event = lambda argSelf=proxy(self), argIndex=inverseLineIndex: apply(argSelf.OnEnableGeneral, (argIndex,))
  896. if localeInfo.IsJAPAN():
  897. generalEnableCheckBox = CheckBox(page, 307, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
  898. else:
  899. generalEnableCheckBox = CheckBox(page, 297, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
  900. page.Children.append(generalEnableCheckBox)
  901. memberSlotList = []
  902. memberSlotList.append(nameSlot)
  903. memberSlotList.append(gradeSlot)
  904. memberSlotList.append(jobSlot)
  905. memberSlotList.append(levelSlot)
  906. memberSlotList.append(offerSlot)
  907. memberSlotList.append(generalEnableCheckBox)
  908. page.memberDict[inverseLineIndex] = memberSlotList
  909. def __MakeBaseInfoPage(self):
  910. page = self.pageWindow["BASE_INFO"]
  911. page.buildingDataDict = {}
  912. lineStep = 20
  913. GUILD_BUILDING_MAX_NUM = 7
  914. yPos = 95 + 35
  915. for i in xrange(GUILD_BUILDING_MAX_NUM):
  916. nameSlotImage = ui.MakeSlotBar(page, 15, yPos, 78, 17)
  917. nameSlot = ui.MakeTextLine(nameSlotImage)
  918. page.Children.append(nameSlotImage)
  919. page.Children.append(nameSlot)
  920. nameSlot.SetText(localeInfo.GUILD_BUILDING_NAME)
  921. gradeSlotImage = ui.MakeSlotBar(page, 99, yPos, 26, 17)
  922. gradeSlot = ui.MakeTextLine(gradeSlotImage)
  923. page.Children.append(gradeSlotImage)
  924. page.Children.append(gradeSlot)
  925. gradeSlot.SetText(localeInfo.GUILD_BUILDING_GRADE)
  926. RESOURCE_MAX_NUM = 6
  927. for j in xrange(RESOURCE_MAX_NUM):
  928. resourceSlotImage = ui.MakeSlotBar(page, 131 + 29*j, yPos, 26, 17)
  929. resourceSlot = ui.MakeTextLine(resourceSlotImage)
  930. page.Children.append(resourceSlotImage)
  931. page.Children.append(resourceSlot)
  932. resourceSlot.SetText(localeInfo.GUILD_GEM)
  933. event = lambda *arg: None
  934. powerSlot = CheckBox(page, 308, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
  935. page.Children.append(powerSlot)
  936. yPos += lineStep
  937. def __MakeSkillPage(self):
  938. page = self.pageWindow["SKILL"]
  939. page.skillPoint = page.GetChild("Skill_Plus_Value")
  940. page.passiveSlot = page.GetChild("Passive_Skill_Slot_Table")
  941. page.activeSlot = page.GetChild("Active_Skill_Slot_Table")
  942. page.affectSlot = page.GetChild("Affect_Slot_Table")
  943. page.gpGauge = page.GetChild("Dragon_God_Power_Gauge")
  944. page.gpValue = page.GetChild("Dragon_God_Power_Value")
  945. page.btnHealGSP = page.GetChild("Heal_GSP_Button")
  946. page.activeSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
  947. page.activeSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OverInItem(slotNumber, type))
  948. page.activeSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  949. page.activeSlot.SetSelectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnPickUpGuildSkill(slotNumber, type))
  950. page.activeSlot.SetUnselectItemSlotEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUseGuildSkill(slotNumber, type))
  951. page.activeSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_ACTIVE_SLOT: self.OnUpGuildSkill(slotNumber, type))
  952. page.activeSlot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
  953. "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
  954. "d:/ymir work/ui/game/windows/btn_plus_down.sub")
  955. page.passiveSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
  956. page.passiveSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_PASSIVE_SLOT: self.OverInItem(slotNumber, type))
  957. page.passiveSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  958. page.passiveSlot.SetPressedSlotButtonEvent(lambda slotNumber, type=self.GUILD_SKILL_PASSIVE_SLOT: self.OnUpGuildSkill(slotNumber, type))
  959. page.passiveSlot.AppendSlotButton("d:/ymir work/ui/game/windows/btn_plus_up.sub",\
  960. "d:/ymir work/ui/game/windows/btn_plus_over.sub",\
  961. "d:/ymir work/ui/game/windows/btn_plus_down.sub")
  962. page.affectSlot.SetSlotStyle(wndMgr.SLOT_STYLE_NONE)
  963. page.affectSlot.SetOverInItemEvent(lambda slotNumber, type=self.GUILD_SKILL_AFFECT_SLOT: self.OverInItem(slotNumber, type))
  964. page.affectSlot.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
  965. page.btnHealGSP.SetEvent(ui.__mem_func__(self.__OnOpenHealGSPBoard))
  966. ## Passive
  967. """
  968. for i in xrange(len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)):
  969. slotIndex = page.passiveSlot.GetStartIndex()+i
  970. skillIndex = playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST[i]
  971. page.passiveSlot.SetSkillSlot(slotIndex, skillIndex, 0)
  972. page.passiveSlot.RefreshSlot()
  973. guild.SetSkillIndex(slotIndex, i)
  974. """
  975. ## Active
  976. for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):
  977. slotIndex = page.activeSlot.GetStartIndex()+i
  978. skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i]
  979. page.activeSlot.SetSkillSlot(slotIndex, skillIndex, 0)
  980. page.activeSlot.SetCoverButton(slotIndex)
  981. page.activeSlot.RefreshSlot()
  982. guild.SetSkillIndex(slotIndex, len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)+i)
  983. def __MakeGradePage(self):
  984. lineStep = 18
  985. page = self.pageWindow["GRADE"]
  986. page.gradeDict = {}
  987. for i in xrange(15):
  988. yPos = 22 + i*lineStep
  989. index = i+1
  990. ## GradeNumber
  991. gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 14, yPos)
  992. gradeNumberSlot = ui.MakeTextLine(gradeNumberSlotImage)
  993. gradeNumberSlot.SetText(str(i+1))
  994. page.Children.append(gradeNumberSlotImage)
  995. page.Children.append(gradeNumberSlot)
  996. ## GradeName
  997. gradeNameSlot = EditableTextSlot(page, 58, yPos)
  998. gradeNameSlot.SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), index)
  999. page.Children.append(gradeNameSlot)
  1000. ## Invite Authority
  1001. event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
  1002. inviteAuthorityCheckBox = CheckBox(page, 124, yPos, event)
  1003. page.Children.append(inviteAuthorityCheckBox)
  1004. ## DriveOut Authority
  1005. event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
  1006. driveoutAuthorityCheckBox = CheckBox(page, 181, yPos, event)
  1007. page.Children.append(driveoutAuthorityCheckBox)
  1008. ## Notice Authority
  1009. event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
  1010. noticeAuthorityCheckBox = CheckBox(page, 238, yPos, event)
  1011. page.Children.append(noticeAuthorityCheckBox)
  1012. ## Skill Authority
  1013. event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
  1014. skillAuthorityCheckBox = CheckBox(page, 295, yPos, event)
  1015. page.Children.append(skillAuthorityCheckBox)
  1016. gradeSlotList = []
  1017. gradeSlotList.append(gradeNameSlot)
  1018. gradeSlotList.append(inviteAuthorityCheckBox)
  1019. gradeSlotList.append(driveoutAuthorityCheckBox)
  1020. gradeSlotList.append(noticeAuthorityCheckBox)
  1021. gradeSlotList.append(skillAuthorityCheckBox)
  1022. page.gradeDict[index] = gradeSlotList
  1023. masterSlotList = page.gradeDict[1]
  1024. for slot in masterSlotList:
  1025. slot.Disable()
  1026. def CanOpen(self):
  1027. return guild.IsGuildEnable()
  1028. def Open(self):
  1029. self.Show()
  1030. self.SetTop()
  1031. guildID = net.GetGuildID()
  1032. self.largeMarkBox.SetIndex(guildID)
  1033. self.largeMarkBox.SetScale(3)
  1034. def Close(self):
  1035. self.__CloseAllGuildMemberPageGradeComboBox()
  1036. self.offerDialog.Close()
  1037. self.popupDialog.Hide()
  1038. self.changeGradeNameDialog.Hide()
  1039. self.Hide()
  1040. if self.tooltipSkill:
  1041. self.tooltipSkill.Hide()
  1042. self.pickDialog = None
  1043. self.questionDialog = None
  1044. self.moneyDialog = None
  1045. def Destroy(self):
  1046. self.ClearDictionary()
  1047. self.board = None
  1048. self.pageName = None
  1049. self.tabDict = None
  1050. self.tabButtonDict = None
  1051. self.pickDialog = None
  1052. self.questionDialog = None
  1053. self.markSelectDialog = None
  1054. self.symbolSelectDialog = None
  1055. if self.offerDialog:
  1056. self.offerDialog.Destroy()
  1057. self.offerDialog = None
  1058. if self.popupDialog:
  1059. self.popupDialog.ClearDictionary()
  1060. self.popupDialog = None
  1061. if self.changeGradeNameDialog:
  1062. self.changeGradeNameDialog.ClearDictionary()
  1063. self.changeGradeNameDialog = None
  1064. self.popupMessage = None
  1065. self.commentSlot = None
  1066. if self.pageWindow:
  1067. for window in self.pageWindow.values():
  1068. window.ClearDictionary()
  1069. self.pageWindow = None
  1070. self.tooltipSkill = None
  1071. self.moneyDialog = None
  1072. self.enemyGuildNameList = []
  1073. def DeleteGuild(self):
  1074. self.RefreshGuildInfoPage()
  1075. self.RefreshGuildBoardPage()
  1076. self.RefreshGuildMemberPage()
  1077. self.RefreshGuildSkillPage()
  1078. self.RefreshGuildGradePage()
  1079. self.Hide()
  1080. def SetSkillToolTip(self, tooltipSkill):
  1081. self.tooltipSkill = tooltipSkill
  1082. def SelectPage(self, arg):
  1083. if "BOARD" == arg:
  1084. self.OnRefreshComments()
  1085. for key, btn in self.tabButtonDict.items():
  1086. if arg != key:
  1087. btn.SetUp()
  1088. for key, img in self.tabDict.items():
  1089. if arg == key:
  1090. img.Show()
  1091. else:
  1092. img.Hide()
  1093. for key, page in self.pageWindow.items():
  1094. if arg == key:
  1095. page.Show()
  1096. else:
  1097. page.Hide()
  1098. self.board.SetTitleName(self.pageName[arg])
  1099. self.__CloseAllGuildMemberPageGradeComboBox()
  1100. def __CloseAllGuildMemberPageGradeComboBox(self):
  1101. page = self.pageWindow["MEMBER"]
  1102. for key, slotList in page.memberDict.items():
  1103. slotList[1].CloseListBox()
  1104. def RefreshGuildInfoPage(self):
  1105. if self.isLoaded==0:
  1106. return
  1107. global DISABLE_DECLARE_WAR
  1108. page = self.pageWindow["GUILD_INFO"]
  1109. page.nameSlot.SetText(guild.GetGuildName())
  1110. page.masterNameSlot.SetText(guild.GetGuildMasterName())
  1111. page.guildLevelSlot.SetText(str(guild.GetGuildLevel()))
  1112. if page.guildMoneySlot:
  1113. page.guildMoneySlot.SetText(str(guild.GetGuildMoney()))
  1114. curExp, lastExp = guild.GetGuildExperience()
  1115. curExp *= 100
  1116. lastExp *= 100
  1117. page.curExpSlot.SetText(str(curExp))
  1118. page.lastExpSlot.SetText(str(lastExp))
  1119. curMemberCount, maxMemberCount = guild.GetGuildMemberCount()
  1120. if maxMemberCount== 0xffff:
  1121. page.memberCountSlot.SetText("%d / %s " % (curMemberCount, localeInfo.GUILD_MEMBER_COUNT_INFINITY))
  1122. else:
  1123. page.memberCountSlot.SetText("%d / %d" % (curMemberCount, maxMemberCount))
  1124. page.levelAverageSlot.SetText(str(guild.GetGuildMemberLevelAverage()))
  1125. ## ±æµåÀ常 ±æµå ¸¶Å©¿Í ±æµåÀü ½Åû ¹öÆ°À» º¼ ¼ö ÀÖÀ½
  1126. mainCharacterName = player.GetMainCharacterName()
  1127. masterName = guild.GetGuildMasterName()
  1128. if mainCharacterName == masterName:
  1129. page.uploadMarkButton.Show()
  1130. if DISABLE_DECLARE_WAR:
  1131. # page.GetChild("Toplantibutton").Hide()
  1132. page.declareWarButton.Hide()
  1133. else:
  1134. page.declareWarButton.Show()
  1135. # page.GetChild("Toplantibutton").Show()
  1136. if guild.HasGuildLand():
  1137. page.uploadSymbolButton.Show()
  1138. else:
  1139. page.uploadSymbolButton.Hide()
  1140. else:
  1141. page.uploadMarkButton.Hide()
  1142. # page.GetChild("Toplantibutton").Hide()
  1143. page.declareWarButton.Hide()
  1144. page.uploadSymbolButton.Hide()
  1145. ## Refresh ½Ã¿¡ ±æµåÀü Á¤º¸ ¾÷µ¥ÀÌÆ®
  1146. for i in xrange(guild.ENEMY_GUILD_SLOT_MAX_COUNT):
  1147. name = guild.GetEnemyGuildName(i)
  1148. nameTextLine = self.enemyGuildNameList[i]
  1149. if name:
  1150. nameTextLine.SetText(name)
  1151. else:
  1152. nameTextLine.SetText(localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY)
  1153. def __GetGuildBoardCommentData(self, index):
  1154. commentID, chrName, comment = guild.GetGuildBoardCommentData(index)
  1155. if 0==commentID:
  1156. if ""==chrName:
  1157. chrName=localeInfo.UI_NONAME
  1158. if ""==comment:
  1159. comment=localeInfo.UI_NOCONTENTS
  1160. return commentID, chrName, comment
  1161. def RefreshGuildBoardPage(self):
  1162. if self.isLoaded==0:
  1163. return
  1164. page = self.pageWindow["BOARD"]
  1165. self.BOARD_LINE_MAX_NUM = 12
  1166. lineIndex = 0
  1167. commentCount = guild.GetGuildBoardCommentCount()
  1168. for i in xrange(commentCount):
  1169. commentID, chrName, comment = self.__GetGuildBoardCommentData(i)
  1170. if not comment:
  1171. continue
  1172. slotList = page.boardDict[lineIndex]
  1173. if "!" == comment[0]:
  1174. slotList[0].Show()
  1175. slotList[1].SetText(chrName)
  1176. slotList[2].SetText(comment[1:])
  1177. else:
  1178. slotList[0].Hide()
  1179. slotList[1].SetText(chrName)
  1180. slotList[2].SetText(comment)
  1181. lineIndex += 1
  1182. for i in xrange(self.BOARD_LINE_MAX_NUM - lineIndex):
  1183. slotList = page.boardDict[lineIndex+i]
  1184. slotList[0].Hide()
  1185. slotList[1].SetText("")
  1186. slotList[2].SetText("")
  1187. def RefreshGuildMemberPage(self):
  1188. if self.isLoaded==0:
  1189. return
  1190. page = self.pageWindow["MEMBER"]
  1191. ## ScrollBar
  1192. count = guild.GetMemberCount()
  1193. if count > self.MEMBER_LINE_COUNT:
  1194. page.scrollBar.SetMiddleBarSize(float(self.MEMBER_LINE_COUNT) / float(count))
  1195. page.scrollBar.Show()
  1196. else:
  1197. page.scrollBar.Hide()
  1198. self.RefreshGuildMemberPageGradeComboBox()
  1199. self.RefreshGuildMemberPageMemberList()
  1200. def RefreshGuildMemberPageMemberList(self):
  1201. if self.isLoaded==0:
  1202. return
  1203. page = self.pageWindow["MEMBER"]
  1204. for line, slotList in page.memberDict.items():
  1205. gradeComboBox = slotList[1]
  1206. gradeComboBox.Disable()
  1207. if not guild.IsMember(line):
  1208. slotList[0].SetText("")
  1209. slotList[2].SetText("")
  1210. slotList[3].SetText("")
  1211. slotList[4].SetText("")
  1212. slotList[5].SetCheck(False)
  1213. continue
  1214. pid, name, grade, race, level, offer, general = self.GetMemberData(line)
  1215. if pid < 0:
  1216. continue
  1217. job = chr.RaceToJob(race)
  1218. guildExperienceSummary = guild.GetGuildExperienceSummary()
  1219. offerPercentage = 0
  1220. if guildExperienceSummary > 0:
  1221. offerPercentage = int(float(offer) / float(guildExperienceSummary) * 100.0)
  1222. slotList[0].SetText(name)
  1223. slotList[2].SetText(self.JOB_NAME.get(job, "?"))
  1224. slotList[3].SetText(str(level))
  1225. slotList[4].SetText(str(offerPercentage) + "%")
  1226. slotList[5].SetCheck(general)
  1227. gradeComboBox.SetCurrentItem(guild.GetGradeName(grade))
  1228. if 1 != grade:
  1229. gradeComboBox.Enable()
  1230. def RefreshGuildMemberPageGradeComboBox(self):
  1231. if self.isLoaded==0:
  1232. return
  1233. page = self.pageWindow["MEMBER"]
  1234. self.CAN_CHANGE_GRADE_COUNT = 15 - 1
  1235. for key, slotList in page.memberDict.items():
  1236. gradeComboBox = slotList[1]
  1237. gradeComboBox.Disable()
  1238. if not guild.IsMember(key):
  1239. continue
  1240. pid, name, grade, job, level, offer, general = self.GetMemberData(key)
  1241. if pid < 0:
  1242. continue
  1243. gradeComboBox.ClearItem()
  1244. for i in xrange(self.CAN_CHANGE_GRADE_COUNT):
  1245. gradeComboBox.InsertItem(i+2, guild.GetGradeName(i+2))
  1246. gradeComboBox.SetCurrentItem(guild.GetGradeName(grade))
  1247. if 1 != grade:
  1248. gradeComboBox.Enable()
  1249. def RefreshGuildSkillPage(self):
  1250. if self.isLoaded==0:
  1251. return
  1252. page = self.pageWindow["SKILL"]
  1253. curPoint, maxPoint = guild.GetDragonPowerPoint()
  1254. maxPoint = max(maxPoint, 1)
  1255. page.gpValue.SetText(str(curPoint) + " / " + str(maxPoint))
  1256. percentage = (float(curPoint) / float(maxPoint) * 100) * (float(173) / float(95))
  1257. page.gpGauge.SetPercentage(int(percentage), 100)
  1258. skillPoint = guild.GetGuildSkillPoint()
  1259. page.skillPoint.SetText(str(skillPoint))
  1260. page.passiveSlot.HideAllSlotButton()
  1261. page.activeSlot.HideAllSlotButton()
  1262. ## Passive
  1263. """
  1264. for i in xrange(len(playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST)):
  1265. slotIndex = page.passiveSlot.GetStartIndex()+i
  1266. skillIndex = playerSettingModule.PASSIVE_GUILD_SKILL_INDEX_LIST[i]
  1267. skillLevel = guild.GetSkillLevel(slotIndex)
  1268. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  1269. page.passiveSlot.SetSlotCount(slotIndex, skillLevel)
  1270. if skillPoint > 0:
  1271. if skillLevel < skillMaxLevel:
  1272. page.passiveSlot.ShowSlotButton(slotIndex)
  1273. """
  1274. ## Active
  1275. for i in xrange(len(playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST)):
  1276. slotIndex = page.activeSlot.GetStartIndex()+i
  1277. skillIndex = playerSettingModule.ACTIVE_GUILD_SKILL_INDEX_LIST[i]
  1278. skillLevel = guild.GetSkillLevel(slotIndex)
  1279. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  1280. page.activeSlot.SetSlotCount(slotIndex, skillLevel)
  1281. if skillLevel <= 0:
  1282. page.activeSlot.DisableCoverButton(slotIndex)
  1283. else:
  1284. page.activeSlot.EnableCoverButton(slotIndex)
  1285. if skillPoint > 0:
  1286. if skillLevel < skillMaxLevel:
  1287. page.activeSlot.ShowSlotButton(slotIndex)
  1288. def RefreshGuildGradePage(self):
  1289. if self.isLoaded==0:
  1290. return
  1291. page = self.pageWindow["GRADE"]
  1292. for key, slotList in page.gradeDict.items():
  1293. name, authority = guild.GetGradeData(int(key))
  1294. slotList[self.GRADE_SLOT_NAME].SetText(name)
  1295. slotList[self.GRADE_ADD_MEMBER_AUTHORITY].SetCheck(authority & guild.AUTH_ADD_MEMBER)
  1296. slotList[self.GRADE_REMOVE_MEMBER_AUTHORITY].SetCheck(authority & guild.AUTH_REMOVE_MEMBER)
  1297. slotList[self.GRADE_NOTICE_AUTHORITY].SetCheck(authority & guild.AUTH_NOTICE)
  1298. slotList[self.GRADE_SKILL_AUTHORITY].SetCheck(authority & guild.AUTH_SKILL)
  1299. ## GuildInfo
  1300. def __PopupMessage(self, msg):
  1301. self.popupMessage.SetText(msg)
  1302. self.popupDialog.SetTop()
  1303. self.popupDialog.Show()
  1304. def __OnClickSelectGuildMarkButton(self):
  1305. if guild.GetGuildLevel() < int(localeInfo.GUILD_MARK_MIN_LEVEL):
  1306. self.__PopupMessage(localeInfo.GUILD_MARK_NOT_ENOUGH_LEVEL)
  1307. elif not guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
  1308. self.__PopupMessage(localeInfo.GUILD_NO_NOTICE_PERMISSION)
  1309. else:
  1310. self.markSelectDialog.Open()
  1311. # def Toplanti(self):
  1312. # import uiCommon
  1313. # import constInfo
  1314. # questionDialogtoplantiyap=uiCommon.QuestionDialog()
  1315. # questionDialogtoplantiyap.SetText("Bulunduğun bölgede toplantı yapmak istiyor musun ?")
  1316. # questionDialogtoplantiyap.SetAcceptEvent(lambda arg=TRUE: self.loncatoplantiyapevet())
  1317. # questionDialogtoplantiyap.SetCancelEvent(lambda arg=FALSE: self.loncatoplantiyaphayir())
  1318. # questionDialogtoplantiyap.Open()
  1319. # self.questionDialogtoplantiyap=questionDialogtoplantiyap
  1320. # return
  1321. # def loncatoplantiyapevet(self):
  1322. # net.SendChatPacket("/loncatoplantisi")
  1323. # self.questionDialogtoplantiyap.Close()
  1324. # def loncatoplantiyaphayir(self):
  1325. # self.questionDialogtoplantiyap.Close()
  1326. def __OnClickSelectGuildSymbolButton(self):
  1327. if guild.MainPlayerHasAuthority(guild.AUTH_NOTICE):
  1328. self.symbolSelectDialog.Open()
  1329. else:
  1330. self.__PopupMessage(localeInfo.GUILD_NO_NOTICE_PERMISSION)
  1331. def __OnClickDeclareWarButton(self):
  1332. inputDialog = DeclareGuildWarDialog()
  1333. inputDialog.Open()
  1334. self.inputDialog = inputDialog
  1335. def __OnSelectMark(self, markFileName):
  1336. ret = net.UploadMark("upload/"+markFileName)
  1337. # MARK_BUG_FIX
  1338. if net.ERROR_MARK_UPLOAD_NEED_RECONNECT == ret:
  1339. self.__PopupMessage(localeInfo.UPLOAD_MARK_UPLOAD_NEED_RECONNECT);
  1340. return ret
  1341. # END_OF_MARK_BUG_FIX
  1342. def __OnSelectSymbol(self, symbolFileName):
  1343. net.UploadSymbol("upload/"+symbolFileName)
  1344. def __OnClickOfferButton(self):
  1345. curEXP = unsigned32(player.GetStatus(player.EXP))
  1346. if curEXP <= 100:
  1347. self.__PopupMessage(localeInfo.GUILD_SHORT_EXP);
  1348. return
  1349. self.offerDialog.Open(curEXP, 100)
  1350. def __OnClickDepositButton(self):
  1351. moneyDialog = uiPickMoney.PickMoneyDialog()
  1352. moneyDialog.LoadDialog()
  1353. moneyDialog.SetMax(6)
  1354. moneyDialog.SetTitleName(localeInfo.GUILD_DEPOSIT)
  1355. moneyDialog.SetAcceptEvent(ui.__mem_func__(self.OnDeposit))
  1356. moneyDialog.Open(player.GetMoney())
  1357. self.moneyDialog = moneyDialog
  1358. def __OnClickWithdrawButton(self):
  1359. moneyDialog = uiPickMoney.PickMoneyDialog()
  1360. moneyDialog.LoadDialog()
  1361. moneyDialog.SetMax(6)
  1362. moneyDialog.SetTitleName(localeInfo.GUILD_WITHDRAW)
  1363. moneyDialog.SetAcceptEvent(ui.__mem_func__(self.OnWithdraw))
  1364. moneyDialog.Open(guild.GetGuildMoney())
  1365. self.moneyDialog = moneyDialog
  1366. def __OnBlock(self):
  1367. popup = uiCommon.PopupDialog()
  1368. popup.SetText(localeInfo.NOT_YET_SUPPORT)
  1369. popup.SetAcceptEvent(self.__OnClosePopupDialog)
  1370. popup.Open()
  1371. self.popup = popup
  1372. def __OnClosePopupDialog(self):
  1373. self.popup = None
  1374. def OnDeposit(self, money):
  1375. net.SendGuildDepositMoneyPacket(money)
  1376. def OnWithdraw(self, money):
  1377. net.SendGuildWithdrawMoneyPacket(money)
  1378. def OnOffer(self, exp):
  1379. net.SendGuildOfferPacket(exp)
  1380. ## Board
  1381. def OnPostComment(self):
  1382. text = self.commentSlot.GetText()
  1383. if not text:
  1384. return False
  1385. net.SendGuildPostCommentPacket(text[:50])
  1386. self.commentSlot.SetText("")
  1387. return True
  1388. def OnDeleteComment(self, index):
  1389. commentID, chrName, comment = self.__GetGuildBoardCommentData(index)
  1390. net.SendGuildDeleteCommentPacket(commentID)
  1391. def OnRefreshComments(self):
  1392. net.SendGuildRefreshCommentsPacket(0)
  1393. def OnKeyDownInBoardPage(self, key):
  1394. if key == 63:
  1395. self.OnRefreshComments()
  1396. return True
  1397. ## Member
  1398. ## OnEnableGeneral
  1399. def OnChangeMemberGrade(self, lineIndex, gradeNumber):
  1400. PID = guild.MemberIndexToPID(lineIndex + self.memberLinePos)
  1401. net.SendGuildChangeMemberGradePacket(PID, gradeNumber)
  1402. def OnEnableGeneral(self, lineIndex):
  1403. if not guild.IsMember(lineIndex):
  1404. return
  1405. pid, name, grade, job, level, offer, general = self.GetMemberData(lineIndex)
  1406. if pid < 0:
  1407. return
  1408. net.SendGuildChangeMemberGeneralPacket(pid, 1 - general)
  1409. ## Grade
  1410. def OnOpenChangeGradeName(self, arg):
  1411. self.changeGradeNameDialog.SetGradeNumber(arg)
  1412. self.changeGradeNameDialog.Open()
  1413. def OnChangeGradeName(self):
  1414. self.changeGradeNameDialog.Hide()
  1415. gradeNumber = self.changeGradeNameDialog.GetGradeNumber()
  1416. gradeName = self.changeGradeNameDialog.GetGradeName()
  1417. if len(gradeName) == 0:
  1418. gradeName = localeInfo.GUILD_DEFAULT_GRADE
  1419. net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName)
  1420. return True
  1421. def OnCheckAuthority(self, argIndex, argAuthority):
  1422. name, authority = guild.GetGradeData(argIndex)
  1423. net.SendGuildChangeGradeAuthorityPacket(argIndex, authority ^ argAuthority)
  1424. def OnScrollMemberLine(self):
  1425. scrollBar = self.pageWindow["MEMBER"].scrollBar
  1426. pos = scrollBar.GetPos()
  1427. count = guild.GetMemberCount()
  1428. newLinePos = int(float(count - self.MEMBER_LINE_COUNT) * pos)
  1429. if newLinePos != self.memberLinePos:
  1430. self.memberLinePos = newLinePos
  1431. self.RefreshGuildMemberPageMemberList()
  1432. self.__CloseAllGuildMemberPageGradeComboBox()
  1433. def GetMemberData(self, localPos):
  1434. return guild.GetMemberData(localPos + self.memberLinePos)
  1435. ## Guild Skill
  1436. def __OnOpenHealGSPBoard(self):
  1437. curPoint, maxPoint = guild.GetDragonPowerPoint()
  1438. if maxPoint - curPoint <= 0:
  1439. self.__PopupMessage(localeInfo.GUILD_CANNOT_HEAL_GSP_ANYMORE)
  1440. return
  1441. pickDialog = uiPickMoney.PickMoneyDialog()
  1442. pickDialog.LoadDialog()
  1443. pickDialog.SetMax(9)
  1444. pickDialog.SetTitleName(localeInfo.GUILD_HEAL_GSP)
  1445. pickDialog.SetAcceptEvent(ui.__mem_func__(self.__OnOpenHealGSPQuestionDialog))
  1446. pickDialog.Open(maxPoint - curPoint, 1)
  1447. self.pickDialog = pickDialog
  1448. def __OnOpenHealGSPQuestionDialog(self, healGSP):
  1449. money = healGSP * constInfo.GUILD_MONEY_PER_GSP
  1450. questionDialog = uiCommon.QuestionDialog()
  1451. questionDialog.SetText(localeInfo.GUILD_DO_YOU_HEAL_GSP % (money, healGSP))
  1452. questionDialog.SetAcceptEvent(ui.__mem_func__(self.__OnHealGSP))
  1453. questionDialog.SetCancelEvent(ui.__mem_func__(self.__OnCloseQuestionDialog))
  1454. questionDialog.SetWidth(400)
  1455. questionDialog.Open()
  1456. questionDialog.healGSP = healGSP
  1457. self.questionDialog = questionDialog
  1458. def __OnHealGSP(self):
  1459. net.SendGuildChargeGSPPacket(self.questionDialog.healGSP)
  1460. self.__OnCloseQuestionDialog()
  1461. def __OnCloseQuestionDialog(self):
  1462. if self.questionDialog:
  1463. self.questionDialog.Close()
  1464. self.questionDialog = None
  1465. def OnPickUpGuildSkill(self, skillSlotIndex, type):
  1466. mouseController = mouseModule.mouseController
  1467. if False == mouseController.isAttached():
  1468. skillIndex = player.GetSkillIndex(skillSlotIndex)
  1469. skillLevel = guild.GetSkillLevel(skillSlotIndex)
  1470. if skill.CanUseSkill(skillIndex) and skillLevel > 0:
  1471. if app.IsPressed(app.DIK_LCONTROL):
  1472. player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_SKILL, skillSlotIndex)
  1473. return
  1474. mouseController.AttachObject(self, player.SLOT_TYPE_SKILL, skillSlotIndex, skillIndex)
  1475. else:
  1476. mouseController.DeattachObject()
  1477. def OnUseGuildSkill(self, slotNumber, type):
  1478. skillIndex = player.GetSkillIndex(slotNumber)
  1479. skillLevel = guild.GetSkillLevel(slotNumber)
  1480. if skillLevel <= 0:
  1481. return
  1482. player.UseGuildSkill(slotNumber)
  1483. def OnUpGuildSkill(self, slotNumber, type):
  1484. skillIndex = player.GetSkillIndex(slotNumber)
  1485. net.SendChatPacket("/gskillup " + str(skillIndex))
  1486. def OnUseSkill(self, slotNumber, coolTime):
  1487. if self.isLoaded==0:
  1488. return
  1489. page = self.pageWindow["SKILL"]
  1490. if page.activeSlot.HasSlot(slotNumber):
  1491. page.activeSlot.SetSlotCoolTime(slotNumber, coolTime)
  1492. def OnStartGuildWar(self, guildSelf, guildOpp):
  1493. if self.isLoaded==0:
  1494. return
  1495. if guild.GetGuildID() != guildSelf:
  1496. return
  1497. guildName = guild.GetGuildName(guildOpp)
  1498. for guildNameTextLine in self.enemyGuildNameList:
  1499. if localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY == guildNameTextLine.GetText():
  1500. guildNameTextLine.SetText(guildName)
  1501. return
  1502. def OnEndGuildWar(self, guildSelf, guildOpp):
  1503. if self.isLoaded==0:
  1504. return
  1505. if guild.GetGuildID() != guildSelf:
  1506. return
  1507. guildName = guild.GetGuildName(guildOpp)
  1508. for guildNameTextLine in self.enemyGuildNameList:
  1509. if guildName == guildNameTextLine.GetText():
  1510. guildNameTextLine.SetText(localeInfo.GUILD_INFO_ENEMY_GUILD_EMPTY)
  1511. return
  1512. ## ToolTip
  1513. def OverInItem(self, slotNumber, type):
  1514. if mouseModule.mouseController.isAttached():
  1515. return
  1516. if None != self.tooltipSkill:
  1517. skillIndex = player.GetSkillIndex(slotNumber)
  1518. skillLevel = guild.GetSkillLevel(slotNumber)
  1519. self.tooltipSkill.SetSkill(skillIndex, skillLevel)
  1520. def OverOutItem(self):
  1521. if None != self.tooltipSkill:
  1522. self.tooltipSkill.HideToolTip()
  1523. def OnPressEscapeKey(self):
  1524. self.Close()
  1525. return True
  1526. class BuildGuildBuildingWindow(ui.ScriptWindow):
  1527. if localeInfo.IsJAPAN():
  1528. GUILD_CATEGORY_LIST = (
  1529. ("HEADQUARTER", "Šî‘bŒš’z•¨"),
  1530. ("FACILITY", "Šg’£Œš’z•¨"),
  1531. ("OBJECT", "‚»‚Ì‘¼"),
  1532. )
  1533. elif localeInfo.IsYMIR() or localeInfo.IsWE_KOREA():
  1534. GUILD_CATEGORY_LIST = (
  1535. ("HEADQUARTER", "º»°Ç¹°"),
  1536. ("FACILITY", "±â´É°Ç¹°"),
  1537. ("OBJECT", "Á¶°æ¹°"),
  1538. )
  1539. elif localeInfo.IsEUROPE() or localeInfo.IsHONGKONG():
  1540. GUILD_CATEGORY_LIST = (
  1541. ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER),
  1542. ("FACILITY", localeInfo.GUILD_FACILITY),
  1543. ("OBJECT", localeInfo.GUILD_OBJECT),
  1544. )
  1545. else:
  1546. try :
  1547. GUILD_CATEGORY_LIST = (
  1548. ("HEADQUARTER", localeInfo.GUILD_HEADQUARTER),
  1549. ("FACILITY", localeInfo.GUILD_FACILITY),
  1550. ("OBJECT", localeInfo.GUILD_OBJECT),
  1551. )
  1552. except:
  1553. GUILD_CATEGORY_LIST = (
  1554. ("HEADQUARTER", "Main Building"),
  1555. ("FACILITY", "Facility"),
  1556. ("OBJECT", "Object"),
  1557. )
  1558. MODE_VIEW = 0
  1559. MODE_POSITIONING = 1
  1560. MODE_PREVIEW = 2
  1561. BUILDING_ALPHA = 0.55
  1562. ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  1563. DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  1564. START_INSTANCE_INDEX = 123450
  1565. #WALL_SET_INSTANCE = 14105
  1566. def __init__(self):
  1567. ui.ScriptWindow.__init__(self)
  1568. self.__LoadWindow()
  1569. self.closeEvent = None
  1570. self.popup = None
  1571. self.mode = self.MODE_VIEW
  1572. self.race = 0
  1573. self.type = None
  1574. self.x = 0
  1575. self.y = 0
  1576. self.z = 0
  1577. self.rot_x = 0
  1578. self.rot_y = 0
  1579. self.rot_z = 0
  1580. self.rot_x_limit = 0
  1581. self.rot_y_limit = 0
  1582. self.rot_z_limit = 0
  1583. self.needMoney = 0
  1584. self.needStoneCount = 0
  1585. self.needLogCount = 0
  1586. self.needPlywoodCount = 0
  1587. #self.index = 0
  1588. self.indexList = []
  1589. self.raceList = []
  1590. self.posList = []
  1591. self.rotList = []
  1592. index = 0
  1593. for category in self.GUILD_CATEGORY_LIST:
  1594. self.categoryList.InsertItem(index, category[1])
  1595. index += 1
  1596. def __del__(self):
  1597. ui.ScriptWindow.__del__(self)
  1598. def __LoadWindow(self):
  1599. try:
  1600. pyScrLoader = ui.PythonScriptLoader()
  1601. pyScrLoader.LoadScriptFile(self, "uiScript/buildguildbuildingwindow.py")
  1602. import chat
  1603. chat.AppendChat("Test python loader function.")
  1604. except:
  1605. import exception
  1606. exception.Abort("DeclareGuildWarWindow.__CreateDialog - LoadScript")
  1607. try:
  1608. getObject = self.GetChild
  1609. self.board = getObject("Board")
  1610. self.categoryList = getObject("CategoryList")
  1611. self.buildingList = getObject("BuildingList")
  1612. self.listScrollBar = getObject("ListScrollBar")
  1613. self.positionButton = getObject("PositionButton")
  1614. self.previewButton = getObject("PreviewButton")
  1615. self.posValueX = getObject("BuildingPositionXValue")
  1616. self.posValueY = getObject("BuildingPositionYValue")
  1617. self.ctrlRotationX = getObject("BuildingRotationX")
  1618. self.ctrlRotationY = getObject("BuildingRotationY")
  1619. self.ctrlRotationZ = getObject("BuildingRotationZ")
  1620. self.buildingPriceValue = getObject("BuildingPriceValue")
  1621. self.buildingMaterialStoneValue = getObject("BuildingMaterialStoneValue")
  1622. self.buildingMaterialLogValue = getObject("BuildingMaterialLogValue")
  1623. self.buildingMaterialPlywoodValue = getObject("BuildingMaterialPlywoodValue")
  1624. self.positionButton.SetEvent(ui.__mem_func__(self.__OnSelectPositioningMode))
  1625. self.previewButton.SetToggleDownEvent(ui.__mem_func__(self.__OnEnterPreviewMode))
  1626. self.previewButton.SetToggleUpEvent(ui.__mem_func__(self.__OnLeavePreviewMode))
  1627. self.ctrlRotationX.SetEvent(ui.__mem_func__(self.__OnChangeRotation))
  1628. self.ctrlRotationY.SetEvent(ui.__mem_func__(self.__OnChangeRotation))
  1629. self.ctrlRotationZ.SetEvent(ui.__mem_func__(self.__OnChangeRotation))
  1630. self.listScrollBar.SetScrollEvent(ui.__mem_func__(self.__OnScrollBuildingList))
  1631. getObject("CategoryList").SetEvent(ui.__mem_func__(self.__OnSelectCategory))
  1632. getObject("BuildingList").SetEvent(ui.__mem_func__(self.__OnSelectBuilding))
  1633. getObject("AcceptButton").SetEvent(ui.__mem_func__(self.Build))
  1634. getObject("CancelButton").SetEvent(ui.__mem_func__(self.Close))
  1635. self.board.SetCloseEvent(ui.__mem_func__(self.Close))
  1636. except:
  1637. import exception
  1638. exception.Abort("BuildGuildBuildingWindow.__LoadWindow - BindObject")
  1639. def __CreateWallBlock(self, race, x, y, rot=0.0 ):
  1640. idx = self.START_INSTANCE_INDEX + len(self.indexList)
  1641. self.indexList.append(idx)
  1642. self.raceList.append(race)
  1643. self.posList.append((x, y))
  1644. self.rotList.append(rot)
  1645. chr.CreateInstance(idx)
  1646. chr.SelectInstance(idx)
  1647. chr.SetVirtualID(idx)
  1648. chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)
  1649. chr.SetRace(race)
  1650. chr.SetArmor(0)
  1651. chr.Refresh()
  1652. chr.SetLoopMotion(chr.MOTION_WAIT)
  1653. chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA)
  1654. chr.SetRotationAll(0.0, 0.0, rot)
  1655. self.ctrlRotationX.SetSliderPos(0.5)
  1656. self.ctrlRotationY.SetSliderPos(0.5)
  1657. self.ctrlRotationZ.SetSliderPos(0.5)
  1658. def __GetObjectSize(self, race):
  1659. idx = self.START_INSTANCE_INDEX + 1000
  1660. chr.CreateInstance(idx)
  1661. chr.SelectInstance(idx)
  1662. chr.SetVirtualID(idx)
  1663. chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)
  1664. chr.SetRace(race)
  1665. chr.SetArmor(0)
  1666. chr.Refresh()
  1667. chr.SetLoopMotion(chr.MOTION_WAIT)
  1668. sx, sy, ex, ey = chr.GetBoundBoxOnlyXY(idx)
  1669. chr.DeleteInstance(idx)
  1670. return sx, sy, ex, ey
  1671. def __GetBuildInPosition(self):
  1672. zList = []
  1673. zList.append( background.GetHeight(self.x+self.sxPos, self.y+self.syPos) )
  1674. zList.append( background.GetHeight(self.x+self.sxPos, self.y+self.eyPos) )
  1675. zList.append( background.GetHeight(self.x+self.exPos, self.y+self.syPos) )
  1676. zList.append( background.GetHeight(self.x+self.exPos, self.y+self.eyPos) )
  1677. zList.append( background.GetHeight(self.x+(self.exPos+self.sxPos)/2, self.y+(self.eyPos+self.syPos)/2) )
  1678. zList.sort()
  1679. return zList[3]
  1680. def __CreateBuildInInstance(self,race):
  1681. self.__DeleteInstance()
  1682. object_base = race - race%10
  1683. door_minX, door_minY, door_maxX, door_maxY = self.__GetObjectSize(object_base+4)
  1684. corner_minX, corner_minY, corner_maxX, corner_maxY = self.__GetObjectSize(object_base+1)
  1685. line_minX, line_minY, line_maxX, line_maxY = self.__GetObjectSize(object_base+2)
  1686. line_width = line_maxX - line_minX
  1687. line_width_half = line_width / 2
  1688. X_SIZE_STEP = 2 * 2 ## 2ÀÇ ´ÜÀ§·Î¸¸ Áõ°¡ÇØ¾ß ÇÔ
  1689. Y_SIZE_STEP = 8
  1690. sxPos = door_maxX - corner_minX + (line_width_half*X_SIZE_STEP)
  1691. exPos = -sxPos
  1692. syPos = 0
  1693. eyPos = -(corner_maxY*2 + line_width*Y_SIZE_STEP)
  1694. self.sxPos = sxPos
  1695. self.syPos = syPos
  1696. self.exPos = exPos
  1697. self.eyPos = eyPos
  1698. z = self.__GetBuildInPosition()
  1699. ## Door
  1700. self.__CreateWallBlock(object_base+4, 0.0, syPos)
  1701. ## Corner
  1702. self.__CreateWallBlock(object_base+1, sxPos, syPos)
  1703. self.__CreateWallBlock(object_base+1, exPos, syPos, 270.0)
  1704. self.__CreateWallBlock(object_base+1, sxPos, eyPos, 90.0)
  1705. self.__CreateWallBlock(object_base+1, exPos, eyPos,180.0 )
  1706. ## Line
  1707. lineBlock = object_base+2
  1708. line_startX = -door_maxX - line_minX - (line_width_half*X_SIZE_STEP)
  1709. self.__CreateWallBlock(lineBlock, line_startX, eyPos)
  1710. self.__CreateWallBlock(lineBlock, line_startX+line_width*1, eyPos)
  1711. self.__CreateWallBlock(lineBlock, line_startX+line_width*2, eyPos)
  1712. self.__CreateWallBlock(lineBlock, line_startX+line_width*3, eyPos)
  1713. for i in xrange(X_SIZE_STEP):
  1714. self.__CreateWallBlock(lineBlock, line_startX+line_width*(3+i+1), eyPos)
  1715. for i in xrange(X_SIZE_STEP/2):
  1716. self.__CreateWallBlock(lineBlock, door_minX - line_maxX - line_width*i, syPos)
  1717. self.__CreateWallBlock(lineBlock, door_maxX - line_minX + line_width*i, syPos)
  1718. for i in xrange(Y_SIZE_STEP):
  1719. self.__CreateWallBlock(lineBlock, sxPos, line_minX + corner_minX - line_width*i, 90.0)
  1720. self.__CreateWallBlock(lineBlock, exPos, line_minX + corner_minX - line_width*i, 90.0)
  1721. self.SetBuildingPosition(int(self.x), int(self.y), self.__GetBuildInPosition())
  1722. def __DeleteInstance(self):
  1723. if not self.indexList:
  1724. return
  1725. for index in self.indexList:
  1726. chr.DeleteInstance(index)
  1727. self.indexList = []
  1728. self.raceList = []
  1729. self.posList = []
  1730. self.rotList = []
  1731. def __CreateInstance(self, race):
  1732. self.__DeleteInstance()
  1733. self.race = race
  1734. idx = self.START_INSTANCE_INDEX
  1735. self.indexList.append(idx)
  1736. self.posList.append((0, 0))
  1737. self.rotList.append(0)
  1738. chr.CreateInstance(idx)
  1739. chr.SelectInstance(idx)
  1740. chr.SetVirtualID(idx)
  1741. chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)
  1742. chr.SetRace(race)
  1743. chr.SetArmor(0)
  1744. chr.Refresh()
  1745. chr.SetLoopMotion(chr.MOTION_WAIT)
  1746. chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA)
  1747. self.SetBuildingPosition(int(self.x), int(self.y), 0)
  1748. self.ctrlRotationX.SetSliderPos(0.5)
  1749. self.ctrlRotationY.SetSliderPos(0.5)
  1750. self.ctrlRotationZ.SetSliderPos(0.5)
  1751. def Build(self):
  1752. if not self.__IsEnoughMoney():
  1753. self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MONEY)
  1754. return
  1755. if not self.__IsEnoughMaterialStone():
  1756. self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL)
  1757. return
  1758. if not self.__IsEnoughMaterialLog():
  1759. self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL)
  1760. return
  1761. if not self.__IsEnoughMaterialPlywood():
  1762. self.__PopupDialog(localeInfo.GUILD_NOT_ENOUGH_MATERIAL)
  1763. return
  1764. ## /build c vnum x y x_rot y_rot z_rot
  1765. ## /build d vnum
  1766. if "BUILDIN" == self.type:
  1767. for i in xrange(len(self.raceList)):
  1768. race = self.raceList[i]
  1769. xPos, yPos = self.posList[i]
  1770. rot = self.rotList[i]
  1771. net.SendChatPacket("/build c %d %d %d %d %d %d" % (race, int(self.x+xPos), int(self.y+yPos), self.rot_x, self.rot_y, rot))
  1772. else:
  1773. net.SendChatPacket("/build c %d %d %d %d %d %d" % (self.race, int(self.x), int(self.y), self.rot_x, self.rot_y, self.rot_z))
  1774. self.Close()
  1775. def Open(self):
  1776. x, y, z = player.GetMainCharacterPosition()
  1777. app.SetCameraSetting(int(x), int(-y), int(z), 3000, 0, 30)
  1778. background.VisibleGuildArea()
  1779. self.x = x
  1780. self.y = y
  1781. self.z = z
  1782. self.categoryList.SelectItem(0)
  1783. self.buildingList.SelectItem(0)
  1784. self.SetTop()
  1785. self.Show()
  1786. self.__DisablePCBlocker()
  1787. import debugInfo
  1788. if debugInfo.IsDebugMode():
  1789. self.categoryList.SelectItem(2)
  1790. self.buildingList.SelectItem(0)
  1791. def Close(self):
  1792. self.__DeleteInstance()
  1793. background.DisableGuildArea()
  1794. self.Hide()
  1795. self.__OnClosePopupDialog()
  1796. self.__EnablePCBlocker()
  1797. self.__UnlockCameraMoving()
  1798. if self.closeEvent:
  1799. self.closeEvent()
  1800. def Destory(self):
  1801. self.Close()
  1802. self.ClearDictionary()
  1803. self.board = None
  1804. self.categoryList = None
  1805. self.buildingList = None
  1806. self.listScrollBar = None
  1807. self.positionButton = None
  1808. self.previewButton = None
  1809. self.posValueX = None
  1810. self.posValueY = None
  1811. self.ctrlRotationX = None
  1812. self.ctrlRotationY = None
  1813. self.ctrlRotationZ = None
  1814. self.buildingPriceValue = None
  1815. self.buildingMaterialStoneValue = None
  1816. self.buildingMaterialLogValue = None
  1817. self.buildingMaterialPlywoodValue = None
  1818. self.closeEvent = None
  1819. def SetCloseEvent(self, event):
  1820. self.closeEvent = event
  1821. def __PopupDialog(self, text):
  1822. popup = uiCommon.PopupDialog()
  1823. popup.SetText(text)
  1824. popup.SetAcceptEvent(self.__OnClosePopupDialog)
  1825. popup.Open()
  1826. self.popup = popup
  1827. def __OnClosePopupDialog(self):
  1828. self.popup = None
  1829. def __EnablePCBlocker(self):
  1830. ## PC Blocker 󸮸¦ ÄÒ´Ù. (Åõ¸íÇØÁü)
  1831. chr.SetInstanceType(chr.INSTANCE_TYPE_BUILDING)
  1832. for idx in self.indexList:
  1833. chr.SetBlendRenderMode(idx, 1.0)
  1834. def __DisablePCBlocker(self):
  1835. ## PC Blocker 󸮸¦ ²ö´Ù. (¾ÈÅõ¸íÇØÁü)
  1836. chr.SetInstanceType(chr.INSTANCE_TYPE_OBJECT)
  1837. for idx in self.indexList:
  1838. chr.SetBlendRenderMode(idx, self.BUILDING_ALPHA)
  1839. def __OnSelectPositioningMode(self):
  1840. if self.MODE_PREVIEW == self.mode:
  1841. self.positionButton.SetUp()
  1842. return
  1843. self.mode = self.MODE_POSITIONING
  1844. self.Hide()
  1845. def __OnEnterPreviewMode(self):
  1846. if self.MODE_POSITIONING == self.mode:
  1847. self.previewButton.SetUp()
  1848. return
  1849. self.mode = self.MODE_PREVIEW
  1850. self.positionButton.SetUp()
  1851. self.__UnlockCameraMoving()
  1852. self.__EnablePCBlocker()
  1853. def __OnLeavePreviewMode(self):
  1854. self.__RestoreViewMode()
  1855. def __RestoreViewMode(self):
  1856. self.__DisablePCBlocker()
  1857. self.__LockCameraMoving()
  1858. self.mode = self.MODE_VIEW
  1859. self.positionButton.SetUp()
  1860. self.previewButton.SetUp()
  1861. def __IsEnoughMoney(self):
  1862. if app.IsEnableTestServerFlag():
  1863. return True
  1864. curMoney = player.GetMoney()
  1865. if curMoney < self.needMoney:
  1866. return False
  1867. return True
  1868. def __IsEnoughMaterialStone(self):
  1869. if app.IsEnableTestServerFlag():
  1870. return True
  1871. curStoneCount = player.GetItemCountByVnum(MATERIAL_STONE_ID)
  1872. if curStoneCount < self.needStoneCount:
  1873. return False
  1874. return True
  1875. def __IsEnoughMaterialLog(self):
  1876. if app.IsEnableTestServerFlag():
  1877. return True
  1878. curLogCount = player.GetItemCountByVnum(MATERIAL_LOG_ID)
  1879. if curLogCount < self.needLogCount:
  1880. return False
  1881. return True
  1882. def __IsEnoughMaterialPlywood(self):
  1883. if app.IsEnableTestServerFlag():
  1884. return True
  1885. curPlywoodCount = player.GetItemCountByVnum(MATERIAL_PLYWOOD_ID)
  1886. if curPlywoodCount < self.needPlywoodCount:
  1887. return False
  1888. return True
  1889. def __OnSelectCategory(self):
  1890. self.listScrollBar.SetPos(0.0)
  1891. self.__RefreshItem()
  1892. def __SetBuildingData(self, data):
  1893. self.buildingPriceValue.SetText(NumberToMoneyString(data["PRICE"]))
  1894. self.needMoney = int(data["PRICE"])
  1895. materialList = data["MATERIAL"]
  1896. self.needStoneCount = int(materialList[MATERIAL_STONE_INDEX])
  1897. self.needLogCount = int(materialList[MATERIAL_LOG_INDEX])
  1898. self.needPlywoodCount = int(materialList[MATERIAL_PLYWOOD_INDEX])
  1899. if (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/ca") and (localeInfo.IsEUROPE() and app.GetLocalePath() != "locale/br"):
  1900. self.buildingMaterialStoneValue.SetText(materialList[MATERIAL_STONE_INDEX])
  1901. self.buildingMaterialLogValue.SetText(materialList[MATERIAL_LOG_INDEX] )
  1902. self.buildingMaterialPlywoodValue.SetText(materialList[MATERIAL_PLYWOOD_INDEX])
  1903. else:
  1904. self.buildingMaterialStoneValue.SetText(materialList[MATERIAL_STONE_INDEX] + localeInfo.THING_COUNT)
  1905. self.buildingMaterialLogValue.SetText(materialList[MATERIAL_LOG_INDEX] + localeInfo.THING_COUNT)
  1906. self.buildingMaterialPlywoodValue.SetText(materialList[MATERIAL_PLYWOOD_INDEX] + localeInfo.THING_COUNT)
  1907. if self.__IsEnoughMoney():
  1908. self.buildingPriceValue.SetPackedFontColor(self.ENABLE_COLOR)
  1909. else:
  1910. self.buildingPriceValue.SetPackedFontColor(self.DISABLE_COLOR)
  1911. if self.__IsEnoughMaterialStone():
  1912. self.buildingMaterialStoneValue.SetPackedFontColor(self.ENABLE_COLOR)
  1913. else:
  1914. self.buildingMaterialStoneValue.SetPackedFontColor(self.DISABLE_COLOR)
  1915. if self.__IsEnoughMaterialLog():
  1916. self.buildingMaterialLogValue.SetPackedFontColor(self.ENABLE_COLOR)
  1917. else:
  1918. self.buildingMaterialLogValue.SetPackedFontColor(self.DISABLE_COLOR)
  1919. if self.__IsEnoughMaterialPlywood():
  1920. self.buildingMaterialPlywoodValue.SetPackedFontColor(self.ENABLE_COLOR)
  1921. else:
  1922. self.buildingMaterialPlywoodValue.SetPackedFontColor(self.DISABLE_COLOR)
  1923. self.rot_x_limit = data["X_ROT_LIMIT"]
  1924. self.rot_y_limit = data["Y_ROT_LIMIT"]
  1925. self.rot_z_limit = data["Z_ROT_LIMIT"]
  1926. self.ctrlRotationX.Enable()
  1927. self.ctrlRotationY.Enable()
  1928. self.ctrlRotationZ.Enable()
  1929. if 0 == self.rot_x_limit:
  1930. self.ctrlRotationX.Disable()
  1931. if 0 == self.rot_y_limit:
  1932. self.ctrlRotationY.Disable()
  1933. if 0 == self.rot_z_limit:
  1934. self.ctrlRotationZ.Disable()
  1935. def __OnSelectBuilding(self):
  1936. buildingIndex = self.buildingList.GetSelectedItem()
  1937. if buildingIndex >= len(BUILDING_DATA_LIST):
  1938. return
  1939. categoryIndex = self.categoryList.GetSelectedItem()
  1940. if categoryIndex >= len(self.GUILD_CATEGORY_LIST):
  1941. return
  1942. selectedType = self.GUILD_CATEGORY_LIST[categoryIndex][0]
  1943. index = 0
  1944. for data in BUILDING_DATA_LIST:
  1945. type = data["TYPE"]
  1946. vnum = data["VNUM"]
  1947. if selectedType != type:
  1948. continue
  1949. if index == buildingIndex:
  1950. self.type = type
  1951. if "BUILDIN" == self.type:
  1952. self.__CreateBuildInInstance(vnum)
  1953. else:
  1954. self.__CreateInstance(vnum)
  1955. self.__SetBuildingData(data)
  1956. index += 1
  1957. def __OnScrollBuildingList(self):
  1958. viewItemCount = self.buildingList.GetViewItemCount()
  1959. itemCount = self.buildingList.GetItemCount()
  1960. pos = self.listScrollBar.GetPos() * (itemCount-viewItemCount)
  1961. self.buildingList.SetBasePos(int(pos))
  1962. def __OnChangeRotation(self):
  1963. self.rot_x = self.ctrlRotationX.GetSliderPos() * self.rot_x_limit - self.rot_x_limit/2
  1964. self.rot_y = self.ctrlRotationY.GetSliderPos() * self.rot_y_limit - self.rot_y_limit/2
  1965. self.rot_z = (self.ctrlRotationZ.GetSliderPos() * 360 + 180) % 360
  1966. if "BUILDIN" == self.type:
  1967. chr.SetRotationAll(self.rot_x, self.rot_y, self.rot_z)
  1968. else:
  1969. chr.SetRotationAll(self.rot_x, self.rot_y, self.rot_z)
  1970. def __LockCameraMoving(self):
  1971. app.SetCameraSetting(int(self.x), int(-self.y), int(self.z), 3000, 0, 30)
  1972. def __UnlockCameraMoving(self):
  1973. app.SetDefaultCamera()
  1974. def __RefreshItem(self):
  1975. self.buildingList.ClearItem()
  1976. categoryIndex = self.categoryList.GetSelectedItem()
  1977. if categoryIndex >= len(self.GUILD_CATEGORY_LIST):
  1978. return
  1979. selectedType = self.GUILD_CATEGORY_LIST[categoryIndex][0]
  1980. index = 0
  1981. for data in BUILDING_DATA_LIST:
  1982. if selectedType != data["TYPE"]:
  1983. continue
  1984. if data["SHOW"]:
  1985. self.buildingList.InsertItem(index, data["LOCAL_NAME"])
  1986. index += 1
  1987. self.buildingList.SelectItem(0)
  1988. if self.buildingList.GetItemCount() < self.buildingList.GetViewItemCount():
  1989. self.buildingList.SetSize(120, self.buildingList.GetHeight())
  1990. self.buildingList.LocateItem()
  1991. self.listScrollBar.Hide()
  1992. else:
  1993. self.buildingList.SetSize(105, self.buildingList.GetHeight())
  1994. self.buildingList.LocateItem()
  1995. self.listScrollBar.Show()
  1996. def SettleCurrentPosition(self):
  1997. guildID = miniMap.GetGuildAreaID(self.x, self.y)
  1998. import debugInfo
  1999. if debugInfo.IsDebugMode():
  2000. guildID = player.GetGuildID()
  2001. if guildID != player.GetGuildID():
  2002. return
  2003. self.__RestoreViewMode()
  2004. self.__LockCameraMoving()
  2005. self.Show()
  2006. def SetBuildingPosition(self, x, y, z):
  2007. self.x = x
  2008. self.y = y
  2009. self.posValueX.SetText(str(int(x)))
  2010. self.posValueY.SetText(str(int(y)))
  2011. for i in xrange(len(self.indexList)):
  2012. idx = self.indexList[i]
  2013. xPos, yPos = self.posList[i]
  2014. chr.SelectInstance(idx)
  2015. if 0 != z:
  2016. self.z = z
  2017. chr.SetPixelPosition(int(x+xPos), int(y+yPos), int(z))
  2018. else:
  2019. chr.SetPixelPosition(int(x+xPos), int(y+yPos))
  2020. def IsPositioningMode(self):
  2021. if self.MODE_POSITIONING == self.mode:
  2022. return True
  2023. return False
  2024. def IsPreviewMode(self):
  2025. if self.MODE_PREVIEW == self.mode:
  2026. return True
  2027. return False
  2028. def OnPressEscapeKey(self):
  2029. self.Close()
  2030. return True
  2031. """
  2032. - ÇÁ·ÎÅäÄİ
  2033. °ÔÀÓµ¹ÀÔ½Ã:
  2034. RecvLandPacket:
  2035. CPythonMiniMap::RegisterGuildArea
  2036. °ÔÀÓÀ̵¿Áß:
  2037. PythonPlayer::Update()
  2038. CPythonPlayer::__Update_NotifyGuildAreaEvent()
  2039. game.py.BINARY_Guild_EnterGuildArea
  2040. uigameButton.GameButtonWindow.ShowBuildButton()
  2041. game.py.BINARY_Guild_ExitGuildArea
  2042. uigameButton.GameButtonWindow.HideBuildButton()
  2043. BuildButton:
  2044. !±æµåÀåÀÎÁö ó¸® ¾øÀ½
  2045. !°Ç¹°ÀÌ À־ Áş±â ¹öÆ°Àº ÀÖÀ½
  2046. !°Ç¹°ÀÌ Àӽ÷Π»ç¿ëÇÏ´Â VID ´Â ¼­¹ö°¡ º¸³»ÁÖ´Â °Í°ú È¥µ¿µÉ ¿°·Á°¡ ÀÖÀ½
  2047. !°Ç¹° VNUM Àº BuildGuildBuildingWindow.BUILDING_VNUM_LIST ¸¦ ÀÌ¿ëÇØ º¯È¯
  2048. !°Ç¹° ÁöÀ»¶§´Â /build c(reate)
  2049. !°Ç¹° ºÎ¼ú¶§´Â /build d(estroy)
  2050. !rotation ÀÇ ´ÜÀ§´Â degree
  2051. interfaceModule.interface.__OnClickBuildButton:
  2052. interfaceModule.interface.BUILD_OpenWindow:
  2053. AcceptButton:
  2054. BuildGuildBuildingWindow.Build:
  2055. net.SendChatPacket("/build c vnum x y x_rot y_rot z_rot")
  2056. PreviewButton:
  2057. __OnPreviewMode:
  2058. __RestoreViewMode:
  2059. °Ç¹° ºÎ¼ö±â:
  2060. uiTarget.TargetBoard.__OnDestroyBuilding
  2061. net.SendChatPacket("/build d vid")
  2062. """
  2063. if __name__ == "__main__":
  2064. import app
  2065. import wndMgr
  2066. import systemSetting
  2067. import mouseModule
  2068. import grp
  2069. import ui
  2070. #wndMgr.SetOutlineFlag(True)
  2071. app.SetMouseHandler(mouseModule.mouseController)
  2072. app.SetHairColorEnable(True)
  2073. wndMgr.SetMouseHandler(mouseModule.mouseController)
  2074. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2075. app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2076. mouseModule.mouseController.Create()
  2077. import chrmgr
  2078. chrmgr.CreateRace(0)
  2079. chrmgr.SelectRace(0)
  2080. chrmgr.SetPathName("d:/ymir Work/pc/warrior/")
  2081. chrmgr.LoadRaceData("warrior.msm")
  2082. chrmgr.SetPathName("d:/ymir work/pc/warrior/general/")
  2083. chrmgr.RegisterMotionMode(chr.MOTION_MODE_GENERAL)
  2084. chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_WAIT, "wait.msa")
  2085. chrmgr.RegisterMotionData(chr.MOTION_MODE_GENERAL, chr.MOTION_RUN, "run.msa")
  2086. def LoadGuildBuildingList(filename):
  2087. handle = app.OpenTextFile(filename)
  2088. count = app.GetTextFileLineCount(handle)
  2089. for i in xrange(count):
  2090. line = app.GetTextFileLine(handle, i)
  2091. tokens = line.split("\t")
  2092. TOKEN_VNUM = 0
  2093. TOKEN_TYPE = 1
  2094. TOKEN_NAME = 2
  2095. TOKEN_LOCAL_NAME = 3
  2096. NO_USE_TOKEN_SIZE_1 = 4
  2097. NO_USE_TOKEN_SIZE_2 = 5
  2098. NO_USE_TOKEN_SIZE_3 = 6
  2099. NO_USE_TOKEN_SIZE_4 = 7
  2100. TOKEN_X_ROT_LIMIT = 8
  2101. TOKEN_Y_ROT_LIMIT = 9
  2102. TOKEN_Z_ROT_LIMIT = 10
  2103. TOKEN_PRICE = 11
  2104. TOKEN_MATERIAL = 12
  2105. TOKEN_NPC = 13
  2106. TOKEN_GROUP = 14
  2107. TOKEN_DEPEND_GROUP = 15
  2108. TOKEN_ENABLE_FLAG = 16
  2109. LIMIT_TOKEN_COUNT = 17
  2110. if not tokens[TOKEN_VNUM].isdigit():
  2111. continue
  2112. if not int(tokens[TOKEN_ENABLE_FLAG]):
  2113. continue
  2114. if len(tokens) < LIMIT_TOKEN_COUNT:
  2115. import dbg
  2116. dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), LIMIT_TOKEN_COUNT, line))
  2117. continue
  2118. ENABLE_FLAG_TYPE_NOT_USE = False
  2119. ENABLE_FLAG_TYPE_USE = True
  2120. ENABLE_FLAG_TYPE_USE_BUT_HIDE = 2
  2121. if ENABLE_FLAG_TYPE_NOT_USE == int(tokens[TOKEN_ENABLE_FLAG]):
  2122. continue
  2123. vnum = int(tokens[TOKEN_VNUM])
  2124. type = tokens[TOKEN_TYPE]
  2125. name = tokens[TOKEN_NAME]
  2126. localName = tokens[TOKEN_LOCAL_NAME]
  2127. xRotLimit = int(tokens[TOKEN_X_ROT_LIMIT])
  2128. yRotLimit = int(tokens[TOKEN_Y_ROT_LIMIT])
  2129. zRotLimit = int(tokens[TOKEN_Z_ROT_LIMIT])
  2130. price = tokens[TOKEN_PRICE]
  2131. material = tokens[TOKEN_MATERIAL]
  2132. folderName = ""
  2133. if "HEADQUARTER" == type:
  2134. folderName = "headquarter"
  2135. elif "FACILITY" == type:
  2136. folderName = "facility"
  2137. elif "OBJECT" == type:
  2138. folderName = "object"
  2139. ##"BuildIn" Is made by exist instance.
  2140. materialList = ["0", "0", "0"]
  2141. if material[0] == "\"":
  2142. material = material[1:]
  2143. if material[-1] == "\"":
  2144. material = material[:-1]
  2145. for one in material.split("/"):
  2146. data = one.split(",")
  2147. if 2 != len(data):
  2148. continue
  2149. itemID = int(data[0])
  2150. count = data[1]
  2151. if itemID == MATERIAL_STONE_ID:
  2152. materialList[MATERIAL_STONE_INDEX] = count
  2153. elif itemID == MATERIAL_LOG_ID:
  2154. materialList[MATERIAL_LOG_INDEX] = count
  2155. elif itemID == MATERIAL_PLYWOOD_ID:
  2156. materialList[MATERIAL_PLYWOOD_INDEX] = count
  2157. import chrmgr
  2158. chrmgr.RegisterRaceSrcName(name, folderName)
  2159. chrmgr.RegisterRaceName(vnum, name)
  2160. appendingData = { "VNUM":vnum,
  2161. "TYPE":type,
  2162. "NAME":name,
  2163. "LOCAL_NAME":localName,
  2164. "X_ROT_LIMIT":xRotLimit,
  2165. "Y_ROT_LIMIT":yRotLimit,
  2166. "Z_ROT_LIMIT":zRotLimit,
  2167. "PRICE":price,
  2168. "MATERIAL":materialList,
  2169. "SHOW" : True }
  2170. if ENABLE_FLAG_TYPE_USE_BUT_HIDE == int(tokens[TOKEN_ENABLE_FLAG]):
  2171. appendingData["SHOW"] = False
  2172. BUILDING_DATA_LIST.append(appendingData)
  2173. app.CloseTextFile(handle)
  2174. LoadGuildBuildingList(app.GetLocalePath()+"/GuildBuildingList.txt")
  2175. class TestGame(ui.Window):
  2176. def __init__(self):
  2177. ui.Window.__init__(self)
  2178. x = 30000
  2179. y = 40000
  2180. self.wndGuildBuilding = None
  2181. self.onClickKeyDict = {}
  2182. self.onClickKeyDict[app.DIK_SPACE] = lambda: self.OpenBuildGuildBuildingWindow()
  2183. background.Initialize()
  2184. background.LoadMap("metin2_map_a1", x, y, 0)
  2185. background.SetShadowLevel(background.SHADOW_ALL)
  2186. self.MakeCharacter(1, 0, x, y)
  2187. player.SetMainCharacterIndex(1)
  2188. chr.SelectInstance(1)
  2189. def __del__(self):
  2190. ui.Window.__del__(self)
  2191. def MakeCharacter(self, index, race, x, y):
  2192. chr.CreateInstance(index)
  2193. chr.SelectInstance(index)
  2194. chr.SetVirtualID(index)
  2195. chr.SetInstanceType(chr.INSTANCE_TYPE_PLAYER)
  2196. chr.SetRace(race)
  2197. chr.SetArmor(0)
  2198. chr.SetHair(0)
  2199. chr.Refresh()
  2200. chr.SetMotionMode(chr.MOTION_MODE_GENERAL)
  2201. chr.SetLoopMotion(chr.MOTION_WAIT)
  2202. chr.SetPixelPosition(x, y)
  2203. chr.SetDirection(chr.DIR_NORTH)
  2204. def OpenBuildGuildBuildingWindow(self):
  2205. self.wndGuildBuilding = BuildGuildBuildingWindow()
  2206. self.wndGuildBuilding.Open()
  2207. self.wndGuildBuilding.SetParent(self)
  2208. self.wndGuildBuilding.SetTop()
  2209. def OnKeyUp(self, key):
  2210. if key in self.onClickKeyDict:
  2211. self.onClickKeyDict[key]()
  2212. return True
  2213. def OnMouseLeftButtonDown(self):
  2214. if self.wndGuildBuilding:
  2215. if self.wndGuildBuilding.IsPositioningMode():
  2216. self.wndGuildBuilding.SettleCurrentPosition()
  2217. return
  2218. player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
  2219. return True
  2220. def OnMouseLeftButtonUp(self):
  2221. if self.wndGuildBuilding:
  2222. return
  2223. player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
  2224. return True
  2225. def OnMouseRightButtonDown(self):
  2226. player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS);
  2227. return True
  2228. def OnMouseRightButtonUp(self):
  2229. player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK);
  2230. return True
  2231. def OnMouseMiddleButtonDown(self):
  2232. player.SetMouseMiddleButtonState(player.MBS_PRESS)
  2233. def OnMouseMiddleButtonUp(self):
  2234. player.SetMouseMiddleButtonState(player.MBS_CLICK)
  2235. def OnUpdate(self):
  2236. app.UpdateGame()
  2237. if self.wndGuildBuilding:
  2238. if self.wndGuildBuilding.IsPositioningMode():
  2239. x, y, z = background.GetPickingPoint()
  2240. self.wndGuildBuilding.SetBuildingPosition(x, y, z)
  2241. def OnRender(self):
  2242. app.RenderGame()
  2243. grp.PopState()
  2244. grp.SetInterfaceRenderState()
  2245. game = TestGame()
  2246. game.SetSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2247. game.Show()
  2248. wndGuildBuilding = BuildGuildBuildingWindow()
  2249. wndGuildBuilding.Open()
  2250. wndGuildBuilding.SetTop()
  2251. app.Loop()
  2252. """
  2253. - ÇÁ·ÎÅäÄİ
  2254. °ÔÀÓµ¹ÀÔ½Ã:
  2255. RecvLandPacket:
  2256. CPythonMiniMap::RegisterGuildArea
  2257. °ÔÀÓÀ̵¿Áß:
  2258. PythonPlayer::Update()
  2259. CPythonPlayer::__Update_NotifyGuildAreaEvent()
  2260. game.py.BINARY_Guild_EnterGuildArea
  2261. uigameButton.GameButtonWindow.ShowBuildButton()
  2262. game.py.BINARY_Guild_ExitGuildArea
  2263. uigameButton.GameButtonWindow.HideBuildButton()
  2264. BuildButton:
  2265. !±æµåÀåÀÎÁö ó¸® ¾øÀ½
  2266. !°Ç¹°ÀÌ À־ Áş±â ¹öÆ°Àº ÀÖÀ½
  2267. !°Ç¹°ÀÌ Àӽ÷Π»ç¿ëÇÏ´Â VID ´Â ¼­¹ö°¡ º¸³»ÁÖ´Â °Í°ú È¥µ¿µÉ ¿°·Á°¡ ÀÖÀ½
  2268. !°Ç¹° VNUM Àº BuildGuildBuildingWindow.BUILDING_VNUM_LIST ¸¦ ÀÌ¿ëÇØ º¯È¯
  2269. !°Ç¹° ÁöÀ»¶§´Â /build c(reate)
  2270. !°Ç¹° ºÎ¼ú¶§´Â /build d(estroy)
  2271. !rotation ÀÇ ´ÜÀ§´Â degree
  2272. interfaceModule.interface.__OnClickBuildButton:
  2273. interfaceModule.interface.BUILD_OpenWindow:
  2274. AcceptButton:
  2275. BuildGuildBuildingWindow.Build:
  2276. net.SendChatPacket("/build c vnum x y x_rot y_rot z_rot")
  2277. x_rot, y_rot ´Â AffectContainer¿¡ ÀúÀå
  2278. PreviewButton:
  2279. __OnPreviewMode:
  2280. __RestoreViewMode:
  2281. °Ç¹° ºÎ¼ö±â:
  2282. uiTarget.TargetBoard.__OnDestroyBuilding
  2283. net.SendChatPacket("/build d vid")
  2284. """

uiguild.py