Jump to content

Official Clip Masking [REVERSED]


Recommended Posts

  • Active Member
On 2/25/2023 at 11:27 PM, Lima said:

dumb question here, how do you @ Mali get to have the client open and the live editing on vstudio? i cant find the option to get the proccess [10804] Metin2Debug.exe

I am new to this, if there is a guide on this already, could you point it? I must admit this is a bit overwhelming to start

Change (UserInterface->Settings) your output directory to your client directory

Spoiler

spacer.png

OR copy your whole client to your output directory (i prefer this one), then

spacer.png

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

  • 2 weeks later...
  • Honorable Member

#Update:

[AE] Whisper Window Fix: This is an official fix not experimental. I've had it for a very, very long time but I couldn't find an Arab to test it. Then I asked @ martysama0134 to test it.

Before:

Spoiler

.png

After:

Spoiler

.png

  • Metin2 Dev 1
  • Good 1
  • Love 2

 

Link to comment
Share on other sites

On 4/11/2023 at 4:30 PM, ATAG said:

Change (UserInterface->Settings) your output directory to your client directory

  Hide contents

spacer.png

OR copy your whole client to your output directory (i prefer this one), then

spacer.png

or set the debug folder

571YTnW.png

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...

I am using the experimental version of this system together with your __BL_ENABLE_PICKUP_ITEM_EFFECT__ system. In PythonSlotWindow.cpp, 

This part:
 

		if (m_pSlotActiveEffect)
			m_pSlotActiveEffect->SetClippingMaskRect(m_rMaskRect);

Is not compatible with your __BL_ENABLE_PICKUP_ITEM_EFFECT__ system and it doesn't let client build. Because of this in PythonSlotWindow.h:

 

#if defined(__BL_ENABLE_PICKUP_ITEM_EFFECT__)
			CAniImageBox* m_pSlotActiveEffect[SLOT_ACTIVE_EFFECT_COUNT];
#else
			CAniImageBox* m_pSlotActiveEffect;
#endif


So copying from another if statement from your __BL_ENABLE_PICKUP_ITEM_EFFECT__  system, I edited the first code as such:

 

#if defined(__BL_ENABLE_PICKUP_ITEM_EFFECT__)
		for (int i = 0; i < SLOT_ACTIVE_EFFECT_COUNT; i++)
		{
			if (m_pSlotActiveEffect[i])
				m_pSlotActiveEffect[i]->SetClippingMaskRect(m_rMaskRect);
		}
#else
		if (m_pSlotActiveEffect)
			m_pSlotActiveEffect->SetClippingMaskRect(m_rMaskRect);
#endif


I could compile the Client after this. Did I mess something up or does this make sense? 

Edited by Debloat
Link to comment
Share on other sites

  • 2 months later...
  • Active+ Member

Can someone show me an example usage?
How should we adapt it to other windows?
For example, the task list.(in character window -> quest)

On 12/28/2022 at 2:19 PM, filipw1 said:

scrollowanie_masne_fest.gif

To get smooth scrolling like this in music, guild symbol selection (and maybe some custom systems you already have idk), just replace ListBoxEx class.

  Reveal hidden contents

https://pastebin.com/MwRS82jG

 

class ListBoxEx(Window):
    class Item(Window):
        def __init__(self):
            Window.__init__(self)
 
        def __del__(self):
            Window.__del__(self)
 
        def SetParent(self, parent):
            Window.SetParent(self, parent)
            self.parent = proxy(parent)
 
        def OnMouseLeftButtonDown(self):
            self.parent.SelectItem(self)
 
        def OnRender(self):
            if self.parent.GetSelectedItem() == self:
                self.OnSelectedRender()
 
        def OnSelectedRender(self):
            x, y = self.GetGlobalPosition()
            grp.SetColor(grp.GenerateColor(0.0, 0.0, 0.7, 0.7))
            grp.RenderBar(x, y, self.GetWidth(), self.GetHeight())
 
    def __init__(self):
        Window.__init__(self)
 
        self.viewItemCount = 10
        self.basePos = 0
        self.itemHeight = 16
        self.itemStep = 20
        self.selItem = 0
        self.itemList = []
        self.onSelectItemEvent = lambda *arg: None
 
        if localeInfo.IsARABIC():
            self.itemWidth = 130
        else:
            self.itemWidth = 100
 
        self.scrollBar = None
        self.__UpdateSize()
 
    def __del__(self):
        Window.__del__(self)
 
    def __UpdateSize(self):
        height = self.itemStep * self.__GetViewItemCount()
 
        self.SetSize(self.itemWidth, height)
 
    def IsEmpty(self):
        if len(self.itemList) == 0:
            return 1
        return 0
 
    def SetItemStep(self, itemStep):
        self.itemStep = itemStep
        self.__UpdateSize()
 
    def SetItemSize(self, itemWidth, itemHeight):
        self.itemWidth = itemWidth
        self.itemHeight = itemHeight
        self.__UpdateSize()
 
    def SetViewItemCount(self, viewItemCount):
        self.viewItemCount = viewItemCount
 
    def SetSelectEvent(self, event):
        self.onSelectItemEvent = event
 
    def SetBasePos(self, basePos):
        if app.__BL_CLIP_MASK__:
            self.basePos = basePos
 
            curbp = self.basePos
 
            itemheight = self.itemStep * len(self.itemList)
            myheight = self.GetHeight()
 
            if itemheight < myheight:
                curbp = 0
 
            fromPos = curbp
            curPos = 0
            toPos = curbp + self.GetHeight()
            for item in self.itemList:
                if curPos + self.itemStep < fromPos or curPos > toPos:
                    item.Hide()
                else:
                    item.Show()
 
                item.SetPosition(0, curPos - fromPos)
                curPos += self.itemStep
        else:
            for oldItem in self.itemList[self.basePos:self.basePos + self.viewItemCount]:
                oldItem.Hide()
 
            self.basePos = basePos
 
            pos = basePos
            for newItem in self.itemList[self.basePos:self.basePos + self.viewItemCount]:
                (x, y) = self.GetItemViewCoord(pos, newItem.GetWidth())
                newItem.SetPosition(x, y)
                newItem.Show()
                pos += 1
 
    def GetItemIndex(self, argItem):
        return self.itemList.index(argItem)
 
    def GetSelectedItem(self):
        return self.selItem
 
    def SelectIndex(self, index):
 
        if index >= len(self.itemList) or index < 0:
            self.selItem = None
            return
 
        try:
            self.selItem = self.itemList[index]
        except:
            pass
 
    def SelectItem(self, selItem):
        self.selItem = selItem
        self.onSelectItemEvent(selItem)
 
    def RemoveAllItems(self):
        for item in self.itemList:
            item.Hide()
 
        self.selItem = None
        self.itemList = []
 
        if self.scrollBar:
            self.scrollBar.SetPos(0)
 
    def RemoveItem(self, delItem):
        if delItem == self.selItem:
            self.selItem = None
 
        self.itemList.remove(delItem)
 
    def AppendItem(self, newItem):
        newItem.SetParent(self)
        newItem.SetSize(self.itemWidth, self.itemHeight)
 
        if app.__BL_CLIP_MASK__:
            newItem.SetClippingMaskWindow(self)
 
        pos = len(self.itemList)
        if self.__IsInViewRange(pos):
            (x, y) = self.GetItemViewCoord(pos, newItem.GetWidth())
            newItem.SetPosition(x, y)
            newItem.Show()
        else:
            newItem.Hide()
 
        self.itemList.append(newItem)
 
    def SetScrollBar(self, scrollBar):
        scrollBar.SetScrollEvent(__mem_func__(self.__OnScroll))
        self.scrollBar = scrollBar
 
    def __OnScroll(self):
        if app.__BL_CLIP_MASK__:
            self.SetBasePos(int(self.scrollBar.GetPos() * (self.__GetItemCount() - 1) * self.itemStep))
        else:
            self.SetBasePos(int(self.scrollBar.GetPos() * self.__GetScrollLen()))
 
    def __GetScrollLen(self):
        scrollLen = self.__GetItemCount() - self.__GetViewItemCount()
        if scrollLen < 0:
            return 0
 
        return scrollLen
 
    def __GetViewItemCount(self):
        return self.viewItemCount
 
    def __GetItemCount(self):
        return len(self.itemList)
 
    def GetItemViewCoord(self, pos, itemWidth):
        if localeInfo.IsARABIC():
            return (self.GetWidth() - itemWidth - 10, (pos - self.basePos) * self.itemStep)
        else:
            return (0, (pos - self.basePos) * self.itemStep)
 
    def __IsInViewRange(self, pos):
        if pos < self.basePos:
            return 0
        if pos >= self.basePos + self.viewItemCount:
            return 0
        return 1

 

Not working. As you show, the sliding process does not occur, there is visual distortion.

Edited by blaxis
Link to comment
Share on other sites

Announcements



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