Jump to content

Recommended Posts

  • Management

Hello,

How can I put 2 bonus on the spirit stones?

I put 2 bonus, but only the first one shows on the ToolTip, but both bonus are applied (checked using the state command)

Thanks

  • Love 1

raw

raw

Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/
Share on other sites

  • Premium

    def AppendMetinInformation(self):
        affectType, affectValue = item.GetAffect(0)
        affectString = self.__GetAffectString(affectType, affectValue)

        if affectString:
            self.AppendSpace(5)
            self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))

  • Love 1
Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-100386
Share on other sites

  • Management
2 minutes ago, WeedHex said:

    def AppendMetinInformation(self):
        affectType, affectValue = item.GetAffect(0)
        affectString = self.__GetAffectString(affectType, affectValue)

        if affectString:
            self.AppendSpace(5)
            self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))

But, how can I edit that to show 2 bonus?

I only pretend on some stones, not all...

raw

raw

Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-100388
Share on other sites

  • Premium
  • Solution

    def AppendMetinInformation(self):
        for i in xrange(item.ITEM_APPLY_MAX_NUM):
            (affectType, affectValue) = item.GetAffect(i)

            affectString = self.__GetAffectString(affectType, affectValue)
            if affectString:
                self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))

 

TRY LIKE THIS

  • Love 2
Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-100390
Share on other sites

  • Management
5 minutes ago, WeedHex said:

    def AppendMetinInformation(self):
        for i in xrange(item.ITEM_APPLY_MAX_NUM):
            (affectType, affectValue) = item.GetAffect(i)

            affectString = self.__GetAffectString(affectType, affectValue)
            if affectString:
                self.AppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))

 

TRY LIKE THIS

dIH3ukhdSTi6GRHyXg_j7A.png

Thanks man!!!

Edited by Metin2 Dev
Core X - External 2 Internal

raw

raw

Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-100392
Share on other sites

  • Active Member
	def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):

		slotType = self.GetMetinSocketType(metinSlotData)
		itemIndex = self.GetMetinItemIndex(metinSlotData)

		if 0 == slotType:
			return

		self.AppendSpace(5)

		slotImage = ui.ImageBox()
		slotImage.SetParent(self)
		slotImage.Show()

		## Name
		nameTextLine = ui.TextLine()
		nameTextLine.SetParent(self)
		nameTextLine.SetFontName(self.defFontName)
		nameTextLine.SetPackedFontColor(self.NORMAL_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 localeInfo.IsARABIC():
			slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
			nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
		else:
			slotImage.SetPosition(9, self.toolTipHeight-1)
			nameTextLine.SetPosition(50, self.toolTipHeight + 2)

		metinImage = ui.ImageBox()
		metinImage.SetParent(self)
		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())
				)

			nameTextLine.SetText(item.GetItemName())
			
			## Affect		
			affectTextLine = ui.TextLine()
			affectTextLine.SetParent(self)
			affectTextLine.SetFontName(self.defFontName)
			affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
			affectTextLine.SetOutline()
			affectTextLine.SetFeather()
			affectTextLine.Show()

			affectTextLine1 = ui.TextLine()
			affectTextLine1.SetParent(self)
			affectTextLine1.SetFontName(self.defFontName)
			affectTextLine1.SetPackedFontColor(self.POSITIVE_COLOR)
			affectTextLine1.SetOutline()
			affectTextLine1.SetFeather()
			affectTextLine1.Show()			
				
			if localeInfo.IsARABIC():
				metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
				affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
			else:
				metinImage.SetPosition(10, self.toolTipHeight)
				affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
				
			if localeInfo.IsARABIC():
				metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
				affectTextLine1.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 31 + 2)
			else:
				metinImage.SetPosition(10, self.toolTipHeight)
				affectTextLine1.SetPosition(50, self.toolTipHeight + 31 + 2)
							
			if custumAffectString:
				affectTextLine.SetText(custumAffectString)
			elif itemIndex!=constInfo.ERROR_METIN_STONE:
				affectType, affectValue = item.GetAffect(0)
				affectString = self.__GetAffectString(affectType, affectValue)
				if affectString:
					affectTextLine.SetText(affectString)
			else:
				affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
				
			if itemIndex!=constInfo.ERROR_METIN_STONE:
				affectType1, affectValue1 = item.GetAffect(1)
				affectString1 = self.__GetAffectString(affectType1, affectValue1)
				if affectString1:
					affectTextLine1.SetText(affectString1)
			
			self.childrenList.append(affectTextLine)
			self.childrenList.append(affectTextLine1)			

			if custumAffectString2:
				affectTextLine = ui.TextLine()
				affectTextLine.SetParent(self)
				affectTextLine.SetFontName(self.defFontName)
				affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
				affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
				affectTextLine.SetOutline()
				affectTextLine.SetFeather()
				affectTextLine.Show()
				affectTextLine.SetText(custumAffectString2)
				self.childrenList.append(affectTextLine)
				self.toolTipHeight += 16 + 2

			if 0 != leftTime:
				timeText = (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 + 16 + 2 + 16 + 2)
				timeTextLine.SetOutline()
				timeTextLine.SetFeather()
				timeTextLine.Show()
				timeTextLine.SetText(timeText)
				self.childrenList.append(timeTextLine)
				self.toolTipHeight += 16 + 2

		else:
			nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)

		self.toolTipHeight += 40
		self.ResizeToolTip()

You'll need this too ;) It is for the refine & attach stone windows.

  • Love 3
Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-100396
Share on other sites

  • Management
6 minutes ago, Sonitex said:

You'll need this too ;) It is for the refine & attach stone windows.

You're right man :D

ebVMvCNYTvO64RCEysg_Ow.png

Thank you!!!

Edited by Metin2 Dev
Core X - External 2 Internal

raw

raw

Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-100397
Share on other sites

  • 8 years later...
On 4/3/2018 at 9:07 PM, Sonitex said:
	def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):

		slotType = self.GetMetinSocketType(metinSlotData)
		itemIndex = self.GetMetinItemIndex(metinSlotData)

		if 0 == slotType:
			return

		self.AppendSpace(5)

		slotImage = ui.ImageBox()
		slotImage.SetParent(self)
		slotImage.Show()

		## Name
		nameTextLine = ui.TextLine()
		nameTextLine.SetParent(self)
		nameTextLine.SetFontName(self.defFontName)
		nameTextLine.SetPackedFontColor(self.NORMAL_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 localeInfo.IsARABIC():
			slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
			nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
		else:
			slotImage.SetPosition(9, self.toolTipHeight-1)
			nameTextLine.SetPosition(50, self.toolTipHeight + 2)

		metinImage = ui.ImageBox()
		metinImage.SetParent(self)
		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())
				)

			nameTextLine.SetText(item.GetItemName())
			
			## Affect		
			affectTextLine = ui.TextLine()
			affectTextLine.SetParent(self)
			affectTextLine.SetFontName(self.defFontName)
			affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
			affectTextLine.SetOutline()
			affectTextLine.SetFeather()
			affectTextLine.Show()

			affectTextLine1 = ui.TextLine()
			affectTextLine1.SetParent(self)
			affectTextLine1.SetFontName(self.defFontName)
			affectTextLine1.SetPackedFontColor(self.POSITIVE_COLOR)
			affectTextLine1.SetOutline()
			affectTextLine1.SetFeather()
			affectTextLine1.Show()			
				
			if localeInfo.IsARABIC():
				metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
				affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
			else:
				metinImage.SetPosition(10, self.toolTipHeight)
				affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
				
			if localeInfo.IsARABIC():
				metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
				affectTextLine1.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 31 + 2)
			else:
				metinImage.SetPosition(10, self.toolTipHeight)
				affectTextLine1.SetPosition(50, self.toolTipHeight + 31 + 2)
							
			if custumAffectString:
				affectTextLine.SetText(custumAffectString)
			elif itemIndex!=constInfo.ERROR_METIN_STONE:
				affectType, affectValue = item.GetAffect(0)
				affectString = self.__GetAffectString(affectType, affectValue)
				if affectString:
					affectTextLine.SetText(affectString)
			else:
				affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
				
			if itemIndex!=constInfo.ERROR_METIN_STONE:
				affectType1, affectValue1 = item.GetAffect(1)
				affectString1 = self.__GetAffectString(affectType1, affectValue1)
				if affectString1:
					affectTextLine1.SetText(affectString1)
			
			self.childrenList.append(affectTextLine)
			self.childrenList.append(affectTextLine1)			

			if custumAffectString2:
				affectTextLine = ui.TextLine()
				affectTextLine.SetParent(self)
				affectTextLine.SetFontName(self.defFontName)
				affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
				affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
				affectTextLine.SetOutline()
				affectTextLine.SetFeather()
				affectTextLine.Show()
				affectTextLine.SetText(custumAffectString2)
				self.childrenList.append(affectTextLine)
				self.toolTipHeight += 16 + 2

			if 0 != leftTime:
				timeText = (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 + 16 + 2 + 16 + 2)
				timeTextLine.SetOutline()
				timeTextLine.SetFeather()
				timeTextLine.Show()
				timeTextLine.SetText(timeText)
				self.childrenList.append(timeTextLine)
				self.toolTipHeight += 16 + 2

		else:
			nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)

		self.toolTipHeight += 40
		self.ResizeToolTip()

You'll need this too ;) It is for the refine & attach stone windows.

i tried to make triple bonus by your work but it doesnt work.. what did i do wrong?

 

edit: i found the issue in seconds ive posted..

affectTextLine1 > affectTextLine2

Quote

    def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):

        slotType = self.GetMetinSocketType(metinSlotData)
        itemIndex = self.GetMetinItemIndex(metinSlotData)

        if 0 == slotType:
            return

        self.AppendSpace(5)

        slotImage = ui.ImageBox()
        slotImage.SetParent(self)
        slotImage.Show()

        ## Name
        nameTextLine = ui.TextLine()
        nameTextLine.SetParent(self)
        nameTextLine.SetFontName(self.defFontName)
        nameTextLine.SetPackedFontColor(self.NORMAL_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 localeInfo.IsARABIC():
            slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
            nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
        else:
            slotImage.SetPosition(9, self.toolTipHeight-1)
            nameTextLine.SetPosition(50, self.toolTipHeight + 2)

        metinImage = ui.ImageBox()
        metinImage.SetParent(self)
        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())
                )

            nameTextLine.SetText(item.GetItemName())
            
            ## Affect        
            affectTextLine = ui.TextLine()
            affectTextLine.SetParent(self)
            affectTextLine.SetFontName(self.defFontName)
            affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
            affectTextLine.SetOutline()
            affectTextLine.SetFeather()
            affectTextLine.Show()

            affectTextLine1 = ui.TextLine()
            affectTextLine1.SetParent(self)
            affectTextLine1.SetFontName(self.defFontName)
            affectTextLine1.SetPackedFontColor(self.POSITIVE_COLOR)
            affectTextLine1.SetOutline()
            affectTextLine1.SetFeather()
            affectTextLine1.Show()        
            
            affectTextLine2 = ui.TextLine()
            affectTextLine2.SetParent(self)
            affectTextLine2.SetFontName(self.defFontName)
            affectTextLine2.SetPackedFontColor(self.POSITIVE_COLOR)
            affectTextLine2.SetOutline()
            affectTextLine2.SetFeather()
            affectTextLine2.Show()                
                
            if localeInfo.IsARABIC():
                metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
                affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
            else:
                metinImage.SetPosition(10, self.toolTipHeight)
                affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
                
            if localeInfo.IsARABIC():
                metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
                affectTextLine1.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 31 + 2)
            else:
                metinImage.SetPosition(10, self.toolTipHeight)
                affectTextLine1.SetPosition(50, self.toolTipHeight + 31 + 2)
                
            if localeInfo.IsARABIC():
                metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
                affectTextLine2.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 46 + 2)
            else:
                metinImage.SetPosition(10, self.toolTipHeight)
                affectTextLine2.SetPosition(50, self.toolTipHeight + 46 + 2)
                            
            if custumAffectString:
                affectTextLine.SetText(custumAffectString)
            elif itemIndex!=constInfo.ERROR_METIN_STONE:
                affectType, affectValue = item.GetAffect(0)
                affectString = self.__GetAffectString(affectType, affectValue)
                if affectString:
                    affectTextLine.SetText(affectString)
            else:
                affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
                
            if itemIndex!=constInfo.ERROR_METIN_STONE:
                affectType1, affectValue1 = item.GetAffect(1)
                affectString1 = self.__GetAffectString(affectType1, affectValue1)
                if affectString1:
                    affectTextLine1.SetText(affectString1)
                    
            if itemIndex!=constInfo.ERROR_METIN_STONE:
                affectType2, affectValue2 = item.GetAffect(2)
                affectString2 = self.__GetAffectString(affectType2, affectValue2)
                if affectString2:
                    affectTextLine1.SetText(affectString2)
            
            self.childrenList.append(affectTextLine)
            self.childrenList.append(affectTextLine1)        
            self.childrenList.append(affectTextLine2)            

            if custumAffectString2:
                affectTextLine = ui.TextLine()
                affectTextLine.SetParent(self)
                affectTextLine.SetFontName(self.defFontName)
                affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
                affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
                affectTextLine.SetOutline()
                affectTextLine.SetFeather()
                affectTextLine.Show()
                affectTextLine.SetText(custumAffectString2)
                self.childrenList.append(affectTextLine)
                self.toolTipHeight += 16 + 2

            if 0 != leftTime:
                timeText = (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 + 16 + 2 + 16 + 2)
                timeTextLine.SetOutline()
                timeTextLine.SetFeather()
                timeTextLine.Show()
                timeTextLine.SetText(timeText)
                self.childrenList.append(timeTextLine)
                self.toolTipHeight += 16 + 2

        else:
            nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)

        self.toolTipHeight += 60
        self.ResizeToolTip()

 

Edited by asdasd1234
  • Love 1
Link to comment
https://metin2.dev/topic/18376-2-bonus-on-stones/#findComment-176007
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.