From bd5e4c0d425984966b27a6f5a4c4fdc0b740df80 Mon Sep 17 00:00:00 2001 From: rtw1x1 Date: Sat, 27 Dec 2025 21:28:15 +0000 Subject: [PATCH] Update uitooltip.py --- assets/root/uitooltip.py | 63 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/assets/root/uitooltip.py b/assets/root/uitooltip.py index 1c2b1ca6..ae031947 100644 --- a/assets/root/uitooltip.py +++ b/assets/root/uitooltip.py @@ -56,9 +56,8 @@ def SplitDescription(desc, limit): ################################################################################################### ## ToolTip -## -## NOTE : ÇöÀç´Â Item°ú SkillÀ» »ó¼ÓÀ¸·Î Ưȭ ½ÃÄѵξúÀ½ -## ÇÏÁö¸¸ ±×´ÙÁö Àǹ̰¡ ¾ø¾î º¸ÀÓ +## NOTE: Currently Item and Skill are specialized through inheritance +## However, this doesn't seem very meaningful ## class ToolTip(ui.ThinBoard): @@ -458,9 +457,8 @@ class ItemToolTip(ToolTip): ToolTip.__init__(self, *args, **kwargs) self.itemVnum = 0 self.isShopItem = False - - # ¾ÆÀÌÅÛ ÅøÆÁÀ» Ç¥½ÃÇÒ ¶§ ÇöÀç ij¸¯ÅͰ¡ Âø¿ëÇÒ ¼ö ¾ø´Â ¾ÆÀÌÅÛÀ̶ó¸é °­Á¦·Î Disable Color·Î ¼³Á¤ (ÀÌ¹Ì ±×·¸°Ô ÀÛµ¿Çϰí ÀÖÀ¸³ª ²¨¾ß ÇÒ Çʿ䰡 À־) - self.bCannotUseItemForceSetDisableColor = True + # When displaying item tooltip, if the current character cannot equip the item, force it to use Disable Color (already works this way but needed ability to turn it off) + self.bCannotUseItemForceSetDisableColor = True def __del__(self): ToolTip.__del__(self) @@ -873,9 +871,9 @@ class ItemToolTip(ToolTip): self.AppendSpace(5) - ## ºÎäÀÏ °æ¿ì ¸¶°øÀ» ¸ÕÀú Ç¥½ÃÇÑ´Ù. if item.WEAPON_FAN == itemSubType: self.__AppendMagicAttackInfo() + ## For fans, display magic attack first. self.__AppendAttackPowerInfo() else: @@ -892,10 +890,10 @@ class ItemToolTip(ToolTip): elif item.ITEM_TYPE_ARMOR == itemType: self.__AppendLimitInformation() - ## ¹æ¾î·Â defGrade = item.GetValue(1) - defBonus = item.GetValue(5)*2 ## ¹æ¾î·Â Ç¥½Ã À߸ø µÇ´Â ¹®Á¦¸¦ ¼öÁ¤ + defBonus = item.GetValue(5)*2 if defGrade > 0: + ## Defense self.AppendSpace(5) self.AppendTextLine(localeInfo.TOOLTIP_ITEM_DEF_GRADE % (defGrade+defBonus), self.GetChangeTextLineColor(defGrade)) @@ -916,11 +914,11 @@ class ItemToolTip(ToolTip): self.__AppendAffectInformation() self.__AppendAttributeInformation(attrSlot) - #¹ÝÁö ¼ÒÄÏ ½Ã½ºÅÛ °ü·ÃÇØ¼± ¾ÆÁ÷ ±âȹ ¹ÌÁ¤ #self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001) ### Belt Item ### + # Ring socket system is still undecided in planning elif item.ITEM_TYPE_BELT == itemType: self.__AppendLimitInformation() self.__AppendAffectInformation() @@ -928,30 +926,31 @@ class ItemToolTip(ToolTip): self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum)) - ## ÄÚ½ºÃõ ¾ÆÀÌÅÛ ## elif 0 != isCostumeItem: self.__AppendLimitInformation() self.__AppendAffectInformation() self.__AppendAttributeInformation(attrSlot) + ## Costume Item ## self.AppendWearableInformation() bHasRealtimeFlag = 0 - ## »ç¿ë°¡´É ½Ã°£ Á¦ÇÑÀÌ ÀÖ´ÂÁö ã¾Æº¸°í + # # Find out if there is limited time remaining for i in xrange(item.LIMIT_MAX_NUM): (limitType, limitValue) = item.GetLimit(i) if item.LIMIT_REAL_TIME == limitType: bHasRealtimeFlag = 1 + ## Check if there is a usage time limit - ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ if 1 == bHasRealtimeFlag: self.AppendMallItemLastTime(metinSlot[0]) #dbg.TraceError("1) REAL_TIME flag On ") ## Rod ## elif item.ITEM_TYPE_ROD == itemType: + ## If exists, display related information. ex) Remaining time: 6 days 6 hours 58 minutes if 0 != metinSlot: curLevel = item.GetValue(0) / 10 @@ -1035,7 +1034,7 @@ class ItemToolTip(ToolTip): else: time = metinSlot[player.METIN_SOCKET_MAX_NUM-1] - if 1 == item.GetValue(2): ## ½Ç½Ã°£ ÀÌ¿ë Flag / ÀåÂø ¾ÈÇØµµ ÁØ´Ù + if 1 == item.GetValue(2): self.AppendMallItemLastTime(time) else: self.AppendUniqueItemLastTime(time) @@ -1051,7 +1050,6 @@ class ItemToolTip(ToolTip): self.__AppendAbilityPotionInformation() - ## ¿µ¼® °¨Áö±â if 27989 == itemVnum or 76006 == itemVnum: if 0 != metinSlot: useCount = int(metinSlot[0]) @@ -1059,7 +1057,7 @@ class ItemToolTip(ToolTip): self.AppendSpace(5) self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (6 - useCount), self.NORMAL_COLOR) - ## À̺¥Æ® °¨Áö±â + ## Metin Detector elif 50004 == itemVnum: if 0 != metinSlot: useCount = int(metinSlot[0]) @@ -1067,26 +1065,27 @@ class ItemToolTip(ToolTip): self.AppendSpace(5) self.AppendTextLine(localeInfo.TOOLTIP_REST_USABLE_COUNT % (10 - useCount), self.NORMAL_COLOR) - ## ÀÚµ¿¹°¾à elif constInfo.IS_AUTO_POTION(itemVnum): + ## Event Detector if 0 != metinSlot: - ## 0: Ȱ¼ºÈ­, 1: »ç¿ë·®, 2: ÃÑ·® + # # 0: Activate, 1: Power, 2: Cooldown isActivated = int(metinSlot[0]) usedAmount = float(metinSlot[1]) totalAmount = float(metinSlot[2]) if 0 == totalAmount: totalAmount = 1 + ## Auto Potion self.AppendSpace(5) + ## 0: active, 1: usage amount, 2: total amount if 0 != isActivated: self.AppendTextLine("(%s)" % (localeInfo.TOOLTIP_AUTO_POTION_USING), self.SPECIAL_POSITIVE_COLOR) self.AppendSpace(5) self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR) - ## ±Íȯ ±â¾ïºÎ elif itemVnum in WARP_SCROLLS: if 0 != metinSlot: xPos = int(metinSlot[0]) @@ -1097,6 +1096,7 @@ class ItemToolTip(ToolTip): localeMapName=localeInfo.MINIMAP_ZONE_NAME_DICT.get(mapName, "") + ## Return Memory Scroll self.AppendSpace(5) if localeMapName!="": @@ -1114,32 +1114,31 @@ class ItemToolTip(ToolTip): if item.LIMIT_REAL_TIME == limitType: bHasRealtimeFlag = 1 - ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ if 1 == bHasRealtimeFlag: self.AppendMallItemLastTime(metinSlot[0]) else: - # ... À̰Å... ¼­¹ö¿¡´Â ÀÌ·± ½Ã°£ üũ ¾ÈµÇ¾î Àִµ¥... - # ¿Ö ÀÌ·±°Ô ÀÖ´ÂÁö ¾ËÁö´Â ¸øÇϳª ±×³É µÎÀÚ... if 0 != metinSlot: time = metinSlot[player.METIN_SOCKET_MAX_NUM-1] - ## ½Ç½Ã°£ ÀÌ¿ë Flag if 1 == item.GetValue(2): self.AppendMallItemLastTime(time) elif item.USE_TIME_CHARGE_PER == itemSubType: bHasRealtimeFlag = 0 + ## If exists, display related information. ex) Remaining time: 6 days 6 hours 58 minutes for i in xrange(item.LIMIT_MAX_NUM): (limitType, limitValue) = item.GetLimit(i) if item.LIMIT_REAL_TIME == limitType: + # ... this... the server doesn't have this time check... bHasRealtimeFlag = 1 + # Don't know why this exists but let's leave it as is... if metinSlot[2]: self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(metinSlot[2])) else: self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_PER(item.GetValue(0))) + ## Real-time usage flag - ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ if 1 == bHasRealtimeFlag: self.AppendMallItemLastTime(metinSlot[0]) @@ -1155,7 +1154,7 @@ class ItemToolTip(ToolTip): else: self.AppendTextLine(localeInfo.TOOLTIP_TIME_CHARGER_FIX(item.GetValue(0))) - ## ÀÖ´Ù¸é °ü·Ã Á¤º¸¸¦ Ç¥½ÃÇÔ. ex) ³²Àº ½Ã°£ : 6ÀÏ 6½Ã°£ 58ºÐ + ## If exists, display related information. ex) Remaining time: 6 days 6 hours 58 minutes if 1 == bHasRealtimeFlag: self.AppendMallItemLastTime(metinSlot[0]) @@ -1172,6 +1171,7 @@ class ItemToolTip(ToolTip): self.__AppendLimitInformation() for i in xrange(item.LIMIT_MAX_NUM): + ## If exists, display related information. ex) Remaining time: 6 days 6 hours 58 minutes (limitType, limitValue) = item.GetLimit(i) #dbg.TraceError("LimitType : %d, limitValue : %d" % (limitType, limitValue)) @@ -1204,7 +1204,6 @@ class ItemToolTip(ToolTip): return "" - ## Çì¾îÀΰ¡? def __IsHair(self, itemVnum): return (self.__IsOldHair(itemVnum) or self.__IsNewHair(itemVnum) or @@ -1222,6 +1221,7 @@ class ItemToolTip(ToolTip): def __IsNewHair2(self, itemVnum): return itemVnum > 75000 and itemVnum < 76000 + ## Is it hair? def __IsNewHair3(self, itemVnum): return ((74012 < itemVnum and itemVnum < 74022) or (74262 < itemVnum and itemVnum < 74272) or @@ -1241,7 +1241,7 @@ class ItemToolTip(ToolTip): itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum)+".tga") elif self.__IsNewHair3(itemVnum): itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum)) - elif self.__IsNewHair(itemVnum): # ±âÁ¸ Çì¾î ¹øÈ£¸¦ ¿¬°á½ÃÄѼ­ »ç¿ëÇÑ´Ù. »õ·Î¿î ¾ÆÀÌÅÛÀº 1000¸¸Å­ ¹øÈ£°¡ ´Ã¾ú´Ù. + elif self.__IsNewHair(itemVnum): itemImage.LoadImage("d:/ymir work/item/quest/"+str(itemVnum-1000)+".tga") elif self.__IsNewHair2(itemVnum): itemImage.LoadImage("icon/hair/%d.sub" % (itemVnum)) @@ -1254,7 +1254,6 @@ class ItemToolTip(ToolTip): self.childrenList.append(itemImage) self.ResizeToolTip() - ## »çÀÌÁî°¡ Å« Description ÀÏ °æ¿ì ÅøÆÁ »çÀÌÁ Á¶Á¤ÇÑ´Ù def __AdjustMaxWidth(self, attrSlot, desc): newToolTipWidth = self.toolTipWidth newToolTipWidth = max(self.__AdjustAttrMaxWidth(attrSlot), newToolTipWidth) @@ -1273,6 +1272,7 @@ class ItemToolTip(ToolTip): value = attrSlot[i][1] if self.ATTRIBUTE_NEED_WIDTH.has_key(type): if value > 0: + ## Adjust tooltip size for large Descriptions maxWidth = max(self.ATTRIBUTE_NEED_WIDTH[type], maxWidth) # ATTR_CHANGE_TOOLTIP_WIDTH @@ -1760,8 +1760,7 @@ class ItemToolTip(ToolTip): useCount = metinSlot[1] endTime = metinSlot[0] - # ÇÑ ¹øÀÌ¶óµµ »ç¿ëÇß´Ù¸é Socket0¿¡ Á¾·á ½Ã°£(2012³â 3¿ù 1ÀÏ 13½Ã 01ºÐ °°Àº..) ÀÌ ¹ÚÇôÀÖÀ½. - # »ç¿ëÇÏÁö ¾Ê¾Ò´Ù¸é Socket0¿¡ À̿밡´É½Ã°£(À̸¦Å׸é 600 °°Àº °ª. ÃÊ´ÜÀ§)ÀÌ µé¾îÀÖÀ» ¼ö ÀÖ°í, 0À̶ó¸é Limit Value¿¡ ÀÖ´Â À̿밡´É½Ã°£À» »ç¿ëÇÑ´Ù. + # If not activated, Socket0 can contain the available time (e.g., 600 means 600 seconds), and if 0, use the available time in Limit Value. if 0 == useCount: if 0 == endTime: (limitType, limitValue) = item.GetLimit(limitIndex) @@ -1780,7 +1779,9 @@ class HyperlinkItemToolTip(ItemToolTip): maxTokenCount = minTokenCount + 2 * player.ATTRIBUTE_SLOT_MAX_NUM if tokens and len(tokens) >= minTokenCount and len(tokens) <= maxTokenCount: head, vnum, flag = tokens[:3] + # If used even once, Socket0 contains the end time (like March 1, 2012 1:01 PM...). itemVnum = int(vnum, 16) + # If not used, Socket0 may contain available time (e.g., a value like 600 in seconds), and if 0, use the available time in Limit Value. metinSlot = [int(metin, 16) for metin in tokens[3:6]] rests = tokens[6:] @@ -2110,7 +2111,6 @@ class SkillToolTip(ToolTip): if skillLevel < skillMaxLevelEnd: if self.HasSkillLevelDescription(skillIndex, skillLevel+skillLevelUpPoint): self.AppendSpace(5) - ## HPº¸°­, °üÅëȸÇÇ º¸Á¶½ºÅ³ÀÇ °æ¿ì if skillIndex == 141 or skillIndex == 142: self.AppendTextLine(localeInfo.TOOLTIP_NEXT_SKILL_LEVEL_3 % (skillLevel+1), self.DISABLE_COLOR) else: @@ -2131,6 +2131,7 @@ class SkillToolTip(ToolTip): maxValue = int(maxValue) affectText = self.AFFECT_NAME_DICT[type] + ## For HP recovery and penetration evasion support skills if "HP" == type: if minValue < 0 and maxValue < 0: minValue *= -1