API:UpdateEnhancementDurations

Aus WARWiki

Keine Beschreibung verfügbar.

Nutzung

API:UpdateEnhancementDurations()


Diese Funktion übernimmt keine Argumente.


Diese Funktion gibt keine Werte zurück.


Source Code

    Convenience function to determine whether or not the cursor is holding:
        1. An item from the player's inventory of ANY type
        2. An enhancement item from the player's inventory
        
    NOTE: Not moving this into Cursor.lua because its use is fairly specialized at this point.
    
    Returned as two seperate booleans
--]]
local function GetCursorItemType ()
    if (Cursor.IconOnCursor ()) then
        local cursorHasInventoryItem    = (Cursor.Data.Source == Cursor.SOURCE_INVENTORY);
        local cursorHasEnhItem          = false;

        if (cursorHasInventoryItem) then
            local inventoryData = DataUtils.GetItems ()
            cursorHasEnhItem = (inventoryData[Cursor.Data.SourceSlot].type == GameData.ItemTypes.ENHANCEMENT);
        end  
        
        return cursorHasInventoryItem, cursorHasEnhItem
    else
        return false, false;
    end
end


Persönliche Werkzeuge
Anzeige

Sponsoren