forked from metin2/client
Added game files from TMP4
This commit is contained in:
@ -90,7 +90,7 @@ class ToolTip(ui.ThinBoard):
|
||||
CANNOT_LEVEL_UP_COLOR = DISABLE_COLOR
|
||||
NEED_SKILL_POINT_COLOR = 0xff9A9CDB
|
||||
|
||||
def __init__(self, width = TOOL_TIP_WIDTH, isPickable=FALSE):
|
||||
def __init__(self, width = TOOL_TIP_WIDTH, isPickable=False):
|
||||
ui.ThinBoard.__init__(self, "TOP_MOST")
|
||||
|
||||
if isPickable:
|
||||
@ -100,7 +100,7 @@ class ToolTip(ui.ThinBoard):
|
||||
|
||||
self.AddFlag("float")
|
||||
|
||||
self.followFlag = TRUE
|
||||
self.followFlag = True
|
||||
self.toolTipWidth = width
|
||||
|
||||
self.xPos = -1
|
||||
@ -153,14 +153,14 @@ class ToolTip(ui.ThinBoard):
|
||||
|
||||
self.ResizeToolTip()
|
||||
|
||||
def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
|
||||
def AutoAppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
|
||||
textLine = ui.TextLine()
|
||||
textLine.SetParent(self)
|
||||
textLine.SetFontName(self.defFontName)
|
||||
textLine.SetPackedFontColor(color)
|
||||
textLine.SetText(text)
|
||||
textLine.SetOutline()
|
||||
textLine.SetFeather(FALSE)
|
||||
textLine.SetFeather(False)
|
||||
textLine.Show()
|
||||
|
||||
if centerAlign:
|
||||
@ -184,14 +184,14 @@ class ToolTip(ui.ThinBoard):
|
||||
|
||||
return textLine
|
||||
|
||||
def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
|
||||
def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
|
||||
textLine = ui.TextLine()
|
||||
textLine.SetParent(self)
|
||||
textLine.SetFontName(self.defFontName)
|
||||
textLine.SetPackedFontColor(color)
|
||||
textLine.SetText(text)
|
||||
textLine.SetOutline()
|
||||
textLine.SetFeather(FALSE)
|
||||
textLine.SetFeather(False)
|
||||
textLine.Show()
|
||||
|
||||
if centerAlign:
|
||||
@ -247,7 +247,7 @@ class ToolTip(ui.ThinBoard):
|
||||
|
||||
return self.ENABLE_COLOR
|
||||
|
||||
def GetChangeTextLineColor(self, value, isSpecial=FALSE):
|
||||
def GetChangeTextLineColor(self, value, isSpecial=False):
|
||||
if value > 0:
|
||||
if isSpecial:
|
||||
return self.SPECIAL_POSITIVE_COLOR
|
||||
@ -460,10 +460,10 @@ class ItemToolTip(ToolTip):
|
||||
def __init__(self, *args, **kwargs):
|
||||
ToolTip.__init__(self, *args, **kwargs)
|
||||
self.itemVnum = 0
|
||||
self.isShopItem = FALSE
|
||||
self.isShopItem = False
|
||||
|
||||
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ǥ<><C7A5><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Disable Color<6F><72> <20><><EFBFBD><EFBFBD> (<28>̹<EFBFBD> <20><EFBFBD><D7B7><EFBFBD> <20>۵<EFBFBD><DBB5>ϰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20>ʿ䰡 <20>־)
|
||||
self.bCannotUseItemForceSetDisableColor = TRUE
|
||||
self.bCannotUseItemForceSetDisableColor = True
|
||||
|
||||
def __del__(self):
|
||||
ToolTip.__del__(self)
|
||||
@ -473,15 +473,15 @@ class ItemToolTip(ToolTip):
|
||||
|
||||
def CanEquip(self):
|
||||
if not item.IsEquipmentVID(self.itemVnum):
|
||||
return TRUE
|
||||
return True
|
||||
|
||||
race = player.GetRace()
|
||||
job = chr.RaceToJob(race)
|
||||
if not self.ANTI_FLAG_DICT.has_key(job):
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
sex = chr.RaceToSex(race)
|
||||
|
||||
@ -489,42 +489,42 @@ class ItemToolTip(ToolTip):
|
||||
FEMALE = 0
|
||||
|
||||
if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == FEMALE:
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
for i in xrange(item.LIMIT_MAX_NUM):
|
||||
(limitType, limitValue) = item.GetLimit(i)
|
||||
|
||||
if item.LIMIT_LEVEL == limitType:
|
||||
if player.GetStatus(player.LEVEL) < limitValue:
|
||||
return FALSE
|
||||
return False
|
||||
"""
|
||||
elif item.LIMIT_STR == limitType:
|
||||
if player.GetStatus(player.ST) < limitValue:
|
||||
return FALSE
|
||||
return False
|
||||
elif item.LIMIT_DEX == limitType:
|
||||
if player.GetStatus(player.DX) < limitValue:
|
||||
return FALSE
|
||||
return False
|
||||
elif item.LIMIT_INT == limitType:
|
||||
if player.GetStatus(player.IQ) < limitValue:
|
||||
return FALSE
|
||||
return False
|
||||
elif item.LIMIT_CON == limitType:
|
||||
if player.GetStatus(player.HT) < limitValue:
|
||||
return FALSE
|
||||
return False
|
||||
"""
|
||||
|
||||
return TRUE
|
||||
return True
|
||||
|
||||
def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = TRUE):
|
||||
def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):
|
||||
if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
|
||||
color = self.DISABLE_COLOR
|
||||
|
||||
return ToolTip.AppendTextLine(self, text, color, centerAlign)
|
||||
|
||||
def ClearToolTip(self):
|
||||
self.isShopItem = FALSE
|
||||
self.isShopItem = False
|
||||
self.toolTipWidth = self.TOOL_TIP_WIDTH
|
||||
ToolTip.ClearToolTip(self)
|
||||
|
||||
@ -551,7 +551,7 @@ class ItemToolTip(ToolTip):
|
||||
|
||||
price = shop.GetItemPrice(slotIndex)
|
||||
self.ClearToolTip()
|
||||
self.isShopItem = TRUE
|
||||
self.isShopItem = True
|
||||
|
||||
metinSlot = []
|
||||
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||
@ -563,6 +563,25 @@ class ItemToolTip(ToolTip):
|
||||
self.AddItemData(itemVnum, metinSlot, attrSlot)
|
||||
self.AppendPrice(price)
|
||||
|
||||
def SetShopItemBySecondaryCoin(self, slotIndex):
|
||||
itemVnum = shop.GetItemID(slotIndex)
|
||||
if 0 == itemVnum:
|
||||
return
|
||||
|
||||
price = shop.GetItemPrice(slotIndex)
|
||||
self.ClearToolTip()
|
||||
self.isShopItem = True
|
||||
|
||||
metinSlot = []
|
||||
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||
metinSlot.append(shop.GetItemMetinSocket(slotIndex, i))
|
||||
attrSlot = []
|
||||
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
|
||||
attrSlot.append(shop.GetItemAttribute(slotIndex, i))
|
||||
|
||||
self.AddItemData(itemVnum, metinSlot, attrSlot)
|
||||
self.AppendPriceBySecondaryCoin(price)
|
||||
|
||||
def SetExchangeOwnerItem(self, slotIndex):
|
||||
itemVnum = exchange.GetItemVnumFromSelf(slotIndex)
|
||||
if 0 == itemVnum:
|
||||
@ -763,14 +782,14 @@ class ItemToolTip(ToolTip):
|
||||
|
||||
def __IsAttr(self, attrSlot):
|
||||
if not attrSlot:
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
|
||||
type = attrSlot[i][0]
|
||||
if 0 != type:
|
||||
return TRUE
|
||||
return True
|
||||
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
def AddRefineItemData(self, itemVnum, metinSlot, attrSlot = 0):
|
||||
for i in xrange(player.METIN_SOCKET_MAX_NUM):
|
||||
@ -804,6 +823,7 @@ class ItemToolTip(ToolTip):
|
||||
name += " "
|
||||
name += localeInfo.NumberToMoneyString(metinSlot[0])
|
||||
self.SetTitle(name)
|
||||
|
||||
self.ShowToolTip()
|
||||
return
|
||||
|
||||
@ -811,6 +831,7 @@ class ItemToolTip(ToolTip):
|
||||
elif 50300 == itemVnum:
|
||||
if 0 != metinSlot:
|
||||
self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILLBOOK_NAME, 1)
|
||||
|
||||
self.ShowToolTip()
|
||||
return
|
||||
elif 70037 == itemVnum:
|
||||
@ -818,6 +839,7 @@ class ItemToolTip(ToolTip):
|
||||
self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
|
||||
self.AppendDescription(item.GetItemDescription(), 26)
|
||||
self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
|
||||
|
||||
self.ShowToolTip()
|
||||
return
|
||||
elif 70055 == itemVnum:
|
||||
@ -825,6 +847,7 @@ class ItemToolTip(ToolTip):
|
||||
self.__SetSkillBookToolTip(metinSlot[0], localeInfo.TOOLTIP_SKILL_FORGET_BOOK_NAME, 0)
|
||||
self.AppendDescription(item.GetItemDescription(), 26)
|
||||
self.AppendDescription(item.GetItemSummary(), 26, self.CONDITION_COLOR)
|
||||
|
||||
self.ShowToolTip()
|
||||
return
|
||||
###########################################################################################
|
||||
@ -900,15 +923,24 @@ class ItemToolTip(ToolTip):
|
||||
else:
|
||||
self.__AppendMetinSlotInfo(metinSlot)
|
||||
|
||||
### Belt Item ###
|
||||
### Ring Slot Item (Not UNIQUE) ###
|
||||
elif item.ITEM_TYPE_RING == itemType:
|
||||
self.__AppendLimitInformation()
|
||||
self.__AppendAffectInformation()
|
||||
self.__AppendAttributeInformation(attrSlot)
|
||||
|
||||
#<23><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ý<EFBFBD><C3BD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ȹ <20><><EFBFBD><EFBFBD>
|
||||
#self.__AppendAccessoryMetinSlotInfo(metinSlot, 99001)
|
||||
|
||||
|
||||
### Belt Item ###
|
||||
elif item.ITEM_TYPE_BELT == itemType:
|
||||
self.__AppendLimitInformation()
|
||||
self.__AppendAffectInformation()
|
||||
self.__AppendAttributeInformation(attrSlot)
|
||||
|
||||
self.__AppendAccessoryMetinSlotInfo(metinSlot, constInfo.GET_BELT_MATERIAL_VNUM(itemVnum))
|
||||
|
||||
|
||||
|
||||
## <20>ڽ<EFBFBD><DABD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ##
|
||||
elif 0 != isCostumeItem:
|
||||
self.__AppendLimitInformation()
|
||||
@ -1163,6 +1195,8 @@ class ItemToolTip(ToolTip):
|
||||
elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
|
||||
self.AppendTimerBasedOnWearLastTime(metinSlot)
|
||||
#dbg.TraceError("1) REAL_TIME flag On ")
|
||||
|
||||
|
||||
|
||||
self.ShowToolTip()
|
||||
|
||||
@ -1304,16 +1338,16 @@ class ItemToolTip(ToolTip):
|
||||
|
||||
def __AppendLimitInformation(self):
|
||||
|
||||
appendSpace = FALSE
|
||||
appendSpace = False
|
||||
|
||||
for i in xrange(item.LIMIT_MAX_NUM):
|
||||
|
||||
(limitType, limitValue) = item.GetLimit(i)
|
||||
|
||||
if limitValue > 0:
|
||||
if FALSE == appendSpace:
|
||||
if False == appendSpace:
|
||||
self.AppendSpace(5)
|
||||
appendSpace = TRUE
|
||||
appendSpace = True
|
||||
|
||||
else:
|
||||
continue
|
||||
@ -1336,6 +1370,17 @@ class ItemToolTip(ToolTip):
|
||||
self.AppendTextLine(localeInfo.TOOLTIP_ITEM_LIMIT_CON % (limitValue), color)
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def __GetAffectString(self, affectType, affectValue):
|
||||
if 0 == affectType:
|
||||
return None
|
||||
@ -1380,15 +1425,15 @@ class ItemToolTip(ToolTip):
|
||||
characterNames += " "
|
||||
characterNames += name
|
||||
|
||||
textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, TRUE)
|
||||
textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
|
||||
textLine.SetFeather()
|
||||
|
||||
if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
|
||||
textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, TRUE)
|
||||
textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
|
||||
textLine.SetFeather()
|
||||
|
||||
if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
|
||||
textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, TRUE)
|
||||
textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
|
||||
textLine.SetFeather()
|
||||
|
||||
def __AppendPotionInformation(self):
|
||||
@ -1447,6 +1492,10 @@ class ItemToolTip(ToolTip):
|
||||
def AppendPrice(self, price):
|
||||
self.AppendSpace(5)
|
||||
self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToMoneyString(price)), self.GetPriceColor(price))
|
||||
|
||||
def AppendPriceBySecondaryCoin(self, price):
|
||||
self.AppendSpace(5)
|
||||
self.AppendTextLine(localeInfo.TOOLTIP_BUYPRICE % (localeInfo.NumberToSecondaryCoinString(price)), self.GetPriceColor(price))
|
||||
|
||||
def AppendSellingPrice(self, price):
|
||||
if item.IsAntiFlag(item.ITEM_ANTIFLAG_SELL):
|
||||
@ -1521,6 +1570,10 @@ class ItemToolTip(ToolTip):
|
||||
return player.METIN_SOCKET_TYPE_GOLD
|
||||
elif "USE_PUT_INTO_ACCESSORY_SOCKET" == item.GetUseType(number):
|
||||
return player.METIN_SOCKET_TYPE_SILVER
|
||||
elif "USE_PUT_INTO_RING_SOCKET" == item.GetUseType(number):
|
||||
return player.METIN_SOCKET_TYPE_SILVER
|
||||
elif "USE_PUT_INTO_BELT_SOCKET" == item.GetUseType(number):
|
||||
return player.METIN_SOCKET_TYPE_SILVER
|
||||
|
||||
return player.METIN_SOCKET_TYPE_NONE
|
||||
|
||||
@ -1736,7 +1789,7 @@ class ItemToolTip(ToolTip):
|
||||
|
||||
class HyperlinkItemToolTip(ItemToolTip):
|
||||
def __init__(self):
|
||||
ItemToolTip.__init__(self, isPickable=TRUE)
|
||||
ItemToolTip.__init__(self, isPickable=True)
|
||||
|
||||
def SetHyperlinkItem(self, tokens):
|
||||
minTokenCount = 3 + player.METIN_SOCKET_MAX_NUM
|
||||
@ -2145,13 +2198,13 @@ class SkillToolTip(ToolTip):
|
||||
if skillLevel >= skillMaxLevel:
|
||||
return
|
||||
|
||||
isAppendHorizontalLine = FALSE
|
||||
isAppendHorizontalLine = False
|
||||
|
||||
## Requirement
|
||||
if skill.IsSkillRequirement(skillIndex):
|
||||
|
||||
if not isAppendHorizontalLine:
|
||||
isAppendHorizontalLine = TRUE
|
||||
isAppendHorizontalLine = True
|
||||
self.AppendHorizontalLine()
|
||||
|
||||
requireSkillName, requireSkillLevel = skill.GetSkillRequirementData(skillIndex)
|
||||
@ -2170,7 +2223,7 @@ class SkillToolTip(ToolTip):
|
||||
if self.POINT_NAME_DICT.has_key(type):
|
||||
|
||||
if not isAppendHorizontalLine:
|
||||
isAppendHorizontalLine = TRUE
|
||||
isAppendHorizontalLine = True
|
||||
self.AppendHorizontalLine()
|
||||
|
||||
name = self.POINT_NAME_DICT[type]
|
||||
@ -2181,13 +2234,13 @@ class SkillToolTip(ToolTip):
|
||||
|
||||
def HasSkillLevelDescription(self, skillIndex, skillLevel):
|
||||
if skill.GetSkillAffectDescriptionCount(skillIndex) > 0:
|
||||
return TRUE
|
||||
return True
|
||||
if skill.GetSkillCoolTime(skillIndex, skillLevel) > 0:
|
||||
return TRUE
|
||||
return True
|
||||
if skill.GetSkillNeedSP(skillIndex, skillLevel) > 0:
|
||||
return TRUE
|
||||
return True
|
||||
|
||||
return FALSE
|
||||
return False
|
||||
|
||||
def AppendMasterAffectDescription(self, index, desc, color):
|
||||
self.AppendTextLine(desc, color)
|
||||
@ -2270,10 +2323,10 @@ if __name__ == "__main__":
|
||||
import grp
|
||||
import ui
|
||||
|
||||
#wndMgr.SetOutlineFlag(TRUE)
|
||||
#wndMgr.SetOutlineFlag(True)
|
||||
|
||||
app.SetMouseHandler(mouseModule.mouseController)
|
||||
app.SetHairColorEnable(TRUE)
|
||||
app.SetHairColorEnable(True)
|
||||
wndMgr.SetMouseHandler(mouseModule.mouseController)
|
||||
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
|
||||
app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
|
||||
|
Reference in New Issue
Block a user