Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 78.48 KB | None | 0 0
  1. import dbg
  2. import player
  3. import item
  4. import grp
  5. import wndMgr
  6. import skill
  7. import shop
  8. import exchange
  9. import grpText
  10. import safebox
  11. import localeInfo
  12. import app
  13. import background
  14. import nonplayer
  15. import chr
  16.  
  17. import ui
  18. import mouseModule
  19. import constInfo
  20.  
  21. WARP_SCROLLS = [22011, 22000, 22010]
  22.  
  23. DESC_DEFAULT_MAX_COLS = 26
  24. DESC_WESTERN_MAX_COLS = 35
  25. DESC_WESTERN_MAX_WIDTH = 220
  26.  
  27. def chop(n):
  28. return round(n - 0.5, 1)
  29.  
  30. def SplitDescription(desc, limit):
  31. total_tokens = desc.split()
  32. line_tokens = []
  33. line_len = 0
  34. lines = []
  35. for token in total_tokens:
  36. if "|" in token:
  37. sep_pos = token.find("|")
  38. line_tokens.append(token[:sep_pos])
  39.  
  40. lines.append(" ".join(line_tokens))
  41. line_len = len(token) - (sep_pos + 1)
  42. line_tokens = [token[sep_pos+1:]]
  43. else:
  44. line_len += len(token)
  45. if len(line_tokens) + line_len > limit:
  46. lines.append(" ".join(line_tokens))
  47. line_len = len(token)
  48. line_tokens = [token]
  49. else:
  50. line_tokens.append(token)
  51.  
  52. if line_tokens:
  53. lines.append(" ".join(line_tokens))
  54.  
  55. return lines
  56.  
  57. ###################################################################################################
  58. ## ToolTip
  59. ##
  60. ## NOTE : 현재는 Item과 Skill을 상속으로 특화 시켜두었음
  61. ## 하지만 그다지 의미가 없어 보임
  62. ##
  63. class ToolTip(ui.ThinBoard):
  64.  
  65. TOOL_TIP_WIDTH = 190
  66. TOOL_TIP_HEIGHT = 10
  67.  
  68. TEXT_LINE_HEIGHT = 17
  69.  
  70. TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
  71. SPECIAL_TITLE_COLOR = grp.GenerateColor(1.0, 0.7843, 0.0, 1.0)
  72. NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  73. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  74. PRICE_COLOR = 0xffFFB96D
  75.  
  76. HIGH_PRICE_COLOR = SPECIAL_TITLE_COLOR
  77. MIDDLE_PRICE_COLOR = grp.GenerateColor(0.85, 0.85, 0.85, 1.0)
  78. LOW_PRICE_COLOR = grp.GenerateColor(0.7, 0.7, 0.7, 1.0)
  79.  
  80. ENABLE_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  81. DISABLE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  82.  
  83. NEGATIVE_COLOR = grp.GenerateColor(0.9, 0.4745, 0.4627, 1.0)
  84. POSITIVE_COLOR = grp.GenerateColor(0.5411, 0.7254, 0.5568, 1.0)
  85. SPECIAL_POSITIVE_COLOR = grp.GenerateColor(0.6911, 0.8754, 0.7068, 1.0)
  86. SPECIAL_POSITIVE_COLOR2 = grp.GenerateColor(0.8824, 0.9804, 0.8824, 1.0)
  87. BIGGEST_VALUE_COLOR = grp.GenerateColor(0.44, 0.63, 0.15, 1.0)
  88.  
  89. CONDITION_COLOR = 0xffBEB47D
  90. CAN_LEVEL_UP_COLOR = 0xff8EC292
  91. CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
  92. NEED_SKILL_POINT_COLOR = 0xff9A9CDB
  93.  
  94. def __init__(self, width = TOOL_TIP_WIDTH, isPickable=False):
  95. ui.ThinBoard.__init__(self, "TOP_MOST")
  96.  
  97. if isPickable:
  98. pass
  99. else:
  100. self.AddFlag("not_pick")
  101.  
  102. self.AddFlag("float")
  103.  
  104. self.followFlag = True
  105. self.toolTipWidth = width
  106.  
  107. self.xPos = -1
  108. self.yPos = -1
  109.  
  110. self.defFontName = localeInfo.UI_DEF_FONT
  111. self.ClearToolTip()
  112.  
  113. def __del__(self):
  114. ui.ThinBoard.__del__(self)
  115.  
  116. def ClearToolTip(self):
  117. self.toolTipHeight = 12
  118. self.childrenList = []
  119.  
  120. def SetFollow(self, flag):
  121. self.followFlag = flag
  122.  
  123. def SetDefaultFontName(self, fontName):
  124. self.defFontName = fontName
  125.  
  126. def AppendSpace(self, size):
  127. self.toolTipHeight += size
  128. self.ResizeToolTip()
  129.  
  130. def AppendHorizontalLine(self):
  131.  
  132. for i in xrange(2):
  133. horizontalLine = ui.Line()
  134. horizontalLine.SetParent(self)
  135. horizontalLine.SetPosition(0, self.toolTipHeight + 3 + i)
  136. horizontalLine.SetWindowHorizontalAlignCenter()
  137. horizontalLine.SetSize(150, 0)
  138. horizontalLine.Show()
  139.  
  140. if 0 == i:
  141. horizontalLine.SetColor(0xff555555)
  142. else:
  143. horizontalLine.SetColor(0xff000000)
  144.  
  145. self.childrenList.append(horizontalLine)
  146.  
  147. self.toolTipHeight += 11
  148. self.ResizeToolTip()
  149.  
  150. def AlignHorizonalCenter(self):
  151. for child in self.childrenList:
  152. (x, y)=child.GetLocalPosition()
  153. child.SetPosition(self.toolTipWidth/2, y)
  154.  
  155. self.ResizeToolTip()
  156.  
  157. def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  158. textLine = ui.TextLine()
  159. textLine.SetParent(self)
  160. textLine.SetFontName(self.defFontName)
  161. textLine.SetPackedFontColor(color)
  162. textLine.SetText(text)
  163. textLine.SetOutline()
  164. textLine.SetFeather(False)
  165. textLine.Show()
  166.  
  167. if centerAlign:
  168. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  169. textLine.SetHorizontalAlignCenter()
  170.  
  171. else:
  172. textLine.SetPosition(10, self.toolTipHeight)
  173.  
  174. self.childrenList.append(textLine)
  175.  
  176. (textWidth, textHeight)=textLine.GetTextSize()
  177.  
  178. textWidth += 40
  179. textHeight += 5
  180.  
  181. if self.toolTipWidth < textWidth:
  182. self.toolTipWidth = textWidth
  183.  
  184. self.toolTipHeight += textHeight
  185.  
  186. return textLine
  187.  
  188. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  189. textLine = ui.TextLine()
  190. textLine.SetParent(self)
  191. textLine.SetFontName(self.defFontName)
  192. textLine.SetPackedFontColor(color)
  193. textLine.SetText(text)
  194. textLine.SetOutline()
  195. textLine.SetFeather(False)
  196. textLine.Show()
  197.  
  198. if centerAlign:
  199. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  200. textLine.SetHorizontalAlignCenter()
  201.  
  202. else:
  203. textLine.SetPosition(10, self.toolTipHeight)
  204.  
  205. self.childrenList.append(textLine)
  206.  
  207. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  208. self.ResizeToolTip()
  209.  
  210. return textLine
  211.  
  212. def AppendDescription(self, desc, limit, color = FONT_COLOR):
  213. if localeInfo.IsEUROPE():
  214. self.__AppendDescription_WesternLanguage(desc, color)
  215. else:
  216. self.__AppendDescription_EasternLanguage(desc, limit, color)
  217.  
  218. def __AppendDescription_EasternLanguage(self, description, characterLimitation, color=FONT_COLOR):
  219. length = len(description)
  220. if 0 == length:
  221. return
  222.  
  223. lineCount = grpText.GetSplitingTextLineCount(description, characterLimitation)
  224. for i in xrange(lineCount):
  225. if 0 == i:
  226. self.AppendSpace(5)
  227. self.AppendTextLine(grpText.GetSplitingTextLine(description, characterLimitation, i), color)
  228.  
  229. def __AppendDescription_WesternLanguage(self, desc, color=FONT_COLOR):
  230. lines = SplitDescription(desc, DESC_WESTERN_MAX_COLS)
  231. if not lines:
  232. return
  233.  
  234. self.AppendSpace(5)
  235. for line in lines:
  236. self.AppendTextLine(line, color)
  237.  
  238.  
  239. def ResizeToolTip(self):
  240. self.SetSize(self.toolTipWidth, self.TOOL_TIP_HEIGHT + self.toolTipHeight)
  241.  
  242. def SetTitle(self, name):
  243. self.AppendTextLine(name, self.TITLE_COLOR)
  244.  
  245. def GetLimitTextLineColor(self, curValue, limitValue):
  246. if curValue < limitValue:
  247. return self.DISABLE_COLOR
  248.  
  249. return self.ENABLE_COLOR
  250.  
  251. def GetChangeTextLineColor(self, value, isSpecial=False):
  252. if value > 0:
  253. if isSpecial:
  254. return self.SPECIAL_POSITIVE_COLOR
  255. else:
  256. return self.POSITIVE_COLOR
  257.  
  258. if 0 == value:
  259. return self.NORMAL_COLOR
  260.  
  261. return self.NEGATIVE_COLOR
  262.  
  263. def SetToolTipPosition(self, x = -1, y = -1):
  264. self.xPos = x
  265. self.yPos = y
  266.  
  267. def ShowToolTip(self):
  268. self.SetTop()
  269. self.Show()
  270.  
  271. self.OnUpdate()
  272.  
  273. def HideToolTip(self):
  274. self.Hide()
  275.  
  276. def OnUpdate(self):
  277.  
  278. if not self.followFlag:
  279. return
  280.  
  281. x = 0
  282. y = 0
  283. width = self.GetWidth()
  284. height = self.toolTipHeight
  285.  
  286. if -1 == self.xPos and -1 == self.yPos:
  287.  
  288. (mouseX, mouseY) = wndMgr.GetMousePosition()
  289.  
  290. if mouseY < wndMgr.GetScreenHeight() - 300:
  291. y = mouseY + 40
  292. else:
  293. y = mouseY - height - 30
  294.  
  295. x = mouseX - width/2
  296.  
  297. else:
  298.  
  299. x = self.xPos - width/2
  300. y = self.yPos - height
  301.  
  302. x = max(x, 0)
  303. y = max(y, 0)
  304. x = min(x + width/2, wndMgr.GetScreenWidth() - width/2) - width/2
  305. y = min(y + self.GetHeight(), wndMgr.GetScreenHeight()) - self.GetHeight()
  306.  
  307. parentWindow = self.GetParentProxy()
  308. if parentWindow:
  309. (gx, gy) = parentWindow.GetGlobalPosition()
  310. x -= gx
  311. y -= gy
  312.  
  313. self.SetPosition(x, y)
  314.  
  315. class ItemToolTip(ToolTip):
  316.  
  317. CHARACTER_NAMES = (
  318. localeInfo.TOOLTIP_WARRIOR,
  319. localeInfo.TOOLTIP_ASSASSIN,
  320. localeInfo.TOOLTIP_SURA,
  321. localeInfo.TOOLTIP_SHAMAN
  322. )
  323.  
  324. CHARACTER_COUNT = len(CHARACTER_NAMES)
  325. WEAR_NAMES = (
  326. localeInfo.TOOLTIP_ARMOR,
  327. localeInfo.TOOLTIP_HELMET,
  328. localeInfo.TOOLTIP_SHOES,
  329. localeInfo.TOOLTIP_WRISTLET,
  330. localeInfo.TOOLTIP_WEAPON,
  331. localeInfo.TOOLTIP_NECK,
  332. localeInfo.TOOLTIP_EAR,
  333. localeInfo.TOOLTIP_UNIQUE,
  334. localeInfo.TOOLTIP_SHIELD,
  335. localeInfo.TOOLTIP_ARROW,
  336. )
  337. WEAR_COUNT = len(WEAR_NAMES)
  338.  
  339. AFFECT_DICT = {
  340. item.APPLY_MAX_HP : localeInfo.TOOLTIP_MAX_HP,
  341. item.APPLY_MAX_SP : localeInfo.TOOLTIP_MAX_SP,
  342. item.APPLY_CON : localeInfo.TOOLTIP_CON,
  343. item.APPLY_INT : localeInfo.TOOLTIP_INT,
  344. item.APPLY_STR : localeInfo.TOOLTIP_STR,
  345. item.APPLY_DEX : localeInfo.TOOLTIP_DEX,
  346. item.APPLY_ATT_SPEED : localeInfo.TOOLTIP_ATT_SPEED,
  347. item.APPLY_MOV_SPEED : localeInfo.TOOLTIP_MOV_SPEED,
  348. item.APPLY_CAST_SPEED : localeInfo.TOOLTIP_CAST_SPEED,
  349. item.APPLY_HP_REGEN : localeInfo.TOOLTIP_HP_REGEN,
  350. item.APPLY_SP_REGEN : localeInfo.TOOLTIP_SP_REGEN,
  351. item.APPLY_POISON_PCT : localeInfo.TOOLTIP_APPLY_POISON_PCT,
  352. item.APPLY_STUN_PCT : localeInfo.TOOLTIP_APPLY_STUN_PCT,
  353. item.APPLY_SLOW_PCT : localeInfo.TOOLTIP_APPLY_SLOW_PCT,
  354. item.APPLY_CRITICAL_PCT : localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,
  355. item.APPLY_PENETRATE_PCT : localeInfo.TOOLTIP_APPLY_PENETRATE_PCT,
  356.  
  357. item.APPLY_ATTBONUS_WARRIOR : localeInfo.TOOLTIP_APPLY_ATTBONUS_WARRIOR,
  358. item.APPLY_ATTBONUS_ASSASSIN : localeInfo.TOOLTIP_APPLY_ATTBONUS_ASSASSIN,
  359. item.APPLY_ATTBONUS_SURA : localeInfo.TOOLTIP_APPLY_ATTBONUS_SURA,
  360. item.APPLY_ATTBONUS_SHAMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_SHAMAN,
  361. item.APPLY_ATTBONUS_MONSTER : localeInfo.TOOLTIP_APPLY_ATTBONUS_MONSTER,
  362.  
  363. item.APPLY_ATTBONUS_HUMAN : localeInfo.TOOLTIP_APPLY_ATTBONUS_HUMAN,
  364. item.APPLY_ATTBONUS_ANIMAL : localeInfo.TOOLTIP_APPLY_ATTBONUS_ANIMAL,
  365. item.APPLY_ATTBONUS_ORC : localeInfo.TOOLTIP_APPLY_ATTBONUS_ORC,
  366. item.APPLY_ATTBONUS_MILGYO : localeInfo.TOOLTIP_APPLY_ATTBONUS_MILGYO,
  367. item.APPLY_ATTBONUS_UNDEAD : localeInfo.TOOLTIP_APPLY_ATTBONUS_UNDEAD,
  368. item.APPLY_ATTBONUS_DEVIL : localeInfo.TOOLTIP_APPLY_ATTBONUS_DEVIL,
  369. item.APPLY_STEAL_HP : localeInfo.TOOLTIP_APPLY_STEAL_HP,
  370. item.APPLY_STEAL_SP : localeInfo.TOOLTIP_APPLY_STEAL_SP,
  371. item.APPLY_MANA_BURN_PCT : localeInfo.TOOLTIP_APPLY_MANA_BURN_PCT,
  372. item.APPLY_DAMAGE_SP_RECOVER : localeInfo.TOOLTIP_APPLY_DAMAGE_SP_RECOVER,
  373. item.APPLY_BLOCK : localeInfo.TOOLTIP_APPLY_BLOCK,
  374. item.APPLY_DODGE : localeInfo.TOOLTIP_APPLY_DODGE,
  375. item.APPLY_RESIST_SWORD : localeInfo.TOOLTIP_APPLY_RESIST_SWORD,
  376. item.APPLY_RESIST_TWOHAND : localeInfo.TOOLTIP_APPLY_RESIST_TWOHAND,
  377. item.APPLY_RESIST_DAGGER : localeInfo.TOOLTIP_APPLY_RESIST_DAGGER,
  378. item.APPLY_RESIST_BELL : localeInfo.TOOLTIP_APPLY_RESIST_BELL,
  379. item.APPLY_RESIST_FAN : localeInfo.TOOLTIP_APPLY_RESIST_FAN,
  380. item.APPLY_RESIST_BOW : localeInfo.TOOLTIP_RESIST_BOW,
  381. item.APPLY_RESIST_FIRE : localeInfo.TOOLTIP_RESIST_FIRE,
  382. item.APPLY_RESIST_ELEC : localeInfo.TOOLTIP_RESIST_ELEC,
  383. item.APPLY_RESIST_MAGIC : localeInfo.TOOLTIP_RESIST_MAGIC,
  384. item.APPLY_RESIST_WIND : localeInfo.TOOLTIP_APPLY_RESIST_WIND,
  385. item.APPLY_REFLECT_MELEE : localeInfo.TOOLTIP_APPLY_REFLECT_MELEE,
  386. item.APPLY_REFLECT_CURSE : localeInfo.TOOLTIP_APPLY_REFLECT_CURSE,
  387. item.APPLY_POISON_REDUCE : localeInfo.TOOLTIP_APPLY_POISON_REDUCE,
  388. item.APPLY_KILL_SP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_SP_RECOVER,
  389. item.APPLY_EXP_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_EXP_DOUBLE_BONUS,
  390. item.APPLY_GOLD_DOUBLE_BONUS : localeInfo.TOOLTIP_APPLY_GOLD_DOUBLE_BONUS,
  391. item.APPLY_ITEM_DROP_BONUS : localeInfo.TOOLTIP_APPLY_ITEM_DROP_BONUS,
  392. item.APPLY_POTION_BONUS : localeInfo.TOOLTIP_APPLY_POTION_BONUS,
  393. item.APPLY_KILL_HP_RECOVER : localeInfo.TOOLTIP_APPLY_KILL_HP_RECOVER,
  394. item.APPLY_IMMUNE_STUN : localeInfo.TOOLTIP_APPLY_IMMUNE_STUN,
  395. item.APPLY_IMMUNE_SLOW : localeInfo.TOOLTIP_APPLY_IMMUNE_SLOW,
  396. item.APPLY_IMMUNE_FALL : localeInfo.TOOLTIP_APPLY_IMMUNE_FALL,
  397. item.APPLY_BOW_DISTANCE : localeInfo.TOOLTIP_BOW_DISTANCE,
  398. item.APPLY_DEF_GRADE_BONUS : localeInfo.TOOLTIP_DEF_GRADE,
  399. item.APPLY_ATT_GRADE_BONUS : localeInfo.TOOLTIP_ATT_GRADE,
  400. item.APPLY_MAGIC_ATT_GRADE : localeInfo.TOOLTIP_MAGIC_ATT_GRADE,
  401. item.APPLY_MAGIC_DEF_GRADE : localeInfo.TOOLTIP_MAGIC_DEF_GRADE,
  402. item.APPLY_MAX_STAMINA : localeInfo.TOOLTIP_MAX_STAMINA,
  403. item.APPLY_MALL_ATTBONUS : localeInfo.TOOLTIP_MALL_ATTBONUS,
  404. item.APPLY_MALL_DEFBONUS : localeInfo.TOOLTIP_MALL_DEFBONUS,
  405. item.APPLY_MALL_EXPBONUS : localeInfo.TOOLTIP_MALL_EXPBONUS,
  406. item.APPLY_MALL_ITEMBONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS,
  407. item.APPLY_MALL_GOLDBONUS : localeInfo.TOOLTIP_MALL_GOLDBONUS,
  408. item.APPLY_SKILL_DAMAGE_BONUS : localeInfo.TOOLTIP_SKILL_DAMAGE_BONUS,
  409. item.APPLY_NORMAL_HIT_DAMAGE_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DAMAGE_BONUS,
  410. item.APPLY_SKILL_DEFEND_BONUS : localeInfo.TOOLTIP_SKILL_DEFEND_BONUS,
  411. item.APPLY_NORMAL_HIT_DEFEND_BONUS : localeInfo.TOOLTIP_NORMAL_HIT_DEFEND_BONUS,
  412. item.APPLY_PC_BANG_EXP_BONUS : localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC,
  413. item.APPLY_PC_BANG_DROP_BONUS : localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC,
  414. item.APPLY_RESIST_WARRIOR : localeInfo.TOOLTIP_APPLY_RESIST_WARRIOR,
  415. item.APPLY_RESIST_ASSASSIN : localeInfo.TOOLTIP_APPLY_RESIST_ASSASSIN,
  416. item.APPLY_RESIST_SURA : localeInfo.TOOLTIP_APPLY_RESIST_SURA,
  417. item.APPLY_RESIST_SHAMAN : localeInfo.TOOLTIP_APPLY_RESIST_SHAMAN,
  418. item.APPLY_MAX_HP_PCT : localeInfo.TOOLTIP_APPLY_MAX_HP_PCT,
  419. item.APPLY_MAX_SP_PCT : localeInfo.TOOLTIP_APPLY_MAX_SP_PCT,
  420. item.APPLY_ENERGY : localeInfo.TOOLTIP_ENERGY,
  421. item.APPLY_COSTUME_ATTR_BONUS : localeInfo.TOOLTIP_COSTUME_ATTR_BONUS,
  422.  
  423. item.APPLY_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MAGIC_ATTBONUS_PER,
  424. item.APPLY_MELEE_MAGIC_ATTBONUS_PER : localeInfo.TOOLTIP_MELEE_MAGIC_ATTBONUS_PER,
  425. item.APPLY_RESIST_ICE : localeInfo.TOOLTIP_RESIST_ICE,
  426. item.APPLY_RESIST_EARTH : localeInfo.TOOLTIP_RESIST_EARTH,
  427. item.APPLY_RESIST_DARK : localeInfo.TOOLTIP_RESIST_DARK,
  428. item.APPLY_ANTI_CRITICAL_PCT : localeInfo.TOOLTIP_ANTI_CRITICAL_PCT,
  429. item.APPLY_ANTI_PENETRATE_PCT : localeInfo.TOOLTIP_ANTI_PENETRATE_PCT,
  430. }
  431.  
  432. ATTRIBUTE_NEED_WIDTH = {
  433. 23 : 230,
  434. 24 : 230,
  435. 25 : 230,
  436. 26 : 220,
  437. 27 : 210,
  438.  
  439. 35 : 210,
  440. 36 : 210,
  441. 37 : 210,
  442. 38 : 210,
  443. 39 : 210,
  444. 40 : 210,
  445. 41 : 210,
  446.  
  447. 42 : 220,
  448. 43 : 230,
  449. 45 : 230,
  450. }
  451.  
  452. ANTI_FLAG_DICT = {
  453. 0 : item.ITEM_ANTIFLAG_WARRIOR,
  454. 1 : item.ITEM_ANTIFLAG_ASSASSIN,
  455. 2 : item.ITEM_ANTIFLAG_SURA,
  456. 3 : item.ITEM_ANTIFLAG_SHAMAN,
  457. }
  458.  
  459. FONT_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
  460.  
  461. def __init__(self, *args, **kwargs):
  462. ToolTip.__init__(self, *args, **kwargs)
  463. self.itemVnum = 0
  464. self.isShopItem = False
  465.  
  466. # 아이템 툴팁을 표시할 때 현재 캐릭터가 착용할 수 없는 아이템이라면 강제로 Disable Color로 설정 (이미 그렇게 작동하고 있으나 꺼야 할 필요가 있어서)
  467. self.bCannotUseItemForceSetDisableColor = True
  468.  
  469. def __del__(self):
  470. ToolTip.__del__(self)
  471.  
  472. def SetCannotUseItemForceSetDisableColor(self, enable):
  473. self.bCannotUseItemForceSetDisableColor = enable
  474.  
  475. def CanEquip(self):
  476. if not item.IsEquipmentVID(self.itemVnum):
  477. return True
  478.  
  479. race = player.GetRace()
  480. job = chr.RaceToJob(race)
  481. if not self.ANTI_FLAG_DICT.has_key(job):
  482. return False
  483.  
  484. if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
  485. return False
  486.  
  487. sex = chr.RaceToSex(race)
  488.  
  489. MALE = 1
  490. FEMALE = 0
  491.  
  492. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
  493. return False
  494.  
  495. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
  496. return False
  497.  
  498. for i in xrange(item.LIMIT_MAX_NUM):
  499. (limitType, limitValue) = item.GetLimit(i)
  500.  
  501. if item.LIMIT_LEVEL == limitType:
  502. if player.GetStatus(player.LEVEL) < limitValue:
  503. return False
  504. """
  505. elif item.LIMIT_STR == limitType:
  506. if player.GetStatus(player.ST) < limitValue:
  507. return False
  508. elif item.LIMIT_DEX == limitType:
  509. if player.GetStatus(player.DX) < limitValue:
  510. return False
  511. elif item.LIMIT_INT == limitType:
  512. if player.GetStatus(player.IQ) < limitValue:
  513. return False
  514. elif item.LIMIT_CON == limitType:
  515. if player.GetStatus(player.HT) < limitValue:
  516. return False
  517. """
  518.  
  519. return True
  520.  
  521. def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
  522. if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
  523. color = self.DISABLE_COLOR
  524.  
  525. return ToolTip.AppendTextLine(self, text, color, centerAlign)
  526.  
  527. def ClearToolTip(self):
  528. self.isShopItem = False
  529. self.toolTipWidth = self.TOOL_TIP_WIDTH
  530. ToolTip.ClearToolTip(self)
  531.  
  532. def SetInventoryItem(self, slotIndex, window_type = player.INVENTORY):
  533. itemVnum = player.GetItemIndex(window_type, slotIndex)
  534. if 0 == itemVnum:
  535. return
  536.  
  537. self.ClearToolTip()
  538. if shop.IsOpen():
  539. if not shop.IsPrivateShop():
  540. item.SelectItem(itemVnum)
  541. self.AppendSellingPrice(player.GetISellItemPrice(window_type, slotIndex))
  542.  
  543. metinSlot = [player.GetItemMetinSocket(window_type, slotIndex, i) for i in xrange(player.METIN_SOCKET_MAX_NUM)]
  544. attrSlot = [player.GetItemAttribute(window_type, slotIndex, i) for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM)]
  545.  
  546. self.AddItemData(itemVnum, metinSlot, attrSlot)
  547.  
  548. def SetShopItem(self, slotIndex):
  549. itemVnum = shop.GetItemID(slotIndex)
  550. if 0 == itemVnum:
  551. return
  552.  
  553. price = shop.GetItemPrice(slotIndex)
  554. self.ClearToolTip()
  555. self.isShopItem = True
  556.  
  557. metinSlot = []
  558. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  559. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  560. attrSlot = []
  561. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  562. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  563.  
  564. self.AddItemData(itemVnum, metinSlot, attrSlot)
  565. self.AppendPrice(price)
  566.  
  567. def SetShopItemBySecondaryCoin(self, slotIndex):
  568. itemVnum = shop.GetItemID(slotIndex)
  569. if 0 == itemVnum:
  570. return
  571.  
  572. price = shop.GetItemPrice(slotIndex)
  573. self.ClearToolTip()
  574. self.isShopItem = True
  575.  
  576. metinSlot = []
  577. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  578. metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
  579. attrSlot = []
  580. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  581. attrSlot.append(shop.GetItemAttribute(slotIndex, i))
  582.  
  583. self.AddItemData(itemVnum, metinSlot, attrSlot)
  584. self.AppendPriceBySecondaryCoin(price)
  585.  
  586. def SetExchangeOwnerItem(self, slotIndex):
  587. itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
  588. if 0 == itemVnum:
  589. return
  590.  
  591. self.ClearToolTip()
  592.  
  593. metinSlot = []
  594. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  595. metinSlot.append(exchange.GetItemMetinSocketFromSelf(slotIndex, i))
  596. attrSlot = []
  597. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  598. attrSlot.append(exchange.GetItemAttributeFromSelf(slotIndex, i))
  599. self.AddItemData(itemVnum, metinSlot, attrSlot)
  600.  
  601. def SetExchangeTargetItem(self, slotIndex):
  602. itemVnum = exchange.GetItemVnumFromTarget(slotIndex)
  603. if 0 == itemVnum:
  604. return
  605.  
  606. self.ClearToolTip()
  607.  
  608. metinSlot = []
  609. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  610. metinSlot.append(exchange.GetItemMetinSocketFromTarget(slotIndex, i))
  611. attrSlot = []
  612. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  613. attrSlot.append(exchange.GetItemAttributeFromTarget(slotIndex, i))
  614. self.AddItemData(itemVnum, metinSlot, attrSlot)
  615.  
  616. def SetPrivateShopBuilderItem(self, invenType, invenPos, privateShopSlotIndex):
  617. itemVnum = player.GetItemIndex(invenType, invenPos)
  618. if 0 == itemVnum:
  619. return
  620.  
  621. item.SelectItem(itemVnum)
  622. self.ClearToolTip()
  623. self.AppendSellingPrice(shop.GetPrivateShopItemPrice(invenType, invenPos))
  624.  
  625. metinSlot = []
  626. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  627. metinSlot.append(player.GetItemMetinSocket(invenPos, i))
  628. attrSlot = []
  629. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  630. attrSlot.append(player.GetItemAttribute(invenPos, i))
  631.  
  632. self.AddItemData(itemVnum, metinSlot, attrSlot)
  633.  
  634. def SetSafeBoxItem(self, slotIndex):
  635. itemVnum = safebox.GetItemID(slotIndex)
  636. if 0 == itemVnum:
  637. return
  638.  
  639. self.ClearToolTip()
  640. metinSlot = []
  641. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  642. metinSlot.append(safebox.GetItemMetinSocket(slotIndex, i))
  643. attrSlot = []
  644. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  645. attrSlot.append(safebox.GetItemAttribute(slotIndex, i))
  646.  
  647. self.AddItemData(itemVnum, metinSlot, attrSlot, safebox.GetItemFlags(slotIndex))
  648.  
  649. def SetMallItem(self, slotIndex):
  650. itemVnum = safebox.GetMallItemID(slotIndex)
  651. if 0 == itemVnum:
  652. return
  653.  
  654. self.ClearToolTip()
  655. metinSlot = []
  656. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  657. metinSlot.append(safebox.GetMallItemMetinSocket(slotIndex, i))
  658. attrSlot = []
  659. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  660. attrSlot.append(safebox.GetMallItemAttribute(slotIndex, i))
  661.  
  662. self.AddItemData(itemVnum, metinSlot, attrSlot)
  663.  
  664. def SetItemToolTip(self, itemVnum):
  665. self.ClearToolTip()
  666. metinSlot = []
  667. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  668. metinSlot.append(0)
  669. attrSlot = []
  670. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  671. attrSlot.append((0, 0))
  672.  
  673. self.AddItemData(itemVnum, metinSlot, attrSlot)
  674.  
  675. def __AppendAttackSpeedInfo(self, item):
  676. atkSpd = item.GetValue(0)
  677.  
  678. if atkSpd < 80:
  679. stSpd = localeInfo.TOOLTIP_ITEM_VERY_FAST
  680. elif atkSpd <= 95:
  681. stSpd = localeInfo.TOOLTIP_ITEM_FAST
  682. elif atkSpd <= 105:
  683. stSpd = localeInfo.TOOLTIP_ITEM_NORMAL
  684. elif atkSpd <= 120:
  685. stSpd = localeInfo.TOOLTIP_ITEM_SLOW
  686. else:
  687. stSpd = localeInfo.TOOLTIP_ITEM_VERY_SLOW
  688.  
  689. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_SPEED % stSpd, self.NORMAL_COLOR)
  690.  
  691. def __AppendAttackGradeInfo(self):
  692. atkGrade = item.GetValue(1)
  693. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_GRADE % atkGrade, self.GetChangeTextLineColor(atkGrade))
  694.  
  695. def __AppendAttackPowerInfo(self):
  696. minPower = item.GetValue(3)
  697. maxPower = item.GetValue(4)
  698. addPower = item.GetValue(5)
  699. if maxPower > minPower:
  700. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER % (minPower+addPower, maxPower+addPower), self.POSITIVE_COLOR)
  701. else:
  702. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_ATT_POWER_ONE_ARG % (minPower+addPower), self.POSITIVE_COLOR)
  703.  
  704. def __AppendMagicAttackInfo(self):
  705. minMagicAttackPower = item.GetValue(1)
  706. maxMagicAttackPower = item.GetValue(2)
  707. addPower = item.GetValue(5)
  708.  
  709. if minMagicAttackPower > 0 or maxMagicAttackPower > 0:
  710. if maxMagicAttackPower > minMagicAttackPower:
  711. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER % (minMagicAttackPower+addPower, maxMagicAttackPower+addPower), self.POSITIVE_COLOR)
  712. else:
  713. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_ATT_POWER_ONE_ARG % (minMagicAttackPower+addPower), self.POSITIVE_COLOR)
  714.  
  715. def __AppendMagicDefenceInfo(self):
  716. magicDefencePower = item.GetValue(0)
  717.  
  718. if magicDefencePower > 0:
  719. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_MAGIC_DEF_POWER % magicDefencePower, self.GetChangeTextLineColor(magicDefencePower))
  720.  
  721. def __AppendAttributeInformation(self, attrSlot):
  722. if 0 != attrSlot:
  723.  
  724. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  725. type = attrSlot[i][0]
  726. value = attrSlot[i][1]
  727.  
  728. if 0 == value:
  729. continue
  730.  
  731. affectString = self.__GetAffectString(type, value)
  732. if affectString:
  733. affectColor = self.__GetAttributeColor(i, value, type)
  734. self.AppendTextLine(affectString, affectColor)
  735.  
  736. # def __GetAttributeColor(self, index, value):
  737. # if value > 0:
  738. # if index >= 5:
  739. # return self.SPECIAL_POSITIVE_COLOR2
  740. # else:
  741. # return self.SPECIAL_POSITIVE_COLOR
  742. # elif value == 0:
  743. # return self.NORMAL_COLOR
  744. # else:
  745. # return self.NEGATIVE_COLOR
  746.  
  747. def __GetAttributeColor(self, index, value, id):
  748. max_values = {
  749. 1 : 2000,
  750. 2 : 80,
  751. 3 : 12,
  752. 4 : 12,
  753. 5 : 12,
  754. 6 : 12,
  755. 7 : 8,
  756. 8 : 20,
  757. 9 : 20,
  758. 10 : 30,
  759. 11 : 30,
  760. 12 : 8,
  761. 13 : 8,
  762. 14 : 8,
  763. 15 : 10,
  764. 16 : 10,
  765. 17 : 10,
  766. 18 : 20,
  767. 19 : 20,
  768. 20 : 20,
  769. 21 : 20,
  770. 22 : 20,
  771. 23 : 10,
  772. 24 : 10,
  773. 25 : 10,
  774. 26 : 15,
  775. 27 : 15,
  776. 28 : 15,
  777. 29 : 15,
  778. 30 : 15,
  779. 31 : 15,
  780. 32 : 15,
  781. 33 : 15,
  782. 34 : 15,
  783. 35 : 15,
  784. 36 : 15,
  785. 37 : 15,
  786. 38 : 15,
  787. 39 : 15,
  788. 40 : 999,
  789. 41 : 5,
  790. 42 : 999,
  791. 43 : 20,
  792. 44 : 20,
  793. 45 : 20,
  794. 46 : 999,
  795. 47 : 999,
  796. 48 : 1,
  797. 49 : 1,
  798. 50 : 1,
  799. 51 : 999,
  800. 52 : 999,
  801. 53 : 50,
  802. 54 : 999,
  803. 55 : 999,
  804. 56 : 999,
  805. 57 : 999,
  806. 58 : 999,
  807. 59 : 999,
  808. 60 : 999,
  809. 61 : 999,
  810. 62 : 999,
  811. 63 : 999,
  812. 64 : 999,
  813. 65 : 999,
  814. 66 : 999,
  815. 67 : 999,
  816. 68 : 999,
  817. 69 : 999,
  818. 70 : 999,
  819. 71 : 999,
  820. 72 : 999,
  821. 73 : 999,
  822. 74 : 999,
  823. 75 : 999,
  824. 76 : 999,
  825. 77 : 999,
  826. 78 : 999,
  827. 79 : 999,
  828. 80 : 999,
  829. 81 : 999,
  830. 82 : 999,
  831. 83 : 999,
  832. 84 : 999,
  833. 85 : 999,
  834. 86 : 999,
  835. 87 : 999,
  836. 88 : 999,
  837. 89 : 999,
  838. 90 : 999,
  839. 91 : 999,}
  840.  
  841. if value == 0:
  842. return self.NORMAL_COLOR
  843. elif value > 0:
  844. if value == max_values[id]:
  845. return self.BIGGEST_VALUE_COLOR
  846. else:
  847. if index >= 5:
  848. return self.SPECIAL_POSITIVE_COLOR2
  849. else:
  850. return self.SPECIAL_POSITIVE_COLOR
  851. else:
  852. return self.NEGATIVE_COLOR
  853.  
  854.  
  855. def __IsPolymorphItem(self, itemVnum):
  856. if itemVnum >= 70103 and itemVnum <= 70106:
  857. return 1
  858. return 0
  859.  
  860. def __SetPolymorphItemTitle(self, monsterVnum):
  861. if localeInfo.IsVIETNAM():
  862. itemName =item.GetItemName()
  863. itemName+=" "
  864. itemName+=nonplayer.GetMonsterName(monsterVnum)
  865. else:
  866. itemName =nonplayer.GetMonsterName(monsterVnum)
  867. itemName+=" "
  868. itemName+=item.GetItemName()
  869. self.SetTitle(itemName)
  870.  
  871. def __SetNormalItemTitle(self):
  872. self.SetTitle(item.GetItemName())
  873.  
  874. def __SetSpecialItemTitle(self):
  875. self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)
  876.  
  877. def __SetItemTitle(self, itemVnum, metinSlot, attrSlot):
  878. if localeInfo.IsCANADA():
  879. if 72726 == itemVnum or 72730 == itemVnum:
  880. self.AppendTextLine(item.GetItemName(), grp.GenerateColor(1.0, 0.7843, 0.0, 1.0))
  881. return
  882.  
  883. if self.__IsPolymorphItem(itemVnum):
  884. self.__SetPolymorphItemTitle(metinSlot[0])
  885. else:
  886. if self.__IsAttr(attrSlot):
  887. self.__SetSpecialItemTitle()
  888. return
  889.  
  890. self.__SetNormalItemTitle()
  891.  
  892. def __IsAttr(self, attrSlot):
  893. if not attrSlot:
  894. return False
  895.  
  896. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  897. type = attrSlot[i][0]
  898. if 0 != type:
  899. return True
  900.  
  901. return False
  902.  
  903. def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0):
  904. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  905. metinSlotData=metinSlot[i]
  906. if self.GetMetinItemIndex(metinSlotData) == constInfo.ERROR_METIN_STONE:
  907. metinSlot[i]=player.METIN_SOCKET_TYPE_SILVER
  908.  
  909. self.AddItemData(itemVnum, metinSlot, attrSlot)
  910.  
  911. def AddItemData_Offline(self, itemVnum, itemDesc, itemSummary, metinSlot, attrSlot):
  912. self.__AdjustMaxWidth(attrSlot, itemDesc)
  913. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  914.  
  915. if self.__IsHair(itemVnum):
  916. self.__AppendHairIcon(itemVnum)
  917.  
  918. ### Description ###
  919. self.AppendDescription(itemDesc, 26)
  920. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  921.  
  922. def AddItemData(self, itemVnum, metinSlot, attrSlot = 0, flags = 0, unbindTime = 0):
  923. self.itemVnum = itemVnum
  924. item.SelectItem(itemVnum)
  925. itemType = item.GetItemType()
  926. itemSubType = item.GetItemSubType()
  927.  
  928. if 50026 == itemVnum:
  929. if 0 != metinSlot:
  930. name = item.GetItemName()
  931. if metinSlot[0] > 0:
  932. name += " "
  933. name += localeInfo.NumberToMoneyString(metinSlot[0])
  934. self.SetTitle(name)
  935.  
  936. self.ShowToolTip()
  937. return
  938.  
  939. ### Skill Book ###
  940. elif 50300 == itemVnum:
  941. if 0 != metinSlot:
  942. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
  943.  
  944. self.ShowToolTip()
  945. return
  946. elif 70037 == itemVnum:
  947. if 0 != metinSlot:
  948. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  949. self.AppendDescription(item.GetItemDescription(), 26)
  950. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  951.  
  952. self.ShowToolTip()
  953. return
  954. elif 70055 == itemVnum:
  955. if 0 != metinSlot:
  956. self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
  957. self.AppendDescription(item.GetItemDescription(), 26)
  958. self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
  959.  
  960. self.ShowToolTip()
  961. return
  962. ###########################################################################################
  963.  
  964.  
  965. itemDesc = item.GetItemDescription()
  966. itemSummary = item.GetItemSummary()
  967.  
  968. isCostumeItem = 0
  969. isCostumeHair = 0
  970. isCostumeBody = 0
  971.  
  972. if app.ENABLE_COSTUME_SYSTEM:
  973. if item.ITEM_TYPE_COSTUME == itemType:
  974. isCostumeItem = 1
  975. isCostumeHair = item.COSTUME_TYPE_HAIR == itemSubType
  976. isCostumeBody = item.COSTUME_TYPE_BODY == itemSubType
  977.  
  978. #dbg.TraceError("IS_COSTUME_ITEM! body(%d) hair(%d)" % (isCostumeBody, isCostumeHair))
  979.  
  980. self.__AdjustMaxWidth(attrSlot, itemDesc)
  981. self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
  982.  
  983. ### Hair Preview Image ###
  984. if self.__IsHair(itemVnum):
  985. self.__AppendHairIcon(itemVnum)
  986.  
  987. ### Description ###
  988. self.AppendDescription(itemDesc, 26)
  989. self.AppendDescription(itemSummary, 26, self.CONDITION_COLOR)
  990.  
  991. ### Weapon ###
  992. if item.ITEM_TYPE_WEAPON == itemType:
  993.  
  994. self.__AppendLimitInformation()
  995.  
  996. self.AppendSpace(5)
  997.  
  998. ## 부채일 경우 마공을 먼저 표시한다.
  999. if item.WEAPON_FAN == itemSubType:
  1000. self.__AppendMagicAttackInfo()
  1001. self.__AppendAttackPowerInfo()
  1002.  
  1003. else:
  1004. self.__AppendAttackPowerInfo()
  1005. self.__AppendMagicAttackInfo()
  1006.  
  1007. self.__AppendAffectInformation()
  1008. self.__AppendAttributeInformation(attrSlot)
  1009.  
  1010. self.AppendWearableInformation()
  1011. self.__AppendMetinSlotInfo(metinSlot)
  1012.  
  1013. ### Armor ###
  1014. elif item.ITEM_TYPE_ARMOR == itemType:
  1015. self.__AppendLimitInformation()
  1016.  
  1017. ## 방어력
  1018. defGrade = item.GetValue(1)
  1019. defBonus = item.GetValue(5)*2 ## 방어력 표시 잘못 되는 문제를 수정
  1020. if defGrade > 0:
  1021. self.AppendSpace(5)
  1022. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade))
  1023.  
  1024. self.__AppendMagicDefenceInfo()
  1025. self.__AppendAffectInformation()
  1026. self.__AppendAttributeInformation(attrSlot)
  1027.  
  1028. self.AppendWearableInformation()
  1029.  
  1030. if itemSubType in (item.ARMOR_WRIST, item.ARMOR_NECK, item.ARMOR_EAR):
  1031. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_ACCESSORY_MATERIAL_VNUM(itemVnum, itemSubType))
  1032. else:
  1033. self.__AppendMetinSlotInfo(metinSlot)
  1034.  
  1035. ### Ring Slot Item (Not UNIQUE) ###
  1036. elif item.ITEM_TYPE_RING == itemType:
  1037. self.__AppendLimitInformation()
  1038. self.__AppendAffectInformation()
  1039. self.__AppendAttributeInformation(attrSlot)
  1040.  
  1041. #반지 소켓 시스템 관련해선 아직 기획 미정
  1042. #self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001)
  1043.  
  1044.  
  1045. ### Belt Item ###
  1046. elif item.ITEM_TYPE_BELT == itemType:
  1047. self.__AppendLimitInformation()
  1048. self.__AppendAffectInformation()
  1049. self.__AppendAttributeInformation(attrSlot)
  1050.  
  1051. self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
  1052.  
  1053. ## 코스츔 아이템 ##
  1054. elif 0 != isCostumeItem:
  1055. self.__AppendLimitInformation()
  1056. self.__AppendAffectInformation()
  1057. self.__AppendAttributeInformation(attrSlot)
  1058.  
  1059. self.AppendWearableInformation()
  1060.  
  1061. bHasRealtimeFlag = 0
  1062.  
  1063. ## 사용가능 시간 제한이 있는지 찾아보고
  1064. for i in xrange(item.LIMIT_MAX_NUM):
  1065. (limitType, limitValue) = item.GetLimit(i)
  1066.  
  1067. if item.LIMIT_REAL_TIME == limitType:
  1068. bHasRealtimeFlag = 1
  1069.  
  1070. ## 있다면 관련 정보를 표시함. ex) 남은 시간 : 6일 6시간 58분
  1071. if 1 == bHasRealtimeFlag:
  1072. self.AppendMallItemLastTime(metinSlot[0])
  1073. #dbg.TraceError("1) REAL_TIME flag On ")
  1074.  
  1075. ## Rod ##
  1076. elif item.ITEM_TYPE_ROD == itemType:
  1077.  
  1078. if 0 != metinSlot:
  1079. curLevel = item.GetValue(0) / 10
  1080. curEXP = metinSlot[0]
  1081. maxEXP = item.GetValue(2)
  1082. self.__AppendLimitInformation()
  1083. self.__AppendRodInformation(curLevel, curEXP, maxEXP)
  1084.  
  1085. ## Pick ##
  1086. elif item.ITEM_TYPE_PICK == itemType:
  1087.  
  1088. if 0 != metinSlot:
  1089. curLevel = item.GetValue(0) / 10
  1090. curEXP = metinSlot[0]
  1091. maxEXP = item.GetValue(2)
  1092. self.__AppendLimitInformation()
  1093. self.__AppendPickInformation(curLevel, curEXP, maxEXP)
  1094.  
  1095. ## Lottery ##
  1096. elif item.ITEM_TYPE_LOTTERY == itemType:
  1097. if 0 != metinSlot:
  1098.  
  1099. ticketNumber = int(metinSlot[0])
  1100. stepNumber = int(metinSlot[1])
  1101.  
  1102. self.AppendSpace(5)
  1103. self.AppendTextLine(localeInfo.TOOLTIP_LOTTERY_STEP_NUMBER % (stepNumber), self.NORMAL_COLOR)
  1104. self.AppendTextLine(localeInfo.TOOLTIP_LOTTO_NUMBER % (ticketNumber), self.NORMAL_COLOR);
  1105.  
  1106. ### Metin ###
  1107. elif item.ITEM_TYPE_METIN == itemType:
  1108. self.AppendMetinInformation()
  1109. self.AppendMetinWearInformation()
  1110.  
  1111. ### Fish ###
  1112. elif item.ITEM_TYPE_FISH == itemType:
  1113. if 0 != metinSlot:
  1114. self.__AppendFishInfo(metinSlot[0])
  1115.  
  1116. ## item.ITEM_TYPE_BLEND
  1117. elif item.ITEM_TYPE_BLEND == itemType:
  1118. self.__AppendLimitInformation()
  1119.  
  1120. if metinSlot:
  1121. affectType = metinSlot[0]
  1122. affectValue = metinSlot[1]
  1123. time = metinSlot[2]
  1124. self.AppendSpace(5)
  1125. affectText = self.__GetAffectString(affectType, affectValue)
  1126.  
  1127. self.AppendTextLine(affectText, self.NORMAL_COLOR)
  1128.  
  1129. if time > 0:
  1130. minute = (time / 60)
  1131. second = (time % 60)
  1132. timeString = localeInfo.TOOLTIP_POTION_TIME
  1133.  
  1134. if minute > 0:
  1135. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1136. if second > 0:
  1137. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1138.  
  1139. self.AppendTextLine(timeString)
  1140. else:
  1141. self.AppendTextLine(localeInfo.BLEND_POTION_NO_TIME)
  1142. else:
  1143. self.AppendTextLine("BLEND_POTION_NO_INFO")
  1144.  
  1145. elif item.ITEM_TYPE_UNIQUE == itemType:
  1146. if 0 != metinSlot:
  1147. bHasRealtimeFlag = 0
  1148.  
  1149. for i in xrange(item.LIMIT_MAX_NUM):
  1150. (limitType, limitValue) = item.GetLimit(i)
  1151.  
  1152. if item.LIMIT_REAL_TIME == limitType:
  1153. bHasRealtimeFlag = 1
  1154.  
  1155. if 1 == bHasRealtimeFlag:
  1156. self.AppendMallItemLastTime(metinSlot[0])
  1157. else:
  1158. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1159.  
  1160. if 1 == item.GetValue(2): ## 실시간 이용 Flag / 장착 안해도 준다
  1161. self.AppendMallItemLastTime(time)
  1162. else:
  1163. self.AppendUniqueItemLastTime(time)
  1164.  
  1165. ### Use ###
  1166. elif item.ITEM_TYPE_USE == itemType:
  1167. self.__AppendLimitInformation()
  1168.  
  1169. if item.USE_POTION == itemSubType or item.USE_POTION_NODELAY == itemSubType:
  1170. self.__AppendPotionInformation()
  1171.  
  1172. elif item.USE_ABILITY_UP == itemSubType:
  1173. self.__AppendAbilityPotionInformation()
  1174.  
  1175.  
  1176. ## 영석 감지기
  1177. if 27989 == itemVnum or 76006 == itemVnum:
  1178. if 0 != metinSlot:
  1179. useCount = int(metinSlot[0])
  1180.  
  1181. self.AppendSpace(5)
  1182. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR)
  1183.  
  1184. ## 이벤트 감지기
  1185. elif 50004 == itemVnum:
  1186. if 0 != metinSlot:
  1187. useCount = int(metinSlot[0])
  1188.  
  1189. self.AppendSpace(5)
  1190. self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR)
  1191.  
  1192. ## 자동물약
  1193. elif constInfo.IS_AUTO_POTION(itemVnum):
  1194. if 0 != metinSlot:
  1195. ## 0: 활성화, 1: 사용량, 2: 총량
  1196. isActivated = int(metinSlot[0])
  1197. usedAmount = float(metinSlot[1])
  1198. totalAmount = float(metinSlot[2])
  1199.  
  1200. if 0 == totalAmount:
  1201. totalAmount = 1
  1202.  
  1203. self.AppendSpace(5)
  1204.  
  1205. if 0 != isActivated:
  1206. self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR)
  1207. self.AppendSpace(5)
  1208.  
  1209. self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)
  1210.  
  1211. ## 귀환 기억부
  1212. elif itemVnum in WARP_SCROLLS:
  1213. if 0 != metinSlot:
  1214. xPos = int(metinSlot[0])
  1215. yPos = int(metinSlot[1])
  1216.  
  1217. if xPos != 0 and yPos != 0:
  1218. (mapName, xBase, yBase) = background.GlobalPositionToMapInfo(xPos, yPos)
  1219.  
  1220. localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "")
  1221.  
  1222. self.AppendSpace(5)
  1223.  
  1224. if localeMapName!="":
  1225. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
  1226. else:
  1227. self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
  1228. dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
  1229.  
  1230. #####
  1231. if item.USE_SPECIAL == itemSubType:
  1232. bHasRealtimeFlag = 0
  1233. for i in xrange(item.LIMIT_MAX_NUM):
  1234. (limitType, limitValue) = item.GetLimit(i)
  1235.  
  1236. if item.LIMIT_REAL_TIME == limitType:
  1237. bHasRealtimeFlag = 1
  1238.  
  1239. ## 있다면 관련 정보를 표시함. ex) 남은 시간 : 6일 6시간 58분
  1240. if 1 == bHasRealtimeFlag:
  1241. self.AppendMallItemLastTime(metinSlot[0])
  1242. else:
  1243. # ... 이거... 서버에는 이런 시간 체크 안되어 있는데...
  1244. # 왜 이런게 있는지 알지는 못하나 그냥 두자...
  1245. if 0 != metinSlot:
  1246. time = metinSlot[player.METIN_SOCKET_MAX_NUM-1]
  1247.  
  1248. ## 실시간 이용 Flag
  1249. if 1 == item.GetValue(2):
  1250. self.AppendMallItemLastTime(time)
  1251.  
  1252. elif item.USE_TIME_CHARGE_PER == itemSubType:
  1253. bHasRealtimeFlag = 0
  1254. for i in xrange(item.LIMIT_MAX_NUM):
  1255. (limitType, limitValue) = item.GetLimit(i)
  1256.  
  1257. if item.LIMIT_REAL_TIME == limitType:
  1258. bHasRealtimeFlag = 1
  1259. if metinSlot[2]:
  1260. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2]))
  1261. else:
  1262. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0)))
  1263.  
  1264. ## 있다면 관련 정보를 표시함. ex) 남은 시간 : 6일 6시간 58분
  1265. if 1 == bHasRealtimeFlag:
  1266. self.AppendMallItemLastTime(metinSlot[0])
  1267.  
  1268. elif item.USE_TIME_CHARGE_FIX == itemSubType:
  1269. bHasRealtimeFlag = 0
  1270. for i in xrange(item.LIMIT_MAX_NUM):
  1271. (limitType, limitValue) = item.GetLimit(i)
  1272.  
  1273. if item.LIMIT_REAL_TIME == limitType:
  1274. bHasRealtimeFlag = 1
  1275. if metinSlot[2]:
  1276. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(metinSlot[2]))
  1277. else:
  1278. self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0)))
  1279.  
  1280. ## 있다면 관련 정보를 표시함. ex) 남은 시간 : 6일 6시간 58분
  1281. if 1 == bHasRealtimeFlag:
  1282. self.AppendMallItemLastTime(metinSlot[0])
  1283.  
  1284. elif item.ITEM_TYPE_QUEST == itemType:
  1285. self.__AppendAffectInformation()
  1286. for i in xrange(item.LIMIT_MAX_NUM):
  1287. (limitType, limitValue) = item.GetLimit(i)
  1288.  
  1289. if item.LIMIT_REAL_TIME == limitType:
  1290. self.AppendMallItemLastTime(metinSlot[0])
  1291.  
  1292. elif item.ITEM_TYPE_DS == itemType:
  1293. self.AppendTextLine(self.__DragonSoulInfoString(itemVnum))
  1294. self.__AppendAttributeInformation(attrSlot)
  1295. else:
  1296. self.__AppendLimitInformation()
  1297.  
  1298. for i in xrange(item.LIMIT_MAX_NUM):
  1299. (limitType, limitValue) = item.GetLimit(i)
  1300. #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue))
  1301.  
  1302. if item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
  1303. self.AppendRealTimeStartFirstUseLastTime(item, metinSlot, i)
  1304. #dbg.TraceError("2) REAL_TIME_START_FIRST_USE flag On ")
  1305.  
  1306. elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
  1307. self.AppendTimerBasedOnWearLastTime(metinSlot)
  1308. #dbg.TraceError("1) REAL_TIME flag On ")
  1309.  
  1310.  
  1311.  
  1312. self.ShowToolTip()
  1313.  
  1314. def __DragonSoulInfoString (self, dwVnum):
  1315. step = (dwVnum / 100) % 10
  1316. refine = (dwVnum / 10) % 10
  1317. if 0 == step:
  1318. return localeInfo.DRAGON_SOUL_STEP_LEVEL1 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1319. elif 1 == step:
  1320. return localeInfo.DRAGON_SOUL_STEP_LEVEL2 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1321. elif 2 == step:
  1322. return localeInfo.DRAGON_SOUL_STEP_LEVEL3 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1323. elif 3 == step:
  1324. return localeInfo.DRAGON_SOUL_STEP_LEVEL4 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1325. elif 4 == step:
  1326. return localeInfo.DRAGON_SOUL_STEP_LEVEL5 + " " + localeInfo.DRAGON_SOUL_STRENGTH(refine)
  1327. else:
  1328. return ""
  1329.  
  1330.  
  1331. ## 헤어인가?
  1332. def __IsHair(self, itemVnum):
  1333. return (self.__IsOldHair(itemVnum) or
  1334. self.__IsNewHair(itemVnum) or
  1335. self.__IsNewHair2(itemVnum) or
  1336. self.__IsNewHair3(itemVnum) or
  1337. self.__IsCostumeHair(itemVnum)
  1338. )
  1339.  
  1340. def __IsOldHair(self, itemVnum):
  1341. return itemVnum > 73000 and itemVnum < 74000
  1342.  
  1343. def __IsNewHair(self, itemVnum):
  1344. return itemVnum > 74000 and itemVnum < 75000
  1345.  
  1346. def __IsNewHair2(self, itemVnum):
  1347. return itemVnum > 75000 and itemVnum < 76000
  1348.  
  1349. def __IsNewHair3(self, itemVnum):
  1350. return ((74012 < itemVnum and itemVnum < 74022) or
  1351. (74262 < itemVnum and itemVnum < 74272) or
  1352. (74512 < itemVnum and itemVnum < 74522) or
  1353. (74762 < itemVnum and itemVnum < 74772) or
  1354. (45000 < itemVnum and itemVnum < 47000))
  1355.  
  1356. def __IsCostumeHair(self, itemVnum):
  1357. return app.ENABLE_COSTUME_SYSTEM and self.__IsNewHair3(itemVnum - 100000)
  1358.  
  1359. def __AppendHairIcon(self, itemVnum):
  1360. itemImage = ui.ImageBox()
  1361. itemImage.SetParent(self)
  1362. itemImage.Show()
  1363.  
  1364. if self.__IsOldHair(itemVnum):
  1365. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga")
  1366. elif self.__IsNewHair3(itemVnum):
  1367. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1368. elif self.__IsNewHair(itemVnum): # 기존 헤어 번호를 연결시켜서 사용한다. 새로운 아이템은 1000만큼 번호가 늘었다.
  1369. itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga")
  1370. elif self.__IsNewHair2(itemVnum):
  1371. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum))
  1372. elif self.__IsCostumeHair(itemVnum):
  1373. itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum - 100000))
  1374.  
  1375. itemImage.SetPosition(itemImage.GetWidth()/2, self.toolTipHeight)
  1376. self.toolTipHeight += itemImage.GetHeight()
  1377. #self.toolTipWidth += itemImage.GetWidth()/2
  1378. self.childrenList.append(itemImage)
  1379. self.ResizeToolTip()
  1380.  
  1381. ## 사이즈가 큰 Description 일 경우 툴팁 사이즈를 조정한다
  1382. def __AdjustMaxWidth(self, attrSlot, desc):
  1383. newToolTipWidth = self.toolTipWidth
  1384. newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth)
  1385. newToolTipWidth = max(self.__AdjustDescMaxWidth(desc), newToolTipWidth)
  1386. if newToolTipWidth > self.toolTipWidth:
  1387. self.toolTipWidth = newToolTipWidth
  1388. self.ResizeToolTip()
  1389.  
  1390. def __AdjustAttrMaxWidth(self, attrSlot):
  1391. if 0 == attrSlot:
  1392. return self.toolTipWidth
  1393.  
  1394. maxWidth = self.toolTipWidth
  1395. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  1396. type = attrSlot[i][0]
  1397. value = attrSlot[i][1]
  1398. if self.ATTRIBUTE_NEED_WIDTH.has_key(type):
  1399. if value > 0:
  1400. maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth)
  1401.  
  1402. # ATTR_CHANGE_TOOLTIP_WIDTH
  1403. #self.toolTipWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], self.toolTipWidth)
  1404. #self.ResizeToolTip()
  1405. # END_OF_ATTR_CHANGE_TOOLTIP_WIDTH
  1406.  
  1407. return maxWidth
  1408.  
  1409. def __AdjustDescMaxWidth(self, desc):
  1410. if len(desc) < DESC_DEFAULT_MAX_COLS:
  1411. return self.toolTipWidth
  1412.  
  1413. return DESC_WESTERN_MAX_WIDTH
  1414.  
  1415. def __SetSkillBookToolTip(self, skillIndex, bookName, skillGrade):
  1416. skillName = skill.GetSkillName(skillIndex)
  1417.  
  1418. if not skillName:
  1419. return
  1420.  
  1421. if localeInfo.IsVIETNAM():
  1422. itemName = bookName + " " + skillName
  1423. else:
  1424. itemName = skillName + " " + bookName
  1425. self.SetTitle(itemName)
  1426.  
  1427. def __AppendPickInformation(self, curLevel, curEXP, maxEXP):
  1428. self.AppendSpace(5)
  1429. self.AppendTextLine(localeInfo.TOOLTIP_PICK_LEVEL % (curLevel), self.NORMAL_COLOR)
  1430. self.AppendTextLine(localeInfo.TOOLTIP_PICK_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1431.  
  1432. if curEXP == maxEXP:
  1433. self.AppendSpace(5)
  1434. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE1, self.NORMAL_COLOR)
  1435. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE2, self.NORMAL_COLOR)
  1436. self.AppendTextLine(localeInfo.TOOLTIP_PICK_UPGRADE3, self.NORMAL_COLOR)
  1437.  
  1438.  
  1439. def __AppendRodInformation(self, curLevel, curEXP, maxEXP):
  1440. self.AppendSpace(5)
  1441. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_LEVEL % (curLevel), self.NORMAL_COLOR)
  1442. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_EXP % (curEXP, maxEXP), self.NORMAL_COLOR)
  1443.  
  1444. if curEXP == maxEXP:
  1445. self.AppendSpace(5)
  1446. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE1, self.NORMAL_COLOR)
  1447. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE2, self.NORMAL_COLOR)
  1448. self.AppendTextLine(localeInfo.TOOLTIP_FISHINGROD_UPGRADE3, self.NORMAL_COLOR)
  1449.  
  1450. def __AppendLimitInformation(self):
  1451.  
  1452. appendSpace = False
  1453.  
  1454. for i in xrange(item.LIMIT_MAX_NUM):
  1455.  
  1456. (limitType, limitValue) = item.GetLimit(i)
  1457.  
  1458. if limitValue > 0:
  1459. if False == appendSpace:
  1460. self.AppendSpace(5)
  1461. appendSpace = True
  1462.  
  1463. else:
  1464. continue
  1465.  
  1466. if item.LIMIT_LEVEL == limitType:
  1467. color = self.GetLimitTextLineColor(player.GetStatus(player.LEVEL), limitValue)
  1468. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (limitValue), color)
  1469. """
  1470. elif item.LIMIT_STR == limitType:
  1471. color = self.GetLimitTextLineColor(player.GetStatus(player.ST), limitValue)
  1472. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_STR % (limitValue), color)
  1473. elif item.LIMIT_DEX == limitType:
  1474. color = self.GetLimitTextLineColor(player.GetStatus(player.DX), limitValue)
  1475. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_DEX % (limitValue), color)
  1476. elif item.LIMIT_INT == limitType:
  1477. color = self.GetLimitTextLineColor(player.GetStatus(player.IQ), limitValue)
  1478. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_INT % (limitValue), color)
  1479. elif item.LIMIT_CON == limitType:
  1480. color = self.GetLimitTextLineColor(player.GetStatus(player.HT), limitValue)
  1481. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
  1482. """
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495. def __GetAffectString(self, affectType, affectValue):
  1496. if 0 == affectType:
  1497. return None
  1498.  
  1499. if 0 == affectValue:
  1500. return None
  1501.  
  1502. try:
  1503. return self.AFFECT_DICT[affectType](affectValue)
  1504. except TypeError:
  1505. return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue)
  1506. except KeyError:
  1507. return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue)
  1508.  
  1509. def __AppendAffectInformation(self):
  1510. for i in xrange(item.ITEM_APPLY_MAX_NUM):
  1511.  
  1512. (affectType, affectValue) = item.GetAffect(i)
  1513.  
  1514. affectString = self.__GetAffectString(affectType, affectValue)
  1515. if affectString:
  1516. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1517.  
  1518. def AppendWearableInformation(self):
  1519.  
  1520. self.AppendSpace(5)
  1521. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
  1522.  
  1523. flagList = (
  1524. not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
  1525. not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
  1526. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
  1527. not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
  1528.  
  1529. characterNames = ""
  1530. for i in xrange(self.CHARACTER_COUNT):
  1531.  
  1532. name = self.CHARACTER_NAMES[i]
  1533. flag = flagList[i]
  1534.  
  1535. if flag:
  1536. characterNames += " "
  1537. characterNames += name
  1538.  
  1539. textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
  1540. textLine.SetFeather()
  1541.  
  1542. if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
  1543. textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
  1544. textLine.SetFeather()
  1545.  
  1546. if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
  1547. textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
  1548. textLine.SetFeather()
  1549.  
  1550. def __AppendPotionInformation(self):
  1551. self.AppendSpace(5)
  1552.  
  1553. healHP = item.GetValue(0)
  1554. healSP = item.GetValue(1)
  1555. healStatus = item.GetValue(2)
  1556. healPercentageHP = item.GetValue(3)
  1557. healPercentageSP = item.GetValue(4)
  1558.  
  1559. if healHP > 0:
  1560. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_POINT % healHP, self.GetChangeTextLineColor(healHP))
  1561. if healSP > 0:
  1562. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_POINT % healSP, self.GetChangeTextLineColor(healSP))
  1563. if healStatus != 0:
  1564. self.AppendTextLine(localeInfo.TOOLTIP_POTION_CURE)
  1565. if healPercentageHP > 0:
  1566. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_HP_PERCENT % healPercentageHP, self.GetChangeTextLineColor(healPercentageHP))
  1567. if healPercentageSP > 0:
  1568. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_SP_PERCENT % healPercentageSP, self.GetChangeTextLineColor(healPercentageSP))
  1569.  
  1570. def __AppendAbilityPotionInformation(self):
  1571.  
  1572. self.AppendSpace(5)
  1573.  
  1574. abilityType = item.GetValue(0)
  1575. time = item.GetValue(1)
  1576. point = item.GetValue(2)
  1577.  
  1578. if abilityType == item.APPLY_ATT_SPEED:
  1579. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_ATTACK_SPEED % point, self.GetChangeTextLineColor(point))
  1580. elif abilityType == item.APPLY_MOV_SPEED:
  1581. self.AppendTextLine(localeInfo.TOOLTIP_POTION_PLUS_MOVING_SPEED % point, self.GetChangeTextLineColor(point))
  1582.  
  1583. if time > 0:
  1584. minute = (time / 60)
  1585. second = (time % 60)
  1586. timeString = localeInfo.TOOLTIP_POTION_TIME
  1587.  
  1588. if minute > 0:
  1589. timeString += str(minute) + localeInfo.TOOLTIP_POTION_MIN
  1590. if second > 0:
  1591. timeString += " " + str(second) + localeInfo.TOOLTIP_POTION_SEC
  1592.  
  1593. self.AppendTextLine(timeString)
  1594.  
  1595. def GetPriceColor(self, price):
  1596. if price>=constInfo.HIGH_PRICE:
  1597. return self.HIGH_PRICE_COLOR
  1598. if price>=constInfo.MIDDLE_PRICE:
  1599. return self.MIDDLE_PRICE_COLOR
  1600. else:
  1601. return self.LOW_PRICE_COLOR
  1602.  
  1603. def AppendPrice(self, price):
  1604. self.AppendSpace(5)
  1605. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1606.  
  1607. def AppendPriceBySecondaryCoin(self, price):
  1608. self.AppendSpace(5)
  1609. self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
  1610.  
  1611. def AppendSellingPrice(self, price):
  1612. if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
  1613. self.AppendTextLine(localeInfo.TOOLTIP_ANTI_SELL, self.DISABLE_COLOR)
  1614. self.AppendSpace(5)
  1615. else:
  1616. self.AppendTextLine(localeInfo.TOOLTIP_SELLPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
  1617. self.AppendSpace(5)
  1618.  
  1619. def AppendMetinInformation(self):
  1620. affectType, affectValue = item.GetAffect(0)
  1621. #affectType = item.GetValue(0)
  1622. #affectValue = item.GetValue(1)
  1623.  
  1624. affectString = self.__GetAffectString(affectType, affectValue)
  1625.  
  1626. if affectString:
  1627. self.AppendSpace(5)
  1628. self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
  1629.  
  1630. def AppendMetinWearInformation(self):
  1631.  
  1632. self.AppendSpace(5)
  1633. self.AppendTextLine(localeInfo.TOOLTIP_SOCKET_REFINABLE_ITEM, self.NORMAL_COLOR)
  1634.  
  1635. flagList = (item.IsWearableFlag(item.WEARABLE_BODY),
  1636. item.IsWearableFlag(item.WEARABLE_HEAD),
  1637. item.IsWearableFlag(item.WEARABLE_FOOTS),
  1638. item.IsWearableFlag(item.WEARABLE_WRIST),
  1639. item.IsWearableFlag(item.WEARABLE_WEAPON),
  1640. item.IsWearableFlag(item.WEARABLE_NECK),
  1641. item.IsWearableFlag(item.WEARABLE_EAR),
  1642. item.IsWearableFlag(item.WEARABLE_UNIQUE),
  1643. item.IsWearableFlag(item.WEARABLE_SHIELD),
  1644. item.IsWearableFlag(item.WEARABLE_ARROW))
  1645.  
  1646. wearNames = ""
  1647. for i in xrange(self.WEAR_COUNT):
  1648.  
  1649. name = self.WEAR_NAMES[i]
  1650. flag = flagList[i]
  1651.  
  1652. if flag:
  1653. wearNames += " "
  1654. wearNames += name
  1655.  
  1656. textLine = ui.TextLine()
  1657. textLine.SetParent(self)
  1658. textLine.SetFontName(self.defFontName)
  1659. textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
  1660. textLine.SetHorizontalAlignCenter()
  1661. textLine.SetPackedFontColor(self.NORMAL_COLOR)
  1662. textLine.SetText(wearNames)
  1663. textLine.Show()
  1664. self.childrenList.append(textLine)
  1665.  
  1666. self.toolTipHeight += self.TEXT_LINE_HEIGHT
  1667. self.ResizeToolTip()
  1668.  
  1669. def GetMetinSocketType(self, number):
  1670. if player.METIN_SOCKET_TYPE_NONE == number:
  1671. return player.METIN_SOCKET_TYPE_NONE
  1672. elif player.METIN_SOCKET_TYPE_SILVER == number:
  1673. return player.METIN_SOCKET_TYPE_SILVER
  1674. elif player.METIN_SOCKET_TYPE_GOLD == number:
  1675. return player.METIN_SOCKET_TYPE_GOLD
  1676. else:
  1677. item.SelectItem(number)
  1678. if item.METIN_NORMAL == item.GetItemSubType():
  1679. return player.METIN_SOCKET_TYPE_SILVER
  1680. elif item.METIN_GOLD == item.GetItemSubType():
  1681. return player.METIN_SOCKET_TYPE_GOLD
  1682. elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
  1683. return player.METIN_SOCKET_TYPE_SILVER
  1684. elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
  1685. return player.METIN_SOCKET_TYPE_SILVER
  1686. elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
  1687. return player.METIN_SOCKET_TYPE_SILVER
  1688.  
  1689. return player.METIN_SOCKET_TYPE_NONE
  1690.  
  1691. def GetMetinItemIndex(self, number):
  1692. if player.METIN_SOCKET_TYPE_SILVER == number:
  1693. return 0
  1694. if player.METIN_SOCKET_TYPE_GOLD == number:
  1695. return 0
  1696.  
  1697. return number
  1698.  
  1699. def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
  1700. ACCESSORY_SOCKET_MAX_SIZE = 3
  1701.  
  1702. cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
  1703. end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
  1704.  
  1705. affectType1, affectValue1 = item.GetAffect(0)
  1706. affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
  1707.  
  1708. affectType2, affectValue2 = item.GetAffect(1)
  1709. affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
  1710.  
  1711. mtrlPos=0
  1712. mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
  1713. for mtrl in mtrlList:
  1714. affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1]-affectList1[mtrlPos])
  1715. affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1]-affectList2[mtrlPos])
  1716.  
  1717. leftTime = 0
  1718. if cur == mtrlPos+1:
  1719. leftTime=metinSlot[2]
  1720.  
  1721. self.__AppendMetinSlotInfo_AppendMetinSocketData(mtrlPos, mtrl, affectString1, affectString2, leftTime)
  1722. mtrlPos+=1
  1723.  
  1724. def __AppendMetinSlotInfo(self, metinSlot):
  1725. if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
  1726. return
  1727.  
  1728. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1729. self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
  1730.  
  1731. def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
  1732. if 0 == metinSlot:
  1733. return 1
  1734.  
  1735. for i in xrange(player.METIN_SOCKET_MAX_NUM):
  1736. metinSlotData=metinSlot[i]
  1737. if 0 != self.GetMetinSocketType(metinSlotData):
  1738. if 0 != self.GetMetinItemIndex(metinSlotData):
  1739. return 0
  1740.  
  1741. return 1
  1742.  
  1743. def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
  1744.  
  1745. slotType = self.GetMetinSocketType(metinSlotData)
  1746. itemIndex = self.GetMetinItemIndex(metinSlotData)
  1747.  
  1748. if 0 == slotType:
  1749. return
  1750.  
  1751. self.AppendSpace(5)
  1752.  
  1753. slotImage = ui.ImageBox()
  1754. slotImage.SetParent(self)
  1755. slotImage.Show()
  1756.  
  1757. ## Name
  1758. nameTextLine = ui.TextLine()
  1759. nameTextLine.SetParent(self)
  1760. nameTextLine.SetFontName(self.defFontName)
  1761. nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
  1762. nameTextLine.SetOutline()
  1763. nameTextLine.SetFeather()
  1764. nameTextLine.Show()
  1765.  
  1766. self.childrenList.append(nameTextLine)
  1767.  
  1768. if player.METIN_SOCKET_TYPE_SILVER == slotType:
  1769. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
  1770. elif player.METIN_SOCKET_TYPE_GOLD == slotType:
  1771. slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
  1772.  
  1773. self.childrenList.append(slotImage)
  1774.  
  1775. if localeInfo.IsARABIC():
  1776. slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
  1777. nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
  1778. else:
  1779. slotImage.SetPosition(9, self.toolTipHeight-1)
  1780. nameTextLine.SetPosition(50, self.toolTipHeight + 2)
  1781.  
  1782. metinImage = ui.ImageBox()
  1783. metinImage.SetParent(self)
  1784. metinImage.Show()
  1785. self.childrenList.append(metinImage)
  1786.  
  1787. if itemIndex:
  1788.  
  1789. item.SelectItem(itemIndex)
  1790.  
  1791. ## Image
  1792. try:
  1793. metinImage.LoadImage(item.GetIconImageFileName())
  1794. except:
  1795. dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
  1796. (itemIndex, item.GetIconImageFileName())
  1797. )
  1798.  
  1799. nameTextLine.SetText(item.GetItemName())
  1800.  
  1801. ## Affect
  1802. affectTextLine = ui.TextLine()
  1803. affectTextLine.SetParent(self)
  1804. affectTextLine.SetFontName(self.defFontName)
  1805. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1806. affectTextLine.SetOutline()
  1807. affectTextLine.SetFeather()
  1808. affectTextLine.Show()
  1809.  
  1810. if localeInfo.IsARABIC():
  1811. metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
  1812. affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
  1813. else:
  1814. metinImage.SetPosition(10, self.toolTipHeight)
  1815. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
  1816.  
  1817. if custumAffectString:
  1818. affectTextLine.SetText(custumAffectString)
  1819. elif itemIndex!=constInfo.ERROR_METIN_STONE:
  1820. affectType, affectValue = item.GetAffect(0)
  1821. affectString = self.__GetAffectString(affectType, affectValue)
  1822. if affectString:
  1823. affectTextLine.SetText(affectString)
  1824. else:
  1825. affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
  1826.  
  1827. self.childrenList.append(affectTextLine)
  1828.  
  1829. if custumAffectString2:
  1830. affectTextLine = ui.TextLine()
  1831. affectTextLine.SetParent(self)
  1832. affectTextLine.SetFontName(self.defFontName)
  1833. affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1834. affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1835. affectTextLine.SetOutline()
  1836. affectTextLine.SetFeather()
  1837. affectTextLine.Show()
  1838. affectTextLine.SetText(custumAffectString2)
  1839. self.childrenList.append(affectTextLine)
  1840. self.toolTipHeight += 16 + 2
  1841.  
  1842. if 0 != leftTime:
  1843. timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
  1844.  
  1845. timeTextLine = ui.TextLine()
  1846. timeTextLine.SetParent(self)
  1847. timeTextLine.SetFontName(self.defFontName)
  1848. timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
  1849. timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
  1850. timeTextLine.SetOutline()
  1851. timeTextLine.SetFeather()
  1852. timeTextLine.Show()
  1853. timeTextLine.SetText(timeText)
  1854. self.childrenList.append(timeTextLine)
  1855. self.toolTipHeight += 16 + 2
  1856.  
  1857. else:
  1858. nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
  1859.  
  1860. self.toolTipHeight += 35
  1861. self.ResizeToolTip()
  1862.  
  1863. def __AppendFishInfo(self, size):
  1864. if size > 0:
  1865. self.AppendSpace(5)
  1866. self.AppendTextLine(localeInfo.TOOLTIP_FISH_LEN % (float(size) / 100.0), self.NORMAL_COLOR)
  1867.  
  1868. def AppendUniqueItemLastTime(self, restMin):
  1869. restSecond = restMin*60
  1870. self.AppendSpace(5)
  1871. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(restSecond), self.NORMAL_COLOR)
  1872.  
  1873. def AppendMallItemLastTime(self, endTime):
  1874. leftSec = max(0, endTime - app.GetGlobalTimeStamp())
  1875. self.AppendSpace(5)
  1876. self.AppendTextLine(localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftSec), self.NORMAL_COLOR)
  1877.  
  1878. def AppendTimerBasedOnWearLastTime(self, metinSlot):
  1879. if 0 == metinSlot[0]:
  1880. self.AppendSpace(5)
  1881. self.AppendTextLine(localeInfo.CANNOT_USE, self.DISABLE_COLOR)
  1882. else:
  1883. endTime = app.GetGlobalTimeStamp() + metinSlot[0]
  1884. self.AppendMallItemLastTime(endTime)
  1885.  
  1886. def AppendRealTimeStartFirstUseLastTime(self, item, metinSlot, limitIndex):
  1887. useCount = metinSlot[1]
  1888. endTime = metinSlot[0]
  1889.  
  1890. # 한 번이라도 사용했다면 Socket0에 종료 시간(2012년 3월 1일 13시 01분 같은..) 이 박혀있음.
  1891. # 사용하지 않았다면 Socket0에 이용가능시간(이를테면 600 같은 값. 초단위)이 들어있을 수 있고, 0이라면 Limit Value에 있는 이용가능시간을 사용한다.
  1892. if 0 == useCount:
  1893. if 0 == endTime:
  1894. (limitType, limitValue) = item.GetLimit(limitIndex)
  1895. endTime = limitValue
  1896.  
  1897. endTime += app.GetGlobalTimeStamp()
  1898.  
  1899. self.AppendMallItemLastTime(endTime)
  1900.  
  1901. class HyperlinkItemToolTip(ItemToolTip):
  1902. def __init__(self):
  1903. ItemToolTip.__init__(self, isPickable=True)
  1904.  
  1905. def SetHyperlinkItem(self, tokens):
  1906. minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
  1907. maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM
  1908. if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount:
  1909. head, vnum, flag = tokens[:3]
  1910. itemVnum = int(vnum, 16)
  1911. metinSlot = [int(metin, 16) for metin in tokens[3:6]]
  1912.  
  1913. rests = tokens[6:]
  1914. if rests:
  1915. attrSlot = []
  1916.  
  1917. rests.reverse()
  1918. while rests:
  1919. key = int(rests.pop(), 16)
  1920. if rests:
  1921. val = int(rests.pop())
  1922. attrSlot.append((key, val))
  1923.  
  1924. attrSlot += [(0, 0)] * (player.ATTRIBUTE_SLOT_MAX_NUM - len(attrSlot))
  1925. else:
  1926. attrSlot = [(0, 0)] * player.ATTRIBUTE_SLOT_MAX_NUM
  1927.  
  1928. self.ClearToolTip()
  1929. self.AddItemData(itemVnum, metinSlot, attrSlot)
  1930.  
  1931. ItemToolTip.OnUpdate(self)
  1932.  
  1933. def OnUpdate(self):
  1934. pass
  1935.  
  1936. def OnMouseLeftButtonDown(self):
  1937. self.Hide()
  1938.  
  1939. class SkillToolTip(ToolTip):
  1940.  
  1941. POINT_NAME_DICT = {
  1942. player.LEVEL : localeInfo.SKILL_TOOLTIP_LEVEL,
  1943. player.IQ : localeInfo.SKILL_TOOLTIP_INT,
  1944. }
  1945.  
  1946. SKILL_TOOL_TIP_WIDTH = 200
  1947. PARTY_SKILL_TOOL_TIP_WIDTH = 340
  1948.  
  1949. PARTY_SKILL_EXPERIENCE_AFFECT_LIST = ( ( 2, 2, 10,),
  1950. ( 8, 3, 20,),
  1951. (14, 4, 30,),
  1952. (22, 5, 45,),
  1953. (28, 6, 60,),
  1954. (34, 7, 80,),
  1955. (38, 8, 100,), )
  1956.  
  1957. PARTY_SKILL_PLUS_GRADE_AFFECT_LIST = ( ( 4, 2, 1, 0,),
  1958. (10, 3, 2, 0,),
  1959. (16, 4, 2, 1,),
  1960. (24, 5, 2, 2,), )
  1961.  
  1962. PARTY_SKILL_ATTACKER_AFFECT_LIST = ( ( 36, 3, ),
  1963. ( 26, 1, ),
  1964. ( 32, 2, ), )
  1965.  
  1966. SKILL_GRADE_NAME = { player.SKILL_GRADE_MASTER : localeInfo.SKILL_GRADE_NAME_MASTER,
  1967. player.SKILL_GRADE_GRAND_MASTER : localeInfo.SKILL_GRADE_NAME_GRAND_MASTER,
  1968. player.SKILL_GRADE_PERFECT_MASTER : localeInfo.SKILL_GRADE_NAME_PERFECT_MASTER, }
  1969.  
  1970. AFFECT_NAME_DICT = {
  1971. "HP" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_POWER,
  1972. "ATT_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_GRADE,
  1973. "DEF_GRADE" : localeInfo.TOOLTIP_SKILL_AFFECT_DEF_GRADE,
  1974. "ATT_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_ATT_SPEED,
  1975. "MOV_SPEED" : localeInfo.TOOLTIP_SKILL_AFFECT_MOV_SPEED,
  1976. "DODGE" : localeInfo.TOOLTIP_SKILL_AFFECT_DODGE,
  1977. "RESIST_NORMAL" : localeInfo.TOOLTIP_SKILL_AFFECT_RESIST_NORMAL,
  1978. "REFLECT_MELEE" : localeInfo.TOOLTIP_SKILL_AFFECT_REFLECT_MELEE,
  1979. }
  1980. AFFECT_APPEND_TEXT_DICT = {
  1981. "DODGE" : "%",
  1982. "RESIST_NORMAL" : "%",
  1983. "REFLECT_MELEE" : "%",
  1984. }
  1985.  
  1986. def __init__(self):
  1987. ToolTip.__init__(self, self.SKILL_TOOL_TIP_WIDTH)
  1988. def __del__(self):
  1989. ToolTip.__del__(self)
  1990.  
  1991. def SetSkill(self, skillIndex, skillLevel = -1):
  1992.  
  1993. if 0 == skillIndex:
  1994. return
  1995.  
  1996. if skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  1997.  
  1998. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  1999. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2000. self.ResizeToolTip()
  2001.  
  2002. self.AppendDefaultData(skillIndex)
  2003. self.AppendSkillConditionData(skillIndex)
  2004. self.AppendGuildSkillData(skillIndex, skillLevel)
  2005.  
  2006. else:
  2007.  
  2008. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2009. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2010. self.ResizeToolTip()
  2011.  
  2012. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2013. skillGrade = player.GetSkillGrade(slotIndex)
  2014. skillLevel = player.GetSkillLevel(slotIndex)
  2015. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2016. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2017.  
  2018. self.AppendDefaultData(skillIndex)
  2019. self.AppendSkillConditionData(skillIndex)
  2020. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2021. self.AppendSkillRequirement(skillIndex, skillLevel)
  2022.  
  2023. self.ShowToolTip()
  2024.  
  2025. def SetSkillNew(self, slotIndex, skillIndex, skillGrade, skillLevel):
  2026.  
  2027. if 0 == skillIndex:
  2028. return
  2029.  
  2030. if player.SKILL_INDEX_TONGSOL == skillIndex:
  2031.  
  2032. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2033. skillLevel = player.GetSkillLevel(slotIndex)
  2034.  
  2035. self.AppendDefaultData(skillIndex)
  2036. self.AppendPartySkillData(skillGrade, skillLevel)
  2037.  
  2038. elif player.SKILL_INDEX_RIDING == skillIndex:
  2039.  
  2040. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2041. self.AppendSupportSkillDefaultData(skillIndex, skillGrade, skillLevel, 30)
  2042.  
  2043. elif player.SKILL_INDEX_SUMMON == skillIndex:
  2044.  
  2045. maxLevel = 10
  2046.  
  2047. self.ClearToolTip()
  2048. self.__SetSkillTitle(skillIndex, skillGrade)
  2049.  
  2050. ## Description
  2051. description = skill.GetSkillDescription(skillIndex)
  2052. self.AppendDescription(description, 25)
  2053.  
  2054. if skillLevel == 10:
  2055. self.AppendSpace(5)
  2056. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2057. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel*10), self.NORMAL_COLOR)
  2058.  
  2059. else:
  2060. self.AppendSpace(5)
  2061. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2062. self.__AppendSummonDescription(skillLevel, self.NORMAL_COLOR)
  2063.  
  2064. self.AppendSpace(5)
  2065. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel+1), self.NEGATIVE_COLOR)
  2066. self.__AppendSummonDescription(skillLevel+1, self.NEGATIVE_COLOR)
  2067.  
  2068. elif skill.SKILL_TYPE_GUILD == skill.GetSkillType(skillIndex):
  2069.  
  2070. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2071. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2072. self.ResizeToolTip()
  2073.  
  2074. self.AppendDefaultData(skillIndex)
  2075. self.AppendSkillConditionData(skillIndex)
  2076. self.AppendGuildSkillData(skillIndex, skillLevel)
  2077.  
  2078. else:
  2079.  
  2080. if self.SKILL_TOOL_TIP_WIDTH != self.toolTipWidth:
  2081. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2082. self.ResizeToolTip()
  2083.  
  2084. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2085.  
  2086. skillCurrentPercentage = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2087. skillNextPercentage = player.GetSkillNextEfficientPercentage(slotIndex)
  2088.  
  2089. self.AppendDefaultData(skillIndex, skillGrade)
  2090. self.AppendSkillConditionData(skillIndex)
  2091. self.AppendSkillDataNew(slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage)
  2092. self.AppendSkillRequirement(skillIndex, skillLevel)
  2093.  
  2094. self.ShowToolTip()
  2095.  
  2096. def __SetSkillTitle(self, skillIndex, skillGrade):
  2097. self.SetTitle(skill.GetSkillName(skillIndex, skillGrade))
  2098. self.__AppendSkillGradeName(skillIndex, skillGrade)
  2099.  
  2100. def __AppendSkillGradeName(self, skillIndex, skillGrade):
  2101. if self.SKILL_GRADE_NAME.has_key(skillGrade):
  2102. self.AppendSpace(5)
  2103. self.AppendTextLine(self.SKILL_GRADE_NAME[skillGrade] % (skill.GetSkillName(skillIndex, 0)), self.CAN_LEVEL_UP_COLOR)
  2104.  
  2105. def SetSkillOnlyName(self, slotIndex, skillIndex, skillGrade):
  2106. if 0 == skillIndex:
  2107. return
  2108.  
  2109. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2110.  
  2111. self.toolTipWidth = self.SKILL_TOOL_TIP_WIDTH
  2112. self.ResizeToolTip()
  2113.  
  2114. self.ClearToolTip()
  2115. self.__SetSkillTitle(skillIndex, skillGrade)
  2116. self.AppendDefaultData(skillIndex, skillGrade)
  2117. self.AppendSkillConditionData(skillIndex)
  2118. self.ShowToolTip()
  2119.  
  2120. def AppendDefaultData(self, skillIndex, skillGrade = 0):
  2121. self.ClearToolTip()
  2122. self.__SetSkillTitle(skillIndex, skillGrade)
  2123.  
  2124. ## Level Limit
  2125. levelLimit = skill.GetSkillLevelLimit(skillIndex)
  2126. if levelLimit > 0:
  2127.  
  2128. color = self.NORMAL_COLOR
  2129. if player.GetStatus(player.LEVEL) < levelLimit:
  2130. color = self.NEGATIVE_COLOR
  2131.  
  2132. self.AppendSpace(5)
  2133. self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_LEVEL % (levelLimit), color)
  2134.  
  2135. ## Description
  2136. description = skill.GetSkillDescription(skillIndex)
  2137. self.AppendDescription(description, 25)
  2138.  
  2139. def AppendSupportSkillDefaultData(self, skillIndex, skillGrade, skillLevel, maxLevel):
  2140. self.ClearToolTip()
  2141. self.__SetSkillTitle(skillIndex, skillGrade)
  2142.  
  2143. ## Description
  2144. description = skill.GetSkillDescription(skillIndex)
  2145. self.AppendDescription(description, 25)
  2146.  
  2147. if 1 == skillGrade:
  2148. skillLevel += 19
  2149. elif 2 == skillGrade:
  2150. skillLevel += 29
  2151. elif 3 == skillGrade:
  2152. skillLevel = 40
  2153.  
  2154. self.AppendSpace(5)
  2155. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_WITH_MAX % (skillLevel, maxLevel), self.NORMAL_COLOR)
  2156.  
  2157. def AppendSkillConditionData(self, skillIndex):
  2158. conditionDataCount = skill.GetSkillConditionDescriptionCount(skillIndex)
  2159. if conditionDataCount > 0:
  2160. self.AppendSpace(5)
  2161. for i in xrange(conditionDataCount):
  2162. self.AppendTextLine(skill.GetSkillConditionDescription(skillIndex, i), self.CONDITION_COLOR)
  2163.  
  2164. def AppendGuildSkillData(self, skillIndex, skillLevel):
  2165. skillMaxLevel = 7
  2166. skillCurrentPercentage = float(skillLevel) / float(skillMaxLevel)
  2167. skillNextPercentage = float(skillLevel+1) / float(skillMaxLevel)
  2168. ## Current Level
  2169. if skillLevel > 0:
  2170. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2171. self.AppendSpace(5)
  2172. if skillLevel == skillMaxLevel:
  2173. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2174. else:
  2175. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2176.  
  2177. #####
  2178.  
  2179. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2180. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillCurrentPercentage), self.ENABLE_COLOR)
  2181.  
  2182. ## Cooltime
  2183. coolTime = skill.GetSkillCoolTime(skillIndex, skillCurrentPercentage)
  2184. if coolTime > 0:
  2185. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.ENABLE_COLOR)
  2186.  
  2187. ## SP
  2188. needGSP = skill.GetSkillNeedSP(skillIndex, skillCurrentPercentage)
  2189. if needGSP > 0:
  2190. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.ENABLE_COLOR)
  2191.  
  2192. ## Next Level
  2193. if skillLevel < skillMaxLevel:
  2194. if self.HasSkillLevelDescription(skillIndex, skillLevel+1):
  2195. self.AppendSpace(5)
  2196. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevel), self.DISABLE_COLOR)
  2197.  
  2198. #####
  2199.  
  2200. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2201. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillNextPercentage), self.DISABLE_COLOR)
  2202.  
  2203. ## Cooltime
  2204. coolTime = skill.GetSkillCoolTime(skillIndex, skillNextPercentage)
  2205. if coolTime > 0:
  2206. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), self.DISABLE_COLOR)
  2207.  
  2208. ## SP
  2209. needGSP = skill.GetSkillNeedSP(skillIndex, skillNextPercentage)
  2210. if needGSP > 0:
  2211. self.AppendTextLine(localeInfo.TOOLTIP_NEED_GSP % (needGSP), self.DISABLE_COLOR)
  2212.  
  2213. def AppendSkillDataNew(self, slotIndex, skillIndex, skillGrade, skillLevel, skillCurrentPercentage, skillNextPercentage):
  2214.  
  2215. self.skillMaxLevelStartDict = { 0 : 17, 1 : 7, 2 : 10, }
  2216. self.skillMaxLevelEndDict = { 0 : 20, 1 : 10, 2 : 10, }
  2217.  
  2218. skillLevelUpPoint = 1
  2219. realSkillGrade = player.GetSkillGrade(slotIndex)
  2220. skillMaxLevelStart = self.skillMaxLevelStartDict.get(realSkillGrade, 15)
  2221. skillMaxLevelEnd = self.skillMaxLevelEndDict.get(realSkillGrade, 20)
  2222.  
  2223. ## Current Level
  2224. if skillLevel > 0:
  2225. if self.HasSkillLevelDescription(skillIndex, skillLevel):
  2226. self.AppendSpace(5)
  2227. if skillGrade == skill.SKILL_GRADE_COUNT:
  2228. pass
  2229. elif skillLevel == skillMaxLevelEnd:
  2230. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL_MASTER % (skillLevel), self.NORMAL_COLOR)
  2231. else:
  2232. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_LEVEL % (skillLevel), self.NORMAL_COLOR)
  2233. self.AppendSkillLevelDescriptionNew(skillIndex, skillCurrentPercentage, self.ENABLE_COLOR)
  2234.  
  2235. ## Next Level
  2236. if skillGrade != skill.SKILL_GRADE_COUNT:
  2237. if skillLevel < skillMaxLevelEnd:
  2238. if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint):
  2239. self.AppendSpace(5)
  2240. ## HP보강, 관통회피 보조스킬의 경우
  2241. if skillIndex == 141 or skillIndex == 142:
  2242. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR)
  2243. else:
  2244. self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_1 % (skillLevel+1, skillMaxLevelEnd), self.DISABLE_COLOR)
  2245. self.AppendSkillLevelDescriptionNew(skillIndex, skillNextPercentage, self.DISABLE_COLOR)
  2246.  
  2247. def AppendSkillLevelDescriptionNew(self, skillIndex, skillPercentage, color):
  2248.  
  2249. affectDataCount = skill.GetNewAffectDataCount(skillIndex)
  2250. if affectDataCount > 0:
  2251. for i in xrange(affectDataCount):
  2252. type, minValue, maxValue = skill.GetNewAffectData(skillIndex, i, skillPercentage)
  2253.  
  2254. if not self.AFFECT_NAME_DICT.has_key(type):
  2255. continue
  2256.  
  2257. minValue = int(minValue)
  2258. maxValue = int(maxValue)
  2259. affectText = self.AFFECT_NAME_DICT[type]
  2260.  
  2261. if "HP" == type:
  2262. if minValue < 0 and maxValue < 0:
  2263. minValue *= -1
  2264. maxValue *= -1
  2265.  
  2266. else:
  2267. affectText = localeInfo.TOOLTIP_SKILL_AFFECT_HEAL
  2268.  
  2269. affectText += str(minValue)
  2270. if minValue != maxValue:
  2271. affectText += " - " + str(maxValue)
  2272. affectText += self.AFFECT_APPEND_TEXT_DICT.get(type, "")
  2273.  
  2274. #import debugInfo
  2275. #if debugInfo.IsDebugMode():
  2276. # affectText = "!!" + affectText
  2277.  
  2278. self.AppendTextLine(affectText, color)
  2279.  
  2280. else:
  2281. for i in xrange(skill.GetSkillAffectDescriptionCount(skillIndex)):
  2282. self.AppendTextLine(skill.GetSkillAffectDescription(skillIndex, i, skillPercentage), color)
  2283.  
  2284.  
  2285. ## Duration
  2286. duration = skill.GetDuration(skillIndex, skillPercentage)
  2287. if duration > 0:
  2288. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_DURATION % (duration), color)
  2289.  
  2290. ## Cooltime
  2291. coolTime = skill.GetSkillCoolTime(skillIndex, skillPercentage)
  2292. if coolTime > 0:
  2293. self.AppendTextLine(localeInfo.TOOLTIP_SKILL_COOL_TIME + str(coolTime), color)
  2294.  
  2295. ## SP
  2296. needSP = skill.GetSkillNeedSP(skillIndex, skillPercentage)
  2297. if needSP != 0:
  2298. continuationSP = skill.GetSkillContinuationSP(skillIndex, skillPercentage)
  2299.  
  2300. if skill.IsUseHPSkill(skillIndex):
  2301. self.AppendNeedHP(needSP, continuationSP, color)
  2302. else:
  2303. self.AppendNeedSP(needSP, continuationSP, color)
  2304.  
  2305. def AppendSkillRequirement(self, skillIndex, skillLevel):
  2306.  
  2307. skillMaxLevel = skill.GetSkillMaxLevel(skillIndex)
  2308.  
  2309. if skillLevel >= skillMaxLevel:
  2310. return
  2311.  
  2312. isAppendHorizontalLine = False
  2313.  
  2314. ## Requirement
  2315. if skill.IsSkillRequirement(skillIndex):
  2316.  
  2317. if not isAppendHorizontalLine:
  2318. isAppendHorizontalLine = True
  2319. self.AppendHorizontalLine()
  2320.  
  2321. requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
  2322.  
  2323. color = self.CANNOT_LEVEL_UP_COLOR
  2324. if skill.CheckRequirementSueccess(skillIndex):
  2325. color = self.CAN_LEVEL_UP_COLOR
  2326. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_SKILL_LEVEL % (requireSkillName, requireSkillLevel), color)
  2327.  
  2328. ## Require Stat
  2329. requireStatCount = skill.GetSkillRequireStatCount(skillIndex)
  2330. if requireStatCount > 0:
  2331.  
  2332. for i in xrange(requireStatCount):
  2333. type, level = skill.GetSkillRequireStatData(skillIndex, i)
  2334. if self.POINT_NAME_DICT.has_key(type):
  2335.  
  2336. if not isAppendHorizontalLine:
  2337. isAppendHorizontalLine = True
  2338. self.AppendHorizontalLine()
  2339.  
  2340. name = self.POINT_NAME_DICT[type]
  2341. color = self.CANNOT_LEVEL_UP_COLOR
  2342. if player.GetStatus(type) >= level:
  2343. color = self.CAN_LEVEL_UP_COLOR
  2344. self.AppendTextLine(localeInfo.TOOLTIP_REQUIREMENT_STAT_LEVEL % (name, level), color)
  2345.  
  2346. def HasSkillLevelDescription(self, skillIndex, skillLevel):
  2347. if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
  2348. return True
  2349. if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
  2350. return True
  2351. if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
  2352. return True
  2353.  
  2354. return False
  2355.  
  2356. def AppendMasterAffectDescription(self, index, desc, color):
  2357. self.AppendTextLine(desc, color)
  2358.  
  2359. def AppendNextAffectDescription(self, index, desc):
  2360. self.AppendTextLine(desc, self.DISABLE_COLOR)
  2361.  
  2362. def AppendNeedHP(self, needSP, continuationSP, color):
  2363.  
  2364. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP % (needSP), color)
  2365.  
  2366. if continuationSP > 0:
  2367. self.AppendTextLine(localeInfo.TOOLTIP_NEED_HP_PER_SEC % (continuationSP), color)
  2368.  
  2369. def AppendNeedSP(self, needSP, continuationSP, color):
  2370.  
  2371. if -1 == needSP:
  2372. self.AppendTextLine(localeInfo.TOOLTIP_NEED_ALL_SP, color)
  2373.  
  2374. else:
  2375. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP % (needSP), color)
  2376.  
  2377. if continuationSP > 0:
  2378. self.AppendTextLine(localeInfo.TOOLTIP_NEED_SP_PER_SEC % (continuationSP), color)
  2379.  
  2380. def AppendPartySkillData(self, skillGrade, skillLevel):
  2381.  
  2382. if 1 == skillGrade:
  2383. skillLevel += 19
  2384. elif 2 == skillGrade:
  2385. skillLevel += 29
  2386. elif 3 == skillGrade:
  2387. skillLevel = 40
  2388.  
  2389. if skillLevel <= 0:
  2390. return
  2391.  
  2392. skillIndex = player.SKILL_INDEX_TONGSOL
  2393. slotIndex = player.GetSkillSlotIndex(skillIndex)
  2394. skillPower = player.GetSkillCurrentEfficientPercentage(slotIndex)
  2395. if localeInfo.IsBRAZIL():
  2396. k = skillPower
  2397. else:
  2398. k = player.GetSkillLevel(skillIndex) / 100.0
  2399. self.AppendSpace(5)
  2400. self.AutoAppendTextLine(localeInfo.TOOLTIP_PARTY_SKILL_LEVEL % skillLevel, self.NORMAL_COLOR)
  2401.  
  2402. if skillLevel>=10:
  2403. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_ATTACKER % chop( 10 + 60 * k ))
  2404.  
  2405. if skillLevel>=20:
  2406. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BERSERKER % chop(1 + 5 * k))
  2407. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_TANKER % chop(50 + 1450 * k))
  2408.  
  2409. if skillLevel>=25:
  2410. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_BUFFER % chop(5 + 45 * k ))
  2411.  
  2412. if skillLevel>=35:
  2413. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_SKILL_MASTER % chop(25 + 600 * k ))
  2414.  
  2415. if skillLevel>=40:
  2416. self.AutoAppendTextLine(localeInfo.PARTY_SKILL_DEFENDER % chop( 5 + 30 * k ))
  2417.  
  2418. self.AlignHorizonalCenter()
  2419.  
  2420. def __AppendSummonDescription(self, skillLevel, color):
  2421. if skillLevel > 1:
  2422. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (skillLevel * 10), color)
  2423. elif 1 == skillLevel:
  2424. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (15), color)
  2425. elif 0 == skillLevel:
  2426. self.AppendTextLine(localeInfo.SKILL_SUMMON_DESCRIPTION % (10), color)
  2427.  
  2428.  
  2429. if __name__ == "__main__":
  2430. import app
  2431. import wndMgr
  2432. import systemSetting
  2433. import mouseModule
  2434. import grp
  2435. import ui
  2436.  
  2437. #wndMgr.SetOutlineFlag(True)
  2438.  
  2439. app.SetMouseHandler(mouseModule.mouseController)
  2440. app.SetHairColorEnable(True)
  2441. wndMgr.SetMouseHandler(mouseModule.mouseController)
  2442. wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
  2443. app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
  2444. mouseModule.mouseController.Create()
  2445.  
  2446. toolTip = ItemToolTip()
  2447. toolTip.ClearToolTip()
  2448. #toolTip.AppendTextLine("Test")
  2449. desc = "Item descriptions:|increase of width of display to 35 digits per row AND installation of function that the displayed words are not broken up in two parts, but instead if one word is too long to be displayed in this row, this word will start in the next row."
  2450. summ = ""
  2451.  
  2452. toolTip.AddItemData_Offline(10, desc, summ, 0, 0)
  2453. toolTip.Show()
  2454.  
  2455. app.Loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement