MosEne

Untitled

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