Add files via upload

This commit is contained in:
iThorgrim
2024-02-21 01:47:28 +01:00
committed by GitHub
parent 2323aa6c94
commit 99f36e6e19

View File

@@ -54,6 +54,28 @@ RUNE_CATEGORIES = {1, 2, 3, 4, 5};
OWNED_CATEGORIES = {1, 3};
SEARCH_FILTER = nil;
ENGRAVING_ENABLED = true;
EXCLUSIVE_CATEGORY_FILTER = nil;
EQUIPPED_FILTER_ENABLED = false;
RUNE_INFORMATION = {};
EQUIPMENT_SLOT_ENGRAVINGS = {};
INVENTORY_ENGRAVINGS = {};
CATEGORY_ENGRAVINGS = {};
CURRENT_RUNE_CAST = {};
--[[ Not sure for this ]]--
CONTAINER_SLOT_ENGRAVINGS = {
{true, true, true}, -- container 1 with all slots engravable
{true, false, true}, -- container 2 with second slot not engravable
}
EQUIPMENT_ENGRAVABLE_SLOTS = {
[1] = true,
[2] = false,
-- ...
}
--[[ Retro-ingenering of this : https://github.com/Gethe/wow-ui-source/blob/classic_era/Interface/AddOns/Blizzard_APIDocumentationGenerated/EngravingInfoDocumentation.lua ]]--
function C_Engraving.IsEngravingEnabled()
return ENGRAVING_ENABLED
@@ -96,78 +118,128 @@ end
--[[ Method missing ]]--
function C_Engraving.AddCategoryFilter(category)
CATEGORY_FILTERS[category] = true
end
function C_Engraving.AddExclusiveCategoryFilter(category)
EXCLUSIVE_CATEGORY_FILTER = category
end
function C_Engraving.CastRune(skillLineAbilityID)
-- idk for the moment
end
function C_Engraving.ClearAllCategoryFilters()
for category in pairs(CATEGORY_FILTERS) do
C_Engraving.ClearCategoryFilter(category)
end
end
function C_Engraving.ClearCategoryFilter(category)
CATEGORY_FILTERS[category] = nil
end
function C_Engraving.ClearExclusiveCategoryFilter()
EXCLUSIVE_CATEGORY_FILTER = nil
end
function C_Engraving.EnableEquippedFilter(enabled)
EQUIPPED_FILTER_ENABLED = enabled
end
function C_Engraving.GetCurrentRuneCast()
-- idk for the moment
end
function C_Engraving.GetEngravingModeEnabled()
-- idk for the moment
end
function C_Engraving.GetExclusiveCategoryFilter()
return EXCLUSIVE_CATEGORY_FILTER
end
function C_Engraving.GetNumRunesKnown(equipmentSlot)
if equipmentSlot == nil or RUNE_INFORMATION[equipmentSlot] == nil then
return 0, 0
end
return RUNE_INFORMATION[equipmentSlot].known, RUNE_INFORMATION[equipmentSlot].max
end
function C_Engraving.GetRuneForEquipmentSlot(equipmentSlot)
return EQUIPMENT_SLOT_ENGRAVINGS[equipmentSlot];
end
function C_Engraving.GetRuneForInventorySlot(containerIndex, slotIndex)
if INVENTORY_ENGRAVINGS[containerIndex] and INVENTORY_ENGRAVINGS[containerIndex][slotIndex] then
return INVENTORY_ENGRAVINGS[containerIndex][slotIndex]
else
return nil
end
end
function C_Engraving.GetRunesForCategory(category, ownedOnly)
local engravingInfoForCategory = CATEGORY_ENGRAVINGS[category];
if not engravingInfoForCategory then
return {};
end
if ownedOnly then
local ownedEngravingInfo = {};
for i, engravingData in ipairs(engravingInfoForCategory) do
if engravingData.owned then
table.insert(ownedEngravingInfo, engravingData);
end
end
return ownedEngravingInfo;
end
return engravingInfoForCategory;
end
function C_Engraving.IsEquipmentSlotEngravable(equipmentSlot)
return EQUIPMENT_ENGRAVABLE_SLOTS[equipmentSlot] or false;
end
function C_Engraving.IsEquippedFilterEnabled()
return EQUIPMENT_FILTER_ENABLED;
end
function C_Engraving.IsInventorySlotEngravable(containerIndex, slotIndex)
return CONTAINER_SLOT_ENGRAVINGS[containerIndex] and CONTAINER_SLOT_ENGRAVINGS[containerIndex][slotIndex] or false
end
function C_Engraving.IsInventorySlotEngravableByCurrentRuneCast(containerIndex, slotIndex)
return containerIndex == CURRENT_RUNE_CAST.containerIndex and slotIndex == CURRENT_RUNE_CAST.slotIndex
end
function C_Engraving.IsKnownRuneSpell(spellID)
return IsSpellKnown(spellID)
end
function C_Engraving.IsRuneEquipped(skillLineAbilityID)
-- idk for the moment
end
function C_Engraving.RefreshRunesList()
-- idk for the moment
end
function C_Engraving.SetEngravingModeEnabled(enabled)
-- idk for the moment
end
function C_Engraving.EngravingModeChanged(enabled)
-- idk for the moment
end
function C_Engraving.EngravingTargetingModeChanged(enabled)
-- idk for the moment
end
function C_Engraving.RuneUpdated(rune)
-- idk for the moment
end
--[[ Not sure for this ]]--