Jump to content

iShadoW

Inactive Member
  • Posts

    35
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by iShadoW

  1. 7 hours ago, Finnael said:

    Try replacing your AppendTextLine function with this:

     

    
    	    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.Show()
    	 
    	        if centerAlign:
    	            textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
    	            textLine.SetHorizontalAlignCenter()
    	 
    	        else:
    	            textLine.SetPosition(10, self.toolTipHeight)
    	 
    	        self.childrenList.append(textLine)
    	 
    	        self.toolTipHeight += self.TEXT_LINE_HEIGHT
    	        self.ResizeToolTip()
    	 
    	        return textLine
    	

    got it , but this is the classic function, and the guy above is right, the longer bonuses will exit tooltip, i tried something with reversed(xrange) but nothing works, anyway is a good fix for anyway if we can get it , it is all about small things ;)

     

    49 minutes ago, valizrt said:

    This function is ok for alignment, but the width of the tooltip will be generated according to the 'Title' text length and if the title text is too short, some longer bonus texts will get out of the tooltip. I tried to set the tooltip width using the longest text but no result so far. Any ideas?

    i'm still trying to resolve :D

  2. Version of Files XXX

    Hi i have a problem with the short textes, the appendtextline align long textes and all below them, but if the first bonus or the title is shorter it doesnt align

     

    GIF

     

    here is the part of code

    		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.Show()
    
    			(textWidth, textHeight)=textLine.GetTextSize()
    
    			textWidth += 55
    			textHeight += 5
    
    			if self.toolTipWidth < textWidth:
    				self.toolTipWidth = textWidth
    
    			self.childrenList.append(textLine)
    			
    			if centerAlign:
    				textLine.SetPosition(self.toolTipWidth/2, self.toolTipHeight)
    				textLine.SetHorizontalAlignCenter()
    			else:
    				textLine.SetPosition(10, self.toolTipHeight)
    
    			
    			self.toolTipHeight += textHeight
    			self.ResizeToolTip()		
    
    			return textLine

     

    	def __AppendAttributeInformation(self, attrSlot, itemAbsChance = 0):
    		if 0 != attrSlot:
    			for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
    				type = attrSlot[i][0]
    				value = attrSlot[i][1]
    				if 0 == value:
    					continue
    
    				affectString = self.__GetAffectString(type, value)
    
    				if app.ENABLE_SASH_SYSTEM:
    					if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_SASH and itemAbsChance:
    						value = self.CalcSashValue(value, itemAbsChance)
    						affectString = self.__GetAffectString(type, value)
    				
    				if affectString:
    					affectColor = self.__GetAttributeColor(i, value)
    					self.AppendTextLine(affectString, affectColor)

     

    Thanks, Sincerly,
    iShadoW

     

  3. On 9/24/2018 at 4:37 PM, [email protected] said:

    Hi Guys!


    I know this post is very old but I usually see this system in some server and I always find a mistake about it.
    Let me explain.
    If you implement this system with the fix that tierrilopes show to us still you won't be able to buff someone if you are in a party and he is not. So you should exit your current party, and give buff to him.
    If you want to fix this bug too, you should go to char_skill.cpp and search for this line:

    
    GetParty()->ForEachOnMapMember(f, GetMapIndex());

    After this line past this condition:
     

    
    //Fix where you should exit your party to buff someone who is not in your party//
    		if (!pkVictim->GetParty())
    			ComputeSkill(dwVnum, pkVictim);

    Finally it should like this:

     

    
    else if (IS_SET(pkSk->dwFlag, SKILL_FLAG_PARTY) && GetParty())
    	{
    		FPartyPIDCollector f;
    		GetParty()->ForEachOnMapMember(f, GetMapIndex());
    		//Fix where you should exit your party to buff someone who is not in your party//
    		if (!pkVictim->GetParty())
    			ComputeSkill(dwVnum, pkVictim);
    		for (std::vector <DWORD>::iterator it = f.vecPIDs.begin(); it != f.vecPIDs.end(); it++)
    		{
    			LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(*it);
    			ComputeSkill(dwVnum, ch);
    		}
    	}

    Compile, and you are done!

    Result:
    For now, you can buff any player and doesn't matter you are in a party or not, but if you are in a party you will buff your teammates with the guy who is not in your team.


    It"s not a large modification, but I think it's useful.


    Sorry for my bad english!
    Best regards!

    it works perfectly, ty 

    • Metin2 Dev 1
  4. Hi , i want to know how could i implement this system

    kRinuLV.jpg?1

    with buttons , i tried someting but doesnt work , cause i need to add some width , and use buttons , but there is an transparent board along inventory , and i dont know how could i put these buttons, and use the belt inventory too , but without transparent board wich can move the inventory 

  5. i have a problem with db source, i add gaya , and cheque but when i create a character or i have one already , he;s part_main and part_base from db with no armor is 127

    look

     O19xvp9.png?1

     

    and my code from db is this:

    	queryLen = snprintf(queryStr, sizeof(queryStr), 
    			"INSERT INTO player%s "
    			"(id, account_id, name, level, st, ht, dx, iq, "
    			"job, voice, dir, x, y, z, "
    
    			"hp, mp, random_hp, random_sp, stat_point, stamina, part_base, part_main, part_hair, part_sash, gold,gaya, cheque, playtime, "
    
    			"skill_level, quickslot) "
    			"VALUES(0, %u, '%s', %d, %d, %d, %d, %d, "
    			"%d, %d, %d, %d, %d, %d, %d, "
    
    			"%d, %d, %d, %d, %d, %d, %d, 0, %d, %d, %d, %d, 0 ",
    			GetTablePostfix(),
    			packet->account_id,
    			packet->player_table.name,
    			packet->player_table.level,
    			packet->player_table.st,
    			packet->player_table.ht,
    			packet->player_table.dx,
    			packet->player_table.iq,
    			packet->player_table.job,
    			packet->player_table.voice,
    			packet->player_table.dir,
    			packet->player_table.x,
    			packet->player_table.y,
    			packet->player_table.z,
    			packet->player_table.hp,
    			packet->player_table.sp,
    			packet->player_table.sRandomHP,
    			packet->player_table.sRandomSP,
    			// packet->player_table.sHorse_appearance,
    			packet->player_table.stat_point,
    			packet->player_table.stamina,
    			packet->player_table.part_base,
    			packet->player_table.part_base,
    			packet->player_table.gold
    			, packet->player_table.gaya
    #ifdef ENABLE_CHEQUE_SYSTEM
    			,packet->player_table.cheque
    #endif
    			);

    and as well when i compile it tell me , there are too many arguments for format

    thank you.

×
×
  • 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.