Guest User

Untitled

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