GMS 2.3+ Quick Slots Inventory

I am trying to make Quick Inventory Slots.
global.inventoryLIst = ds_list_create(); //player inventory
global.quickSlotsLIst = ds_list_create(); //Quick Slots (3 slots)

From inventory, I transfer the item to Quick Slots Inventory.
How to make the first slot responsible for equipping weapons, the second for equipping melee weapons, and the third for the first aid kit.
In game I press button "1", firearms are selected, button "2" is melee weapons, I press button "3", a first aid kit is used.


If you item is a ds_map with stuff like "name", "amount" .. then give it a item "type"

So when you drag a item to your quickbar slot, then you got the list and position of the grabbed and the one you are currently over

Then you have to check what list you try to drop the item in, if it is the quickslot then check which position you are dropping it in, have a different item type check for each of them

When dropping it in a slot then I check:
if move_valid( grab_list[| grab_pos], over_list,over_pos)
&& move_valid( over_list[| over_pos], grab_list,grab_pos){
    slot_swap(over_list,over_pos, grab_list,grab_pos)
the move_valid script:

function move_valid(_item,_list,_pos) {
    if _item==noone return true; // if this slot is empty, allow the move

    if _list == global.quickSlotsLIst{
        var type = _item[? "type"];
            case 0: return type == "meele"; break; // I don't think the breaks are nessesary here
            case 1: return type == "ranged"; break;
            case 2: return type == "usable"; break;

    return true; // if any other list that we not check for .. allow it
EDIT: I forgot the accessor for ds lists, also changed so it uses the accessor for map instead of ds_map function
Last edited: