Jump to content

Shang

Member
  • Posts

    276
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by Shang

  1. 45 minutes ago, VegaS said:

     

    
    		s_Color = [0xffFFC700, 0xffFFC700]
    		if (12010 <= itemVnum and itemVnum <= 12019):				# 12010 | 12011 | 12012 | 12013 | 12014 | 12015 | 12016 | 12017 | 12018 | 12019
    			self.AppendTextLine("Description for item 12019 <= 12019!", s_Color[0])
    		if (1 <= itemVnum and itemVnum <= 20009):				# 1 | 2 | 3 | 4 | 5 etc  etc...max 20009
    			self.AppendTextLine("Description for all items!", s_Color[1])

     

    		if (12010 <= itemVnum and itemVnum <= 12019):				# 12010 | 12011 | 12012 | 12013 | 12014 | 12015 | 12016 | 12017 | 12018 | 12019
    
    		if (1 <= itemVnum and itemVnum <= 20009):				# 1 | 2 | 3 | 4 | 5 etc  etc...max 20009

    Hmm... 12010 <= it checks values less than 12010 too. The same with the other conditional.

  2. 1 minute ago, MrLibya said:

    open your eyes

    and slotNumber in self.listUnusableSlot:

     

    Look at your shit code bro. If the slotnumber isn't in the list and the slot have to be usable?

    If you delete this: and slotNumber in self.listUnusableSlot:  you'll see working anyway.

  3. 36 minutes ago, OceanusPT said:

     

    i belive this will work with txt. Cuz there u can mark itens with  ANTIFLAG_GIVE but its complicate do set this in mysql, right?

    Man, when server loads the txt it converts string to numbers (like mysql) ANTIFLAG_GIVE is an antiflag number.

  4. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Hi devs, today i'm going to release a simple TextLink. It works like a button but without a button, only with text. Let's see.

    Spoiler

    224034875dbfdab37a4a4e8f019173b9dedfef.g

     

    It has Close event.

    The python code:

    Spoiler

    class TextLink(ui.Window):

        ## COLORS
        NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0)
        OVER_COLOR = 0xff1457c7
        DOWN_COLOR = 0xff0f3e8c
        
        def __init__(self):
            ui.Window.__init__(self)
            
            self.eventFunc = None
            self.eventArgs = None
            
            self.text = ui.TextLine()
            self.text.SetParent(self)
            self.text.Show()

            self.underline = ui.Line()
            self.underline.SetParent(self)
            self.underline.SetColor(self.NORMAL_COLOR)
            self.underline.Hide()
            
        def __del__(self):
            ui.Window.__del__(self)
            
        def SetText(self, text):
            self.text.SetText(text)
            self.SetSize(self.text.GetTextSize()[0], self.text.GetTextSize()[1])
            self.underline.SetPosition(0, self.text.GetTextSize()[1])
            self.underline.SetWindowHorizontalAlignCenter()
            self.underline.SetSize(self.text.GetTextSize()[0], 0)
            
        def OnMouseOverIn(self):
            self.text.SetPackedFontColor(self.OVER_COLOR)
            self.underline.SetColor(self.OVER_COLOR)
            self.underline.Show()
            
        def OnMouseOverOut(self):
            self.text.SetPackedFontColor(self.NORMAL_COLOR)
            self.underline.Hide()
            
        def OnMouseLeftButtonDown(self):
            self.text.SetPackedFontColor(self.DOWN_COLOR)
            self.underline.SetColor(self.DOWN_COLOR)
            self.underline.Show()
            
        def OnMouseLeftButtonUp(self):
            if self.eventFunc:
                apply(self.eventFunc, self.eventArgs)
            self.OnMouseOverOut()
                
        def SetEvent(self, event, *args):
            self.eventFunc = event
            self.eventArgs = args

    Shitty spoiler deletes the tabs. Be carefull about tabs. Or go to pastebin: http://pastebin.com/CkNXmeAm

    • Metin2 Dev 7
    • Lmao 1
    • Love 8
  5. item.set_attribute_type already exists with name item.set_value.

    Syntax: item.set_value(num(0,6), type, value)

    item.get_attr here you have @PACI's function:

    Spoiler
    
    	int item_get_attribute(lua_State* L)
    	{
    		LPITEM item = CQuestManager::instance().GetCurrentItem();
    
    		// If there's no item, it'll return 0
    		if (!item)
    		{
    
    			lua_pushnumber(L, 0);
    			return 1;
    		}
    
    		// If the function argument isn't a number, returns a syserr error
    		if (!lua_isnumber(L, 1))
    		{
    			sys_err("item_get_attr_type error!! index must be a number");
    
    			return 1;
    		}
    
    		// Saves the attribute type and value in integer variables
    		int attrType = item->GetAttributeType(lua_tonumber(L,1)); 
    		int attrValue = item->GetAttributeValue(lua_tonumber(L,1));
      
    		// Creates a lua table
    		lua_newtable( L );
    
    		// Gets and inserts the item attribute type into the lua table
    		lua_pushnumber(L, attrType);
    		lua_rawseti(L, -2, 1);
    
    		// Gets and inserts the item attribute value into the lua table
    		lua_pushnumber(L, attrValue);
    		lua_rawseti(L, -2, 2);
    
    		return 1;
    	}
    
    
    			{ "get_attr",		item_get_attribute}

    Syntax:

    item.get_attr(num(0,6))[1] - gets the bonus type

    item.get_attr(num(0,6))[2] - gets the bonus value

  6. To ban sashes in guildstorage put the vnums of sashed inside this table in quest:

    local blackListItem = {50821,50822,50823,50824,50825,50826,51002}

    And replace def OverInItem with this:

    def OverInItem(self, index):
            items = constInfo.GUILDSTORAGE["slots"]["TAB"+str(self.tab)]
            attrs = [(items[index][8],items[index][9]),(items[index][10],items[index][11]),(items[index][12],items[index][13]),(items[index][14],items[index][15]),(items[index][16],items[index][17]),(items[index][18],items[index][19]),(items[index][20],items[index][21])]
            attrs += [(0,0)]*8
            self.toolTip.ClearToolTip()
            self.toolTip.AddRefineItemData(items[index][0], [items[index][2],items[index][3],items[index][4],items[index][5],items[index][6],items[index][7]], attrs)

    Tell if works.

    • Love 2
  7. 41 minutes ago, kodepiko said:

    Hello,
    I'm trying to add MouseIn tooltip to ImageBox at uiRefine.py
    (I want hover tooltip with item description on refine materials icon for ex. red pearl etc)

    I try this code at AppendMaterial()

    
    
    	slot = self.__MakeSlot()
    
    	        slot.SetParent(self)
    
    	        slot.SetPosition(15, self.dialogHeight)
    
    
    

            itemImage = self.__MakeItemImage()         itemImage.SetParent(slot)         item.SelectItem(vnum)         itemImage.LoadImage(item.GetIconImageFileName())

            # self.itemImage = itemImage # this is defined somewhere else         self.itemImage.OnMouseOverIn(self.ShowTip())         self.itemImage.OnMouseOverOut(self.HideTip())

     

    I init tooltip at def Open():

    
    
    	self.txttooltip = uiToolTip.ToolTip()
    
    	self.txttooltip.HideToolTip()
    
    
    
     

    but get syserr:

     

    
    
    	0529 13:54:42313 :: TypeError
    
    	0529 13:54:42313 :: : 
    
    	0529 13:54:42313 :: OnMouseOverIn() takes exactly 1 argument (2 given)
    
    	0529 13:54:42313 :: 
    
    
    
     

    When I do self.itemImage.OnMouseOverIn = self.ShowTip() syserr is clear but there's no tooltip, so I think it's bad use of this function

    My defs:

    
    
    	def ShowTip(self):
    
    	        self.txttooltip.ClearToolTip()
    
    	        self.txttooltip.AppendTextLine("Description")
    
    	        self.txttooltip.Show()
    
    	        
    
    	def HideTip(self):
    
    	        self.txttooltip.Hide()
    
    
    
     

    Anyone know how to do this?
    Greetings.

    self.itemImage.OnMouseOverIn(self.ShowTip)
    self.itemImage.OnMouseOverOut(self.HideTip)

    • Love 1
  8. Try this:

    self.isActiveRotation = False
    self.button.SetMouseClickEvent(self.ActiveRotation)
    self.button.SetMouseButtonUpEvent(self.DeactiveRotation)

    def ActiveRotation(self):
        self.isActiveRotation = True
        
    def DeactiveRotation(self):
        self.isActiveRotation = False
        
    def OnUpdate(self):
        if self.isActiveRotation:
            self.Rotation -= 1
            chr.SetRotation(self.Rotation)

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