Jump to content

Compare Item ToolTIP System


Recommended Posts

  • Honorable Member
2 hours ago, Mafuyu said:

Didnt tested it but it could cause lags when you switch items by yourself instead of using switchbot, because the tooltip always changes every second. Same problem was in the item preview system so i had do make a config option to disable it. Did you tried this?

**Update:

Hold ALT for preview

 

Edited by Mali61
update
  • Love 1

 

Link to comment
Share on other sites

  • Honorable Member
24 minutes ago, Cripplez said:

@Mali61 I have a small problem, if i try to compare a weapon or armor with stones it doesn't work :(

The equipped Item with stones is okay, but the item in inventory with stones can't be compared. Let me know if you can try it and see what I mean

spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal

 

Link to comment
Share on other sites

1 hour ago, Cripplez said:

@Mali61 I have a small problem, if i try to compare a weapon or armor with stones it doesn't work :(

The equipped Item with stones is okay, but the item in inventory with stones can't be compared. Let me know if you can try it and see what I mean

 

54 minutes ago, Mali61 said:

spacer.png


I tested again and it works for me too when the player is GM, when the player is not GM I can't compare weapon/armor with stones :(

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

  • Honorable Member
18 minutes ago, Cripplez said:

 


I tested again and it works for me too when the player is GM, when the player is not GM I can't compare weapon/armor with stones :(

here is normal player https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

I think it's enough, try to add to clean files

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 10
  • Good 1
  • Love 4

 

Link to comment
Share on other sites

Good idea - but I think it would be a better way to show a extra tooltip like your way but in this tooltip if you hover the item in inventory should be visible in green the difference of values when it is better and in red when the values are bad than the equipped

so the people don’t have to check them self - this could be useful

 

Maybe you find the idea good.

Link to comment
Share on other sites

  • Honorable Member
5 hours ago, JeeX said:

Good idea - but I think it would be a better way to show a extra tooltip like your way but in this tooltip if you hover the item in inventory should be visible in green the difference of values when it is better and in red when the values are bad than the equipped

so the people don’t have to check them self - this could be useful

 

Maybe you find the idea good.

this version is quite enough for the free release

 

**Update:

-Inventory(with ALT key)

-Shop(except mainshop)

-Exchange(target)

-Safebox

-Mall

Edited by Mali61
shitty color

 

Link to comment
Share on other sites

  • Forum Moderator

Good idea, the part of GetCompareIndex could be improved for better customization, by that people can add easily new types/subtypes.

 

Quote

def SetCompareItem(self, itemVnum):
	item.SelectItem(itemVnum)
	if not self.CompareTooltip:
		self.CompareTooltip = ItemToolTip()
		self.CompareTooltip.IsCompare = True
	self.CompareTooltip.Hide()
	idx = item.GetCompareIndex()
	if idx:
		self.CompareTooltip.SetInventoryItem(idx, player.INVENTORY, False)
		self.CompareTooltip.AutoAppendTextLine("{}Equipped".format("|cffADFF2F"))
		self.CompareTooltip.ResizeToolTip()

 

To:

 

This is the hidden content, please

 

Quote

#if defined(__COMPARE_TOOLTIP__)
PyObject* itemGetCompareIndex(PyObject* poSelf, PyObject* poArgs)
{
	CItemData* pItemData = CItemManager::Instance().GetSelectedItemDataPointer();
	if (!pItemData)
		return Py_BuildException("no selected item data");

	DWORD idx = 0;
	const BYTE Type = pItemData->GetType();
	const BYTE SubType = pItemData->GetSubType();

	if (Type == CItemData::ITEM_TYPE_ARMOR) {
		switch (SubType) {
		case CItemData::ARMOR_BODY:	idx = c_Equipment_Body; break;
		case CItemData::ARMOR_HEAD:	idx = c_Equipment_Head; break;
		case CItemData::ARMOR_SHIELD:	idx = c_Equipment_Shield; break;
		case CItemData::ARMOR_WRIST:	idx = c_Equipment_Wrist; break;
		case CItemData::ARMOR_FOOTS:	idx = c_Equipment_Shoes; break;
		case CItemData::ARMOR_NECK:	idx = c_Equipment_Neck; break;
		case CItemData::ARMOR_EAR:	idx = c_Equipment_Ear; break;
		}
	}
	else if (Type == CItemData::ITEM_TYPE_WEAPON) {
		idx = c_Equipment_Weapon;
	}
	else if (Type == CItemData::ITEM_TYPE_COSTUME) {
		switch (SubType) {
		case CItemData::COSTUME_BODY:	idx = c_Costume_Slot_Body; break;
		case CItemData::COSTUME_HAIR:	idx = c_Costume_Slot_Hair; break;
#if defined(ENABLE_SASH_SYSTEM)
		case CItemData::COSTUME_SASH:	idx = c_Costume_Slot_Sash; break;
#endif
		}
	}
#if defined(ENABLE_NEW_EQUIPMENT_SYSTEM)
	else if (Type == CItemData::ITEM_TYPE_BELT) {
		idx = c_Equipment_Belt;
	}
#endif

	return Py_BuildValue("i", idx);
}
#endif

 

To:

 

This is the hidden content, please

 

Edited by VegaS™
  • Metin2 Dev 20
  • Eyes 1
  • Think 1
  • Good 9
  • Love 1
  • Love 26
Link to comment
Share on other sites

  • 3 weeks later...

I have improved the code about show/hide the compare tooltip because you need press the button alt before move the mouse over the item, my english isnt good but here you can see the fix:
https://metin2.download/picture/Mjw4S503geClPBngGrip5FPFRJM8U59F/.gif

Open uitooltip.py and find:

		if app.__COMPARE_TOOLTIP__ and app.IsPressed(app.DIK_LALT) and not slotIndex >= player.EQUIPMENT_SLOT_START and CompareItem:
			self.SetCompareItem(itemVnum)

remove or comment that code

now go to def OnUpdate(self):

and over this code

		if app.__COMPARE_TOOLTIP__:
			if self.IsCompare:
				return

add:

		if app.IsPressed(app.DIK_G):
			if self.IsCompare:
				return
			if not self.CompareTooltip:
				self.SetCompareItem(self.itemVnum)
		else:
			if self.CompareTooltip:
				self.CompareTooltip.Hide()
				self.IsCompare = False
				self.CompareTooltip = None

must see like this:
https://metin2.download/picture/23J65uMbQ9S6Wod7I1JJU52X4asyBN5f/.png

PD: I have changed the key to G because in key ALT i have the Rendertarget system and 2 systems made a bug in same key, but you can change the key to any you want.

 

Thanks for the release.

 

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

  • 3 weeks later...

Hello everyone.
After I put it in. You receive the following error.

0606 12:37:26630 :: Traceback (most recent call last):

0606 12:37:26630 ::   File "ui.py", line 2206, in OnOverInItem

0606 12:37:26630 ::   File "ui.py", line 120, in __call__

0606 12:37:26631 ::   File "ui.py", line 111, in __call__

0606 12:37:26631 ::   File "uiInventory.py", line 1006, in OverInItem

0606 12:37:26631 ::   File "uiInventory.py", line 1182, in ShowToolTip

0606 12:37:26631 ::   File "uiToolTip.py", line 571, in SetInventoryItem

0606 12:37:26631 :: AttributeError
0606 12:37:26631 :: : 
0606 12:37:26631 :: 'ItemToolTip' object has no attribute 'SetCompareItem'

 

  • Metin2 Dev 2
Link to comment
Share on other sites

  • 1 year later...
  • Bronze

There's a small bug, if you change the cursor to an item you don't have equipped, it will be like in the gif below. How can we refresh the compare tooltip in real time so it would hide when the cursor moves to an item you don;t have equipped?

 

https://metin2.download/picture/E2FOgh3z3ru3L52c6IHbYo2c8tsNlc3D/.gif

Edited by Metin2 Dev
Core X - External 2 Internal

spacer.png

Link to comment
Share on other sites

  • Honorable Member
20 minutes ago, SCOOB said:

There's a small bug, if you change the cursor to an item you don't have equipped, it will be like in the gif below. How can we refresh the compare tooltip in real time so it would hide when the cursor moves to an item you don;t have equipped?

 

https://metin2.download/picture/E2FOgh3z3ru3L52c6IHbYo2c8tsNlc3D/.gif

I can take a look at may 2023

little patience...

Edited by Metin2 Dev
Core X - External 2 Internal
  • Think 1
  • Scream 1
  • Lmao 1

 

Link to comment
Share on other sites

  • 6 months later...
  • Premium
1211 22:18:25518 :: Traceback (most recent call last):

1211 22:18:25519 ::   File "ui.py", line 1992, in OnOverInItem

1211 22:18:25519 ::   File "ui.py", line 95, in __call__

1211 22:18:25519 ::   File "ui.py", line 86, in __call__

1211 22:18:25519 ::   File "uiInventory.py", line 1468, in OverInItem

1211 22:18:25519 ::   File "uiInventory.py", line 1823, in ShowToolTip

1211 22:18:25520 ::   File "uiToolTip.py", line 860, in SetInventoryItem

1211 22:18:25520 ::   File "uiToolTip.py", line 437, in SetCompareItem

1211 22:18:25520 :: AttributeError
1211 22:18:25520 :: : 
1211 22:18:25520 :: 'module' object has no attribute 'GetCompareIndex'
1211 22:18:25520 :: 
    if app.__COMPARE_TOOLTIP__:
        def SetCompareItem(self, itemVnum):
            slotIndex = item.GetCompareIndex(itemVnum)
            if slotIndex:
                if not self.CompareTooltip:
                    self.CompareTooltip = ItemToolTip()
                    self.CompareTooltip.IsCompare = True

                self.CompareTooltip.SetInventoryItem(slotIndex, player.INVENTORY, False)
                self.CompareTooltip.AutoAppendTextLine("Equipped", 0xffADFF2F)
                self.CompareTooltip.ResizeToolTip()

What is wrong? O.o i only copy/paste

Error is on line "slotIndex = item.GetCompareIndex(itemVnum)"

Edited by FileX
Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...
  • 3 months later...

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.