uitooltip.py:
Kod
#Arat;
def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
#Komple değiştir;
def __AppendAccessoryMetinSlotInfo(self, metinSlot, mtrlVnum):
ACCESSORY_SOCKET_MAX_SIZE = 3
cur=min(metinSlot[0], ACCESSORY_SOCKET_MAX_SIZE)
end=min(metinSlot[1], ACCESSORY_SOCKET_MAX_SIZE)
affectType1, affectValue1 = item.GetAffect(0)
affectType2, affectValue2 = item.GetAffect(1)
affectType3, affectValue3 = item.GetAffect(2)
mtrlPos=0
mtrlList=[mtrlVnum]*cur+[player.METIN_SOCKET_TYPE_SILVER]*(end-cur)
attr_total = [0,0,0]
height = self.toolTipHeight
for mtrl in mtrlList:
affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
affectList3=[0, max(1, affectValue3*10/100), max(2, affectValue3*20/100), max(3, affectValue3*40/100)]
affectString1 = self.__GetAffectString(affectType1, affectList1[mtrlPos+1])
affectString2 = self.__GetAffectString(affectType2, affectList2[mtrlPos+1])
affectString3 = self.__GetAffectString(affectType3, affectList3[mtrlPos+1])
if mtrl > 1:
if affectString1:
attr_total[0] += affectList1[mtrlPos+1]
if affectString2:
attr_total[1] += affectList2[mtrlPos+1]
if affectString3:
attr_total[2] += affectList3[mtrlPos+1]
leftTime = 0
if cur == mtrlPos+1:
leftTime=metinSlot[2]
self.__AppendMetinSlotInfo_AppendMetinSocketData_New(mtrlPos, mtrl, height, end, leftTime)
mtrlPos+=1
if end > 0:
if end > 4:
self.toolTipHeight += 70
else:
self.toolTipHeight += 50
self.ResizeToolTip()
affectString11 = self.__GetAffectString(affectType1, attr_total[0])
affectString22 = self.__GetAffectString(affectType2, attr_total[1])
affectString33 = self.__GetAffectString(affectType3, attr_total[2])
self.AppendSpace(5)
if affectString11:
self.AppendTextLine(affectString11, self.POSITIVE_COLOR)
if affectString22:
self.AppendTextLine(affectString22, self.POSITIVE_COLOR)
if affectString33:
self.AppendTextLine(affectString33, self.POSITIVE_COLOR)
self.ResizeToolTip()
#Arat;
def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
#Üstüne ekle;
def __AppendMetinSlotInfo_AppendMetinSocketData_New(self, index, metinSlotData, height=0, end=0, leftTime=0):
slotType = self.GetMetinSocketType(metinSlotData)
itemIndex = self.GetMetinItemIndex(metinSlotData)
if 0 == slotType:
return
slotImage = ui.ImageBox()
slotImage.SetParent(self)
slotImage.Show()
## Name
nameTextLine = ui.TextLine()
nameTextLine.SetParent(self)
nameTextLine.SetFontName(self.defFontName)
nameTextLine.SetPackedFontColor(self.CONDITION_COLOR)
nameTextLine.SetOutline()
nameTextLine.SetFeather()
nameTextLine.Show()
self.childrenList.append(nameTextLine)
if player.METIN_SOCKET_TYPE_SILVER == slotType:
slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
elif player.METIN_SOCKET_TYPE_GOLD == slotType:
slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
self.childrenList.append(slotImage)
if index > 3:
height += 35
index = index-4
if end > 4:
end = 4
calc_x = (self.toolTipWidth/2) - (17.5*end)
slotImage.SetPosition(calc_x+index*40, height +20)
nameTextLine.SetPosition(50, self.toolTipHeight)
metinImage = ui.ImageBox()
metinImage.SetParent(slotImage)
metinImage.Show()
self.childrenList.append(metinImage)
if itemIndex:
item.SelectItem(itemIndex)
## Image
try:
metinImage.LoadImage(item.GetIconImageFileName())
except:
dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
(itemIndex, item.GetIconImageFileName())
)
metinImage.SetPosition(1, 1)
nameTextLine.SetText(item.GetItemName())
if 0 != leftTime:
timeText = ("|cffFFD700" + localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
timeTextLine = ui.TextLine()
timeTextLine.SetParent(self)
timeTextLine.SetFontName(self.defFontName)
timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
timeTextLine.SetPosition(50, self.toolTipHeight + 55)
timeTextLine.SetOutline()
timeTextLine.SetFeather()
timeTextLine.Show()
timeTextLine.SetText(timeText)
self.childrenList.append(timeTextLine)
self.toolTipHeight += 16 + 2
Daha Çok Göster
nameTextLine.SetPosition(50, self.toolTipHeight) // bu cevher isminin konumu kendine göre ayarla
timeTextLine.SetPosition(50, self.toolTipHeight + 55) // bu sürenin konumu kendine göre ayarla
affectList1=[0, max(1, affectValue1*10/100), max(2, affectValue1*20/100), max(3, affectValue1*40/100)]
affectList2=[0, max(1, affectValue2*10/100), max(2, affectValue2*20/100), max(3, affectValue2*40/100)]
affectList3=[0, max(1, affectValue3*10/100), max(2, affectValue3*20/100), max(3, affectValue3*40/100)]
// bunlarda itemin kendisindeki efsunlardan yüzdesel olarak ne kadarını alacağını ayarla fazla özellik versin istemiyorsan düşür.