Check if item is a weapon, armor, or regular/key item before disabling.

● ARCHIVED · READ-ONLY
Started by Crystal Flareon 2 posts View original ↗
  1. Hello js experts out there.

    I have a request that hopefully will be pretty simple. In the default item list, equipment and unusable items are greyed out and can't be used. In my project however, it is important for the weapons and armor to be usable, as selecting them opens up a customization menu.

    I have locate the piece of code that appears grey out unusable items, which is found in Window_ItemStatus/

    Code:
    Window_ItemList.prototype.isEnabled = function(item) {
    return $gameParty.canUse(item);
    
    };

    Suppressing this makes all items "usable," including the weapons and armor which function exactly as I need to. However, it also makes key items and items that can't be used from the menu screen "usable" as well, selecting them brings up the actor selection window, and attempting to use the item will result in no effect and the buzzer will sound. This doesn't look good, so I'd want these items to be greyed out, but not the weapons and armor as said previously. I have tried using if clauses based on "isweapon," "isarmor', "item" etc, and none of them seem to work. The game runs without crashing or console errors, but it's as if it's completely ignoring my coding.

    So I'm looking for a fix to this. Hopefully I'm at least in the right direction.

    Edit: I was able to come up with a solution with the help of some friends. This request can be closed.

    For anyone interested, here is our solution.

    Code:
    Window_ItemList.prototype.isEnabled = function(item) {
    if (DataManager.isItem(item)) return $gameParty.canUse(item);
    else return DataManager.isWeapon(item) || DataManager.isArmor(item);
    }
  2. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.