Hi folks, I am modifying a bit of code from an existing plugin (with permission) to suit my game, and the objective is to have item names in the inventory only display when the "cursor" is over them (ie. when you are selecting it in the inventory, with the displayed name changing as you move between items). This is the code to display all of the item names in the inventory right now: Code:
Hi folks,
I am modifying a bit of code from an existing plugin (with permission) to suit my game, and the objective is to have item names in the inventory only display when the "cursor" is over them (ie. when you are selecting it in the inventory, with the displayed name changing as you move between items).
This is the code to display all of the item names in the inventory right now:
Code:
this.drawText(item.name, x + textMargin, y, itemWidth);
and my hope is to add a condition for displaying the name, which checks the item against the current selected item before displaying, like this:
Code:
if(this item is selected){
this.drawText(item.name, x + textMargin, y, itemWidth);
}
The idea is that I only want to see one item name rendered at a time, the one I am hovering over. I am hoping there is a function that gets the currently selected item so I can compare it to the item, and only display the name if they match or something like that.
Is there something that checks for this?
Thanks!
NOTE: The plugin specifically is DM_LimitedInventory, and this window I am modifying is defined on line 2870. It is free if you are able to take a look at it:
HERE