Jump to content

Fix Taskbar Highlight Python


flexio

Recommended Posts

 

about: 

Random video with bug https://youtu.be/zILVyU0YGHU?t=7479

look at the highlight effect of WP sura skills (taskbar)

 

Problem:

RefreshQuickSlot spam "ActivateSlot"

 

 

find:

self.selectSkillButtonList = []

under add:

self.Jeaktivni = []

 

find:

self.curSkillButton = 0

under add:

self.Jeaktivni = 0

 

find:

					if constInfo.IS_AUTO_POTION(itemIndex):
						# metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
						metinSocket = [player.GetItemMetinSocket(window, Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
						
						if 0 != int(metinSocket[0]):
							slot.ActivateSlot(slotNumber)
						else:
							slot.DeactivateSlot(slotNumber)

edit to:

					if constInfo.IS_AUTO_POTION(itemIndex):
						# metinSocket - [0] : 활성화 여부, [1] : 사용한 양, [2] : 최대 용량
						metinSocket = [player.GetItemMetinSocket(window, Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
						
						if 0 != int(metinSocket[0]):
							if not slotNumber in self.Jeaktivni:
								slot.ActivateSlot(slotNumber)
								self.Jeaktivni.append(slotNumber)
						else:
							slot.DeactivateSlot(slotNumber)
							if slotNumber in self.Jeaktivni:
								self.Jeaktivni.remove(slotNumber)
					else:
						if slotNumber in self.Jeaktivni:
							self.Jeaktivni.remove(slotNumber)

 

find:

					if player.IsSkillActive(Position):
						slot.ActivateSlot(slotNumber)

edit to:

					if player.IsSkillActive(Position):
						if not slotNumber in self.Jeaktivni:
							slot.ActivateSlot(slotNumber)
							self.Jeaktivni.append(slotNumber)
					else:
						if slotNumber in self.Jeaktivni:
							slot.DeactivateSlot(slotNumber)
							self.Jeaktivni.remove(slotNumber)

 

 

EDIT: 

its been long time since Ive written this feature. And its really bad, fix is more easier

This changes fix problems with skills slots, inventory slots,..

pythonslotwindow.cpp

void CSlotWindow::__CreateSlotEnableEffect()
{
    //__DestroySlotEnableEffect();

    for (int i = 0; i < 3; ++i)
    {
        CAniImageBox* pEff = new CAniImageBox(NULL);


        //fix
        if (m_apSlotActiveEffect[i])
            continue;
        //fix

        for (int j = 0; j <= 12; ++j)
        {
            char buf[64+1];
            sprintf_s(buf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i+1), j);
            pEff->AppendImage(buf);
        }

        pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
        pEff->Show();

        m_apSlotActiveEffect[i] = pEff;
    }
}
void CSlotWindow::ActivateEffect(DWORD dwSlotIndex, float r, float g, float b, float a)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwSlotIndex, &pSlot))
        return;
    
    for (int i = 0; i < 3; ++i)
    {
        //fix
        if (pSlot->pActiveSlotEffect[i])
            continue;
        //fix
        
        CAniImageBox * pEff = new CAniImageBox(NULL);
        for (int j = 0; j <= 12; ++j)
        {
            char cBuf[72];
            sprintf_s(cBuf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i + 1), j);
            pEff->AppendImage(cBuf, r, g, b, a);
        }
        
        pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
        pSlot->pActiveSlotEffect[i] = pEff;
    }
}

 

 

Edited by flexio
  • Metin2 Dev 8
  • Sad 1
  • Think 2
  • Scream 1
  • Good 7
  • Love 5
Link to comment
Share on other sites

On 10/27/2018 at 7:17 PM, flexio said:

 

					if player.IsSkillActive(Position):
						slot.ActivateSlot(slotNumber)

edit to:

					if player.IsSkillActive(Position):
						if not slotNumber in self.Jeaktivni:
							slot.ActivateSlot(slotNumber)
							self.Jeaktivni.append(slotNumber)
					else:
						if slotNumber in self.Jeaktivni:
							slot.DeactivateSlot(slotNumber)
							self.Jeaktivni.remove(slotNumber)

 

 

 

code not found pack ?

Link to comment
Share on other sites

  • 2 years later...

 

its been long time since Ive written this feature. And its really bad, fix is more easier 😄 for uiinventory too.

pythonslotwindow.cpp

void CSlotWindow::__CreateSlotEnableEffect()
{
    //__DestroySlotEnableEffect();

    for (int i = 0; i < 3; ++i)
    {
        CAniImageBox* pEff = new CAniImageBox(NULL);


        //fix
        if (m_apSlotActiveEffect[i])
            continue;
        //fix

        for (int j = 0; j <= 12; ++j)
        {
            char buf[64+1];
            sprintf_s(buf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i+1), j);
            pEff->AppendImage(buf);
        }

        pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
        pEff->Show();

        m_apSlotActiveEffect[i] = pEff;
    }
}
void CSlotWindow::ActivateEffect(DWORD dwSlotIndex, float r, float g, float b, float a)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwSlotIndex, &pSlot))
        return;
    
    for (int i = 0; i < 3; ++i)
    {
        //fix
        if (pSlot->pActiveSlotEffect[i])
            continue;
        //fix
        
        CAniImageBox * pEff = new CAniImageBox(NULL);
        for (int j = 0; j <= 12; ++j)
        {
            char cBuf[72];
            sprintf_s(cBuf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i + 1), j);
            pEff->AppendImage(cBuf, r, g, b, a);
        }
        
        pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
        pSlot->pActiveSlotEffect[i] = pEff;
    }
}

 

Edited by flexio
  • Metin2 Dev 1
  • Love 2
Link to comment
Share on other sites

  • 4 weeks later...

    def RefreshSkill(self):
        self.RefreshQuickSlot()
        self.curSkillButton.RefreshSkill()
        for button in self.selectSkillButtonList:
            button.RefreshSkill()
https://metin2.download/picture/JiS3ncfHLUuxhjaUVIj4xDG1MwRYdsFy/.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 8
  • Think 1
  • Good 2
  • Love 1
Link to comment
Share on other sites

  • 1 month later...
On 8/6/2021 at 8:44 AM, flexio said:

 

its been long time since Ive written this feature. And its really bad, fix is more easier 😄 for uiinventory too.

pythonslotwindow.cpp

void CSlotWindow::__CreateSlotEnableEffect()
{
    //__DestroySlotEnableEffect();

    for (int i = 0; i < 3; ++i)
    {
        CAniImageBox* pEff = new CAniImageBox(NULL);


        //fix
        if (m_apSlotActiveEffect[i])
            continue;
        //fix

        for (int j = 0; j <= 12; ++j)
        {
            char buf[64+1];
            sprintf_s(buf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i+1), j);
            pEff->AppendImage(buf);
        }

        pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
        pEff->Show();

        m_apSlotActiveEffect[i] = pEff;
    }
}
void CSlotWindow::ActivateEffect(DWORD dwSlotIndex, float r, float g, float b, float a)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwSlotIndex, &pSlot))
        return;
    
    for (int i = 0; i < 3; ++i)
    {
        //fix
        if (pSlot->pActiveSlotEffect[i])
            continue;
        //fix
        
        CAniImageBox * pEff = new CAniImageBox(NULL);
        for (int j = 0; j <= 12; ++j)
        {
            char cBuf[72];
            sprintf_s(cBuf, "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i + 1), j);
            pEff->AppendImage(cBuf, r, g, b, a);
        }
        
        pEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN);
        pSlot->pActiveSlotEffect[i] = pEff;
    }
}

 

These codes do not compile to the wrong file.

CAniImageBox * pEff = new CAniImageBox(NULL); error

Link to comment
Share on other sites

  • 2 weeks later...

delete these ridiculous codes and just fix it with python code.

 

					## ÀÚµ¿¹°¾à (#72723, #72724) Ư¼öó¸® - ¾ÆÀÌÅÛÀε¥µµ ½½·Ô¿¡ È°¼ºÈ­/ºñÈ°¼ºÈ­ Ç¥½Ã¸¦ À§ÇÑ ÀÛ¾÷ÀÓ - [hyo]
					if constInfo.IS_AUTO_POTION(itemIndex):
						# metinSocket - [0] : È°¼ºÈ­ ¿©ºÎ, [1] : »ç¿ëÇÑ ¾ç, [2] : ÃÖ´ë ¿ë·®
						metinSocket = [player.GetItemMetinSocket(Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]
						
						if 0 != int(metinSocket[0]):
							slot.ActivateSlot(slotNumber)
						else:
							slot.DeactivateSlot(slotNumber)
				elif player.SLOT_TYPE_SKILL == Type:

					skillIndex = player.GetSkillIndex(Position)
					if 0 == skillIndex:
						slot.ClearSlot(slotNumber)
						continue

					skillType = skill.GetSkillType(skillIndex)
					if skill.SKILL_TYPE_GUILD == skillType:
						import guild
						skillGrade = 0
						skillLevel = guild.GetSkillLevel(Position)

					else:
						skillGrade = player.GetSkillGrade(Position)
						skillLevel = player.GetSkillLevel(Position)

					slot.SetSkillSlotNew(slotNumber, skillIndex, skillGrade, skillLevel)
					slot.SetSlotCountNew(slotNumber, skillGrade, skillLevel)
					slot.SetCoverButton(slotNumber)

					## NOTE : CoolTime üũ
					if player.IsSkillCoolTime(Position):
						(coolTime, elapsedTime) = player.GetSkillCoolTime(Position)
						slot.SetSlotCoolTime(slotNumber, coolTime, elapsedTime)

					## NOTE : Activate µÇ¾î ÀÖ´Ù¸é ¾ÆÀÌÄܵµ ¾÷µ¥ÀÌÆ®
					if player.IsSkillActive(Position):
						# if not slotNumber in self.Jeaktivni:
							slot.ActivateSlot(slotNumber)
							# self.Jeaktivni.append(slotNumber)
					# else:
						# if slotNumber in self.Jeaktivni:
							# slot.DeactivateSlot(slotNumber)
							# self.Jeaktivni.remove(slotNumber)

 

Edited by EAkar
delete playerm2g
Link to comment
Share on other sites



  • Similar Content

  • Activity

    1. 45

      Official Pickup Slot Effect [REVERSED]

    2. 0

      damage from int to long long

    3. 22

      Green & Purple Potions Effect

    4. 12

      When Uninstalling Gaya System

    5. 12

      When Uninstalling Gaya System

    6. 12

      When Uninstalling Gaya System

    7. 12

      When Uninstalling Gaya System

    8. 12

      When Uninstalling Gaya System

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.