Skip to content

Instantly share code, notes, and snippets.

@Koviko Koviko/ArkInventory.lua
Last active Mar 14, 2019

Embed
What would you like to do?
8.1.5 ItemButton changes for ArkInventory `r818-alpha`
--[[
License: All Rights Reserved, (c) 2006-2018
$Revision: 2319 $
$Date: 2019-03-03 22:42:48 +1100 (Sun, 03 Mar 2019) $
]]--
local _G = _G
local select = _G.select
local pairs = _G.pairs
local ipairs = _G.ipairs
local string = _G.string
local type = _G.type
local error = _G.error
local table = _G.table
ArkInventory.Localise = LibStub( "AceLocale-3.0" ):GetLocale( "ArkInventory" )
ArkInventory.Const.Bindings = {
All = { ITEM_BIND_ON_USE, ITEM_BIND_ON_EQUIP, ITEM_BIND_ON_PICKUP, ITEM_SOULBOUND, ITEM_ACCOUNTBOUND, ITEM_BIND_TO_ACCOUNT, ITEM_BIND_TO_BNETACCOUNT, ITEM_BNETACCOUNTBOUND },
Use = { ArkInventory.Localise["WOW_TOOLTIP_ITEM_BIND_ON_USE"] },
Equip = { ArkInventory.Localise["WOW_TOOLTIP_ITEM_BIND_ON_EQUIP"] },
Pickup = { ArkInventory.Localise["WOW_TOOLTIP_ITEM_BIND_ON_PICKUP"], ArkInventory.Localise["WOW_TOOLTIP_ITEM_SOULBOUND"] },
Account = { ArkInventory.Localise["WOW_TOOLTIP_ITEM_ACCOUNTBOUND"], ArkInventory.Localise["WOW_TOOLTIP_ITEM_BIND_TO_ACCOUNT"], ArkInventory.Localise["WOW_TOOLTIP_ITEM_BIND_TO_BNETACCOUNT"], ArkInventory.Localise["WOW_TOOLTIP_ITEM_BNETACCOUNTBOUND"] },
}
ArkInventory.Const.Category = {
Min = 1000,
Max = 8999,
Type = {
System = 1,
Custom = 2,
Rule = 3,
},
Code = {
System = { -- do NOT change the indicies - if you have to then see the DatabaseUpgradePostLoad( ) function to remap it
[401] = {
["id"] = "SYSTEM_DEFAULT",
["text"] = ArkInventory.Localise["DEFAULT"],
},
[402] = {
["id"] = "SYSTEM_TRASH",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_MISC_JUNK"],
},
[403] = {
["id"] = "SYSTEM_SOULBOUND",
["text"] = ArkInventory.Localise["CATEGORY_SYSTEM_SOULBOUND"],
},
[405] = {
["id"] = "SYSTEM_CONTAINER",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER"],
},
--[406] = { keys },
[407] = {
["id"] = "SYSTEM_MISC",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_MISC"],
},
[408] = {
["id"] = "SYSTEM_REAGENT",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_MISC_REAGENT"],
},
[409] = {
["id"] = "SYSTEM_RECIPE",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE"],
},
[411] = {
["id"] = "SYSTEM_QUEST",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_QUEST"],
},
[414] = {
["id"] = "SYSTEM_EQUIPMENT",
["text"] = ArkInventory.Localise["CATEGORY_SYSTEM_EQUIPMENT"],
},
[415] = {
["id"] = "SYSTEM_MOUNT",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_MISC_MOUNT"],
},
[416] = {
["id"] = "SYSTEM_EQUIPMENT_SOULBOUND",
["text"] = ArkInventory.Localise["CATEGORY_SYSTEM_EQUIPMENT_SOULBOUND"],
},
--[421] = { SYSTEM_PROJECTILE_ARROW }
--[422] = { SYSTEM_PROJECTILE_BULLET }
[444] = {
["id"] = "SYSTEM_EQUIPMENT_ACCOUNTBOUND",
["text"] = ArkInventory.Localise["CATEGORY_SYSTEM_EQUIPMENT_ACCOUNTBOUND"],
},
[423] = {
["id"] = "SYSTEM_PET_COMPANION_BOUND",
["text"] = ArkInventory.Localise["PET_COMPANION_BOUND"],
},
[443] = {
["id"] = "SYSTEM_PET_COMPANION_TRADE",
["text"] = ArkInventory.Localise["PET"],
},
[441] = {
["id"] = "SYSTEM_PET_BATTLE_TRADE",
["text"] = ArkInventory.Localise["BATTLEPET"],
},
[442] = {
["id"] = "SYSTEM_PET_BATTLE_BOUND",
["text"] = ArkInventory.Localise["PET_BATTLE_BOUND"],
},
[428] = {
["id"] = "SYSTEM_REPUTATION",
["text"] = ArkInventory.Localise["REPUTATION"],
},
[429] = {
["id"] = "SYSTEM_UNKNOWN",
["text"] = ArkInventory.Localise["UNKNOWN"],
},
[434] = {
["id"] = "SYSTEM_GEM",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_GEM"],
},
[438] = {
["id"] = "SYSTEM_CURRENCY",
["text"] = ArkInventory.Localise["CURRENCY"],
},
[439] = {
["id"] = "SYSTEM_GLYPH",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_GLYPH"],
},
[445] = {
["id"] = "SYSTEM_TOY",
["text"] = ArkInventory.Localise["TOY"],
},
[446] = {
["id"] = "SYSTEM_NEW",
["text"] = ArkInventory.Localise["CONFIG_DESIGN_ITEM_NEW"],
},
[447] = {
["id"] = "SYSTEM_HEIRLOOM",
["text"] = ArkInventory.Localise["HEIRLOOM"],
},
[448] = {
["id"] = "SYSTEM_ARTIFACT_RELIC",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_GEM_ARTIFACT_RELIC"],
},
--[510] = TRADEGOODS_ENCHANTMENT
--[440] = CONSUMABLE_ITEM_ENHANCEMENT
[440] = {
["id"] = "SYSTEM_ITEM_ENHANCEMENT",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_ITEM_ENHANCEMENT"],
},
[451] = {
["id"] = "SYSTEM_MYTHIC_KEYSTONE",
["text"] = ArkInventory.Localise["CATEGORY_SYSTEM_MYTHIC_KEYSTONE"],
},
[452] = {
["id"] = "SYSTEM_CRAFTING_REAGENT",
["text"] = ArkInventory.Localise["CRAFTING_REAGENT"],
},
},
Consumable = {
[404] = {
["id"] = "CONSUMABLE_OTHER",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_OTHER"],
},
[417] = {
["id"] = "CONSUMABLE_FOOD",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_FOOD"],
},
[418] = {
["id"] = "CONSUMABLE_DRINK",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_DRINK"],
},
[419] = {
["id"] = "CONSUMABLE_POTION_MANA",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_POTION_MANA"],
},
[420] = {
["id"] = "CONSUMABLE_POTION_HEAL",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_POTION_HEAL"],
},
[424] = {
["id"] = "CONSUMABLE_POTION",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_POTION"],
},
[430] = {
["id"] = "CONSUMABLE_ELIXIR",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_ELIXIR"],
},
[431] = {
["id"] = "CONSUMABLE_FLASK",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_FLASK"],
},
[432] = {
["id"] = "CONSUMABLE_BANDAGE",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_BANDAGE"],
},
--[433] = CONSUMABLE_SCROLL
[435] = {
["id"] = "CONSUMABLE_ELIXIR_BATTLE",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_ELIXIR_BATTLE"],
},
[436] = {
["id"] = "CONSUMABLE_ELIXIR_GUARDIAN",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_ELIXIR_GUARDIAN"],
},
[437] = {
["id"] = "CONSUMABLE_FOOD_AND_DRINK",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_FOOD_AND_DRINK"],
},
--[425] = TRADEGOODS_DEVICES
--[426] = TRADEGOODS_EXPLOSIVES
[426] = {
["id"] = "CONSUMABLE_EXPLOSIVES_AND_DEVICES",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_EXPLOSIVES_AND_DEVICES"],
},
[449] = {
["id"] = "CONSUMABLE_VANTUSRUNE",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONSUMABLE_VANTUSRUNE"],
},
[450] = {
["id"] = "CONSUMABLE_ARTIFACT_POWER",
["text"] = ArkInventory.Localise["ARTIFACT_POWER"],
},
},
Trade = {
[412] = {
["id"] = "TRADEGOODS_OTHER",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_OTHER"],
},
[427] = {
["id"] = "TRADEGOODS_PARTS",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_PARTS"],
},
[501] = {
["id"] = "TRADEGOODS_HERB",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_HERB"],
},
[502] = {
["id"] = "TRADEGOODS_CLOTH",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_CLOTH"],
},
[503] = {
["id"] = "TRADEGOODS_ELEMENTAL",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_ELEMENTAL"],
},
[504] = {
["id"] = "TRADEGOODS_LEATHER",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_LEATHER"],
},
[505] = {
["id"] = "TRADEGOODS_COOKING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_COOKING"],
},
[506] = {
["id"] = "TRADEGOODS_METAL_AND_STONE",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_METAL_AND_STONE"],
},
--[507] = TRADEGOODS_MATERIALS
[512] = {
["id"] = "TRADEGOODS_ENCHANTING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_ENCHANTING"],
},
[513] = {
["id"] = "TRADEGOODS_JEWELCRAFTING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_JEWELCRAFTING"],
},
},
Skill = { -- do NOT change the indicies
[101] = {
["id"] = "SKILL_ALCHEMY",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_ALCHEMY"],
},
[102] = {
["id"] = "SKILL_BLACKSMITHING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_BLACKSMITHING"],
},
[103] = {
["id"] = "SKILL_COOKING",
["text"] = ArkInventory.Localise["WOW_SKILL_COOKING"],
},
[104] = {
["id"] = "SKILL_ENGINEERING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_ENGINEERING"],
},
[105] = {
["id"] = "SKILL_ENCHANTING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_ENCHANTING"],
},
[106] = {
["id"] = "SKILL_FIRST_AID",
["text"] = ArkInventory.Localise["WOW_SKILL_FIRSTAID"],
},
[107] = {
["id"] = "SKILL_FISHING",
["text"] = ArkInventory.Localise["WOW_SKILL_FISHING"],
},
[108] = {
["id"] = "SKILL_HERBALISM",
["text"] = ArkInventory.Localise["WOW_SKILL_HERBALISM"],
},
[109] = {
["id"] = "SKILL_JEWELCRAFTING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_JEWELCRAFTING"],
},
[110] = {
["id"] = "SKILL_LEATHERWORKING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_LEATHERWORKING"],
},
[111] = {
["id"] = "SKILL_MINING",
["text"] = ArkInventory.Localise["WOW_SKILL_MINING"],
},
[112] = {
["id"] = "SKILL_SKINNING",
["text"] = ArkInventory.Localise["WOW_SKILL_SKINNING"],
},
[113] = {
["id"] = "SKILL_TAILORING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_TAILORING"],
},
[115] = {
["id"] = "SKILL_INSCRIPTION",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_INSCRIPTION"],
},
[116] = {
["id"] = "SKILL_ARCHAEOLOGY",
["text"] = ArkInventory.Localise["WOW_SKILL_ARCHAEOLOGY"],
},
},
Class = {
[201] = {
["id"] = "CLASS_DRUID",
["text"] = ArkInventory.Localise["WOW_CLASS_DRUID"],
},
[202] = {
["id"] = "CLASS_HUNTER",
["text"] = ArkInventory.Localise["WOW_CLASS_HUNTER"],
},
[203] = {
["id"] = "CLASS_MAGE",
["text"] = ArkInventory.Localise["WOW_CLASS_MAGE"],
},
[204] = {
["id"] = "CLASS_PALADIN",
["text"] = ArkInventory.Localise["WOW_CLASS_PALADIN"],
},
[205] = {
["id"] = "CLASS_PRIEST",
["text"] = ArkInventory.Localise["WOW_CLASS_PRIEST"],
},
[206] = {
["id"] = "CLASS_ROGUE",
["text"] = ArkInventory.Localise["WOW_CLASS_ROGUE"],
},
[207] = {
["id"] = "CLASS_SHAMAN",
["text"] = ArkInventory.Localise["WOW_CLASS_SHAMAN"],
},
[208] = {
["id"] = "CLASS_WARLOCK",
["text"] = ArkInventory.Localise["WOW_CLASS_WARLOCK"],
},
[209] = {
["id"] = "CLASS_WARRIOR",
["text"] = ArkInventory.Localise["WOW_CLASS_WARRIOR"],
},
[210] = {
["id"] = "CLASS_DEATHKNIGHT",
["text"] = ArkInventory.Localise["WOW_CLASS_DEATHKNIGHT"],
},
[211] = {
["id"] = "CLASS_MONK",
["text"] = ArkInventory.Localise["WOW_CLASS_MONK"],
},
[212] = {
["id"] = "CLASS_DEMONHUNTER",
["text"] = ArkInventory.Localise["WOW_CLASS_DEMONHUNTER"],
},
},
Empty = {
[300] = {
["id"] = "EMPTY_UNKNOWN",
["text"] = ArkInventory.Localise["UNKNOWN"],
},
[301] = {
["id"] = "EMPTY",
["text"] = ArkInventory.Localise["CATEGORY_EMPTY"],
},
[302] = {
["id"] = "EMPTY_BAG",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
},
--[303] = { empty key },
[305] = {
["id"] = "EMPTY_HERB",
["text"] = ArkInventory.Localise["WOW_SKILL_HERBALISM"],
},
[306] = {
["id"] = "EMPTY_ENCHANTING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_ENCHANTING"],
},
[307] = {
["id"] = "EMPTY_ENGINEERING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_ENGINEERING"],
},
[308] = {
["id"] = "EMPTY_GEM",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_GEM"],
},
[309] = {
["id"] = "EMPTY_MINING",
["text"] = ArkInventory.Localise["WOW_SKILL_MINING"],
},
[312] = {
["id"] = "EMPTY_LEATHERWORKING",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_LEATHERWORKING"],
},
[313] = {
["id"] = "EMPTY_INSCRIPTION",
["text"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_INSCRIPTION"],
},
[314] = {
["id"] = "EMPTY_TACKLE",
["text"] = ArkInventory.Localise["WOW_SKILL_FISHING"],
},
--[315] = { empty void storage },
[316] = {
["id"] = "EMPTY_COOKING",
["text"] = ArkInventory.Localise["WOW_SKILL_COOKING"],
},
[317] = {
["id"] = "EMPTY_REAGENTBANK",
["text"] = ArkInventory.Localise["REAGENTBANK"],
},
},
Other = { -- do NOT change the indicies - if you have to then see the DatabaseUpgradePostLoad( ) function to remap it
[901] = {
["id"] = "SYSTEM_CORE_MATS",
["text"] = ArkInventory.Localise["CATEGORY_SYSTEM_CORE_MATS"],
},
[902] = {
["id"] = "CONSUMABLE_FOOD_PET",
["text"] = ArkInventory.Localise["CATEGORY_CONSUMABLE_FOOD_PET"],
},
},
},
}
ArkInventory.Const.Actions = {
[ArkInventory.Const.ActionID.MainMenu] = {
Texture = nil,
Name = ArkInventory.Localise["MENU"],
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.MenuMainOpen( self )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["MENU"] )
end,
},
},
[ArkInventory.Const.ActionID.Close] = {
Texture = [[Interface\RAIDFRAME\ReadyCheck-NotReady]],
Name = ArkInventory.Localise["CLOSE"],
Scripts = {
OnClick = function( self, button )
if not self then return end
local loc_id = self:GetParent( ):GetParent( ):GetID( )
ArkInventory.Frame_Main_Hide( loc_id )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["CLOSE"] )
end,
},
},
[ArkInventory.Const.ActionID.EditMode] = {
Texture = [[Interface\Icons\Trade_Engineering]],
Name = ArkInventory.Localise["MENU_ACTION_EDITMODE"],
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
ArkInventory.ToggleEditMode( )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["MENU_ACTION_EDITMODE"] )
end,
},
},
[ArkInventory.Const.ActionID.Rules] = {
--Texture = [[Interface\Icons\INV_Misc_Note_05]],
--Texture = [[Interface\Icons\Interface\Icons\INV_Gizmo_02]],
Texture = [[Interface\Icons\INV_Misc_Book_10]],
Name = ArkInventory.Localise["CONFIG_RULE_PLURAL"],
LDB = true,
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
ArkInventory.Frame_Rules_Toggle( )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["CONFIG_RULE_PLURAL"] )
end,
},
},
[ArkInventory.Const.ActionID.Search] = {
--Texture = [[Interface\Icons\INV_Misc_EngGizmos_20]],
Texture = [[Interface\Minimap\Tracking\None]],
Name = ArkInventory.Localise["SEARCH"],
LDB = true,
Scripts = {
OnClick = function( self, button )
if not self then return end
if button == "RightButton" then
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
local loc_id = self:GetParent( ):GetParent( ):GetID( )
if ArkInventory.Global.Location[loc_id].canSearch then
ArkInventory.Global.Location[loc_id].filter = ""
local me = ArkInventory.GetPlayerCodex( loc_id )
me.style.search.hide = not me.style.search.hide
ArkInventory.Frame_Main_Generate( nil, ArkInventory.Const.Window.Draw.Refresh )
end
else
ArkInventory.Search.Frame_Toggle( )
end
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["SEARCH"] )
end,
},
},
[ArkInventory.Const.ActionID.SwitchCharacter] = {
Texture = [[Interface\Icons\INV_Misc_GroupLooking]],
Name = ArkInventory.Localise["MENU_CHARACTER_SWITCH"],
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
ArkInventory.MenuSwitchCharacterOpen( self )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["MENU_CHARACTER_SWITCH"] )
end,
},
},
[ArkInventory.Const.ActionID.SwitchLocation] = {
Texture = [[Interface\Icons\INV_Helmet_47]],
Name = ArkInventory.Localise["MENU_LOCATION_SWITCH"],
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
ArkInventory.MenuSwitchLocationOpen( self )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["MENU_LOCATION_SWITCH"] )
end,
},
},
[ArkInventory.Const.ActionID.Restack] = {
Texture = [[Interface\Icons\Spell_Shadow_DestructiveSoul]], -- find texture used by bags-button-autosort-up
Name = ArkInventory.Localise["RESTACK"],
Scripts = {
OnClick = function( self, button )
if not self then return end
if button == "RightButton" then
ArkInventory.MenuRestackOpen( self )
else
local loc_id = self:GetParent( ):GetParent( ):GetID( )
ArkInventory.Restack( loc_id )
end
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["RESTACK"] )
end,
},
},
[ArkInventory.Const.ActionID.Changer] = {
Texture = [[Interface\Icons\INV_Misc_EngGizmos_17]],
Name = ArkInventory.Localise["MENU_ACTION_BAGCHANGER"],
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
ArkInventory.ToggleChanger( self:GetParent( ):GetParent( ):GetID( ) )
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["MENU_ACTION_BAGCHANGER"] )
end,
},
},
[ArkInventory.Const.ActionID.Refresh] = {
Texture = [[Interface\Icons\Spell_Frost_Stun]],
Name = ArkInventory.Localise["REFRESH"],
Scripts = {
OnClick = function( self, button )
if not self then return end
ArkInventory.Frame_Main_Level( self:GetParent( ):GetParent( ) )
if button == "RightButton" then
ArkInventory.MenuRefreshOpen( self )
else
local loc_id = self:GetParent( ):GetParent( ):GetID( )
--ArkInventory.OutputWarning( "refresh action - .Recalculate" )
ArkInventory.Frame_Main_Generate( loc_id, ArkInventory.Const.Window.Draw.Recalculate )
end
end,
OnEnter = function( self )
ArkInventory.GameTooltipSetText( self, ArkInventory.Localise["REFRESH"] )
end,
},
},
}
ArkInventory.Const.Skills = {
Primary = 2,
Secondary = 4,
Data = {
-- primary crafting
[171] = {
id = "SKILL_ALCHEMY",
pt = "TradeskillResultMats.Reverse.Alchemy,Tradeskill.Tool.Alchemy",
text = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_ALCHEMY"],
},
[164] = {
id = "SKILL_BLACKSMITHING",
pt = "TradeskillResultMats.Reverse.Blacksmithing,Tradeskill.Tool.Blacksmithing",
text = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_BLACKSMITHING"],
},
[333] = {
id = "SKILL_ENCHANTING",
pt = "TradeskillResultMats.Reverse.Enchanting,Tradeskill.Tool.Enchanting",
text = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_ENCHANTING"],
},
[202] = {
id = "SKILL_ENGINEERING",
pt = "TradeskillResultMats.Reverse.Engineering,Tradeskill.Tool.Engineering",
text = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_ENGINEERING"],
},
[773] = {
id = "SKILL_INSCRIPTION",
pt = "TradeskillResultMats.Reverse.Inscription,Tradeskill.Tool.Inscription",
text = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_INSCRIPTION"],
},
[755] = {
id = "SKILL_JEWELCRAFTING",
pt = "TradeskillResultMats.Reverse.Jewelcrafting,Tradeskill.Tool.Jewelcrafting",
text = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_JEWELCRAFTING"],
},
[165] = {
id = "SKILL_LEATHERWORKING",
pt = "TradeskillResultMats.Reverse.Leatherworking,Tradeskill.Tool.Leatherworking",
text = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_LEATHERWORKING"],
},
[197] = {
id = "SKILL_TAILORING",
pt = "TradeskillResultMats.Reverse.Tailoring,Tradeskill.Tool.Tailoring",
text = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_TAILORING"],
},
-- primary collecting
[182] = {
id = "SKILL_HERBALISM",
pt = "Tradeskill.Mat.ByType.Herb",
text = ArkInventory.Localise["WOW_SKILL_HERBALISM"],
},
[186] = {
id = "SKILL_MINING",
pt = "Tradeskill.Tool.Mining,TradeskillResultMats.Forward.Smelting,TradeskillResultMats.Reverse.Smelting",
text = ArkInventory.Localise["WOW_SKILL_MINING"],
},
[393] = {
id = "SKILL_SKINNING",
pt = "Tradeskill.Tool.Skinning,Tradeskill.Mat.ByType.Leather",
text = ArkInventory.Localise["WOW_SKILL_SKINNING"],
},
-- secondary
[794] = {
id = "SKILL_ARCHAEOLOGY",
pt = "Tradeskill.Mat.ByType.Keystone",
text = ArkInventory.Localise["WOW_SKILL_ARCHAEOLOGY"],
},
[185] = {
id = "SKILL_COOKING",
pr = "TradeskillResultMats.Reverse.Cooking",
text = ArkInventory.Localise["WOW_SKILL_COOKING"],
},
[129] = {
id = "FIRST_AID",
pt = "TradeskillResultMats.Forward.First Aid",
text = ArkInventory.Localise["WOW_SKILL_FIRSTAID"],
},
[356] = {
id = "SKILL_FISHING",
pt = "Tradeskill.Tool.Fishing",
text = ArkInventory.Localise["WOW_SKILL_FISHING"],
},
},
}
ArkInventory.Const.Slot.Data = {
[ArkInventory.Const.Slot.Type.Unknown] = {
["name"] = ArkInventory.Localise["UNKNOWN"],
["long"] = ArkInventory.Localise["UNKNOWN"],
["type"] = ArkInventory.Localise["UNKNOWN"],
},
[ArkInventory.Const.Slot.Type.Bag] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_BAG"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
},
[ArkInventory.Const.Slot.Type.Herb] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_HERB"],
["long"] = ArkInventory.Localise["WOW_SKILL_HERBALISM"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_HERB"],
},
[ArkInventory.Const.Slot.Type.Enchanting] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_ENCHANTING"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_TRADEGOODS_ENCHANTING"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_ENCHANTING"],
},
[ArkInventory.Const.Slot.Type.Engineering] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_ENGINEERING"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_ENGINEERING"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_ENGINEERING"],
},
[ArkInventory.Const.Slot.Type.Gem] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_GEM"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_GEM"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_GEM"],
},
[ArkInventory.Const.Slot.Type.Mining] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_MINING"],
["long"] = ArkInventory.Localise["WOW_SKILL_MINING"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_MINING"],
},
[ArkInventory.Const.Slot.Type.Leatherworking] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_LEATHERWORKING"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_LEATHERWORKING"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_LEATHERWORKING"],
},
[ArkInventory.Const.Slot.Type.Inscription] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_INSCRIPTION"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_RECIPE_INSCRIPTION"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_INSCRIPTION"],
},
[ArkInventory.Const.Slot.Type.Wearing] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_GEAR"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Mail] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_MAIL"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Critter] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_CRITTER"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["PET"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Mount] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_MOUNT"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_MISC_MOUNT"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Toybox] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_TOY"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["TOY"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Heirloom] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_HEIRLOOM"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["HEIRLOOM"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Token] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_TOKEN"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_BAG"],
["type"] = ArkInventory.Localise["CURRENCY"],
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Auction] = {
["name"] = AUCTIONS,
["long"] = AUCTIONS,
["type"] = AUCTIONS,
["hide"] = true,
},
[ArkInventory.Const.Slot.Type.Tackle] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_TACKLE"],
["long"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_FISHING"],
["type"] = ArkInventory.Localise["WOW_ITEM_CLASS_CONTAINER_FISHING"],
},
[ArkInventory.Const.Slot.Type.Void] = {
["name"] = ArkInventory.Localise["VOIDSTORAGE"],
["long"] = ArkInventory.Localise["VOIDSTORAGE"],
["type"] = ArkInventory.Localise["VOIDSTORAGE"],
["texture"] = [[Interface\AddOns\ArkInventory\Images\VoidStorageSlot.tga]],
},
[ArkInventory.Const.Slot.Type.Cooking] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_COOKING"],
["long"] = ArkInventory.Localise["WOW_SKILL_COOKING"],
["type"] = ArkInventory.Localise["WOW_SKILL_COOKING"],
},
[ArkInventory.Const.Slot.Type.ReagentBank] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_REAGENTBANK"],
["long"] = ArkInventory.Localise["REAGENTBANK"],
["type"] = ArkInventory.Localise["REAGENTBANK"],
--["texture"] = [[Interface\Paperdoll\UI-PaperDoll-Slot-Relic]],
},
[ArkInventory.Const.Slot.Type.Reputation] = {
["name"] = ArkInventory.Localise["STATUS_SHORTNAME_REPUTATION"],
["long"] = ArkInventory.Localise["REPUTATION"],
["type"] = ArkInventory.Localise["REPUTATION"],
},
}
ArkInventory.Const.AnchorText = {
}
ArkInventory.Global = { -- globals
Enabled = false,
Version = "", --calculated
Me = {
-- this will always point to the current characters data
data = nil,
},
Mode = {
Bank = false,
Vault = false,
Mail = false,
Merchant = false,
Auction = false,
Void = false,
Edit = false,
Combat = false,
},
LeaveCombatRun = { }, -- [loc_id] = true
Tooltip = {
Scan = nil,
WOW = {
GameTooltip,
ShoppingTooltip1,
ShoppingTooltip2,
ItemRefTooltip,
ItemRefShoppingTooltip1,
ItemRefShoppingTooltip2,
WorldMapCompareTooltip1,
WorldMapCompareTooltip2,
},
},
Category = { }, -- see CategoryGenerate( ) for how this gets populated
Location = {
[ArkInventory.Const.Location.Bag] = {
id = ArkInventory.Const.Location.Bag,
isActive = true,
Internal = "bag",
Name = ArkInventory.Localise["BACKPACK"],
Texture = [[Interface\Icons\INV_Misc_Bag_07_Green]],
bagCount = 1, -- actual value set in OnLoad
Bags = { },
canRestack = true,
hasChanger = true,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = true,
template = "ARKINV_TemplateButtonItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Bank] = {
id = ArkInventory.Const.Location.Bank,
isActive = true,
Internal = "bank",
Name = ArkInventory.Localise["BANK"],
Texture = [[Interface\Icons\INV_Box_02]],
bagCount = 1, -- set in OnLoad
Bags = { },
canRestack = true,
hasChanger = true,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = true,
canView = true,
canOverride = true,
canPurge = true,
tabReagent = nil, -- set in OnLoad
template = "ARKINV_TemplateButtonItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Vault] = {
id = ArkInventory.Const.Location.Vault,
isActive = true,
Internal = "vault",
Name = ArkInventory.Localise["VAULT"],
--Texture = [[Interface\Icons\INV_Misc_Coin_02]],
--Texture = [[Interface\ICONS\INV_Misc_Gem_Topaz_01]],
Texture = [[Interface\ICONS\INV_Trinket_80_Titan02d]],
bagCount = 1, -- actual value set in OnLoad
Bags = { },
canRestack = true,
hasChanger = true,
canSearch = true,
isVault = true,
maxBar = 0,
maxSlot = { },
isOffline = true,
canView = true,
canOverride = true,
canPurge = true,
template = "ARKINV_TemplateButtonVaultItem",
drawState = ArkInventory.Const.Window.Draw.Init,
view_tab = 1,
view_mode = "bank",
view_load = true,
},
[ArkInventory.Const.Location.Mail] = {
id = ArkInventory.Const.Location.Mail,
isActive = true,
Internal = "mail",
Name = ArkInventory.Localise["MAILBOX"],
--Texture = [[Interface\Icons\INV_Letter_01]]
Texture = [[Interface\Minimap\Tracking\Mailbox]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = true,
canView = true,
canOverride = nil,
canPurge = true,
template = "ARKINV_TemplateButtonMailItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Wearing] = {
id = ArkInventory.Const.Location.Wearing,
isActive = true,
Internal = "wearing",
Name = ArkInventory.Localise["LOCATION_WEARING"],
--Texture = [[Interface\Icons\INV_Boots_05]],
Texture = [[Interface\ICONS\INV_OrderHall_ArmamentupgradeBlue]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Pet] = {
id = ArkInventory.Const.Location.Pet,
isAccount = true,
isActive = true,
Internal = "pet",
Name = ArkInventory.Localise["PET"],
--Texture = [[Interface\Icons\PetJournalPortrait]],
Texture = [[Interface\ICONS\INV_Misc_FireKitty]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
canPurge = true,
template = "ARKINV_TemplateButtonBattlepetItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Mount] = {
id = ArkInventory.Const.Location.Mount,
isAccount = true,
isActive = true,
Internal = "mount",
Name = ArkInventory.Localise["MOUNT"],
Texture = [[Interface\Icons\MountJournalPortrait]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
canPurge = true,
template = "ARKINV_TemplateButtonMountItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Toybox] = {
id = ArkInventory.Const.Location.Toybox,
isAccount = true,
isActive = true,
Internal = "toybox",
Name = ArkInventory.Localise["TOYBOX"],
--Texture = [[Interface\Icons\Trade_Archaeology_ChestofTinyGlassAnimals]],
Texture = [[Interface\ICONS\INV_Misc_Toy_02]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
canPurge = true,
template = "ARKINV_TemplateButtonToyboxItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Heirloom] = {
id = ArkInventory.Const.Location.Heirloom,
isAccount = true,
isActive = true,
Internal = "heirloom",
Name = ArkInventory.Localise["HEIRLOOM"],
Texture = [[Interface\Icons\inv_misc_enggizmos_19]],
--Texture = [[Interface\ICONS\Spell_Shadow_LastingAfflictions]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
--template = "ARKINV_TemplateButtonHeirloomItem",
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Token] = {
id = ArkInventory.Const.Location.Token,
isActive = true,
Internal = "token",
Name = ArkInventory.Localise["CURRENCY"],
--Texture = [[Interface\ICONS\Spell_Holy_ChampionsBond]],
--Texture = [[Interface\ICONS\ABILITY_Rogue_RollTheBones05]],
Texture = [[Interface\ICONS\inv_misc_coinbag_special]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Auction] = {
id = ArkInventory.Const.Location.Auction,
isActive = false,
Internal = "auction",
Name = AUCTIONS,
--Texture = [[Interface\Minimap\Tracking\Auctioneer]],
Texture = [[Interface\ICONS\INV_Misc_Coin_04]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = true,
canView = true,
canOverride = nil,
canPurge = true,
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Void] = {
id = ArkInventory.Const.Location.Void,
isActive = true,
Internal = "void",
Name = ArkInventory.Localise["VOIDSTORAGE"],
Texture = [[Interface\Icons\Spell_Nature_AstralRecalGroup]],
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = true,
canView = true,
canOverride = nil,
canPurge = true,
drawState = ArkInventory.Const.Window.Draw.Init,
},
[ArkInventory.Const.Location.Reputation] = {
id = ArkInventory.Const.Location.Reputation,
isActive = true,
Internal = "reputation",
Name = ArkInventory.Localise["REPUTATION"],
Texture = [[Interface\ICONS\Raf-Icon]], --Ability_PVP_DefenderoftheWeak
bagCount = 1,
Bags = { },
canRestack = nil,
hasChanger = nil,
canSearch = true,
maxBar = 0,
maxSlot = { },
isOffline = false,
canView = true,
canOverride = nil,
canPurge = true,
drawState = ArkInventory.Const.Window.Draw.Init,
},
},
Cache = {
ItemCountRaw = { }, -- key generated via ObjectIDCount( )
ItemCountTooltip = { }, -- key generated via ObjectIDCount( )
ItemSearchData = { }, -- key generated via ObjectIDCount( )
StackCompress = { }, -- key generated via ObjectIDCount( )
SentMail = { }, -- keeps track of any sent mail to other characters you have
BlizzardBagIdToInternalId = { },
},
Thread = {
-- Use = false, -- !!! comment out when done testing
Use = true,
WindowState = { },
data = { },
Format = {
Force = "*",
--Restack = "p1-restack-%s",
Restack = "p1-restack",
Collection = "p2-scan-%s",
Scan = "p3-scan-%s-%s",
Window = "p4-draw-%s",
LDB = "p5-ldb-%s",
Tooltip = "p9-tooltip",
JunkSell = "p9-junksell",
},
},
Options = {
Location = ArkInventory.Const.Location.Bag,
ShowHiddenItems = false,
ConfigSortMethodListSort = 1,
ConfigSortMethodListShow = 1,
ConfigCategoryCustomListSort = 1,
ConfigCategoryCustomListShow = 1,
ConfigCategoryRuleListSort = 1,
ConfigCategoryRuleListShow = 1,
ConfigCategoryRuleListSet = 9999,
ConfigCategorysetListSort = 1,
ConfigCategorysetListShow = 1,
ConfigDesignListSort = 1,
ConfigDesignListShow = 1,
ConfigProfileListSort = 1,
ConfigProfileListShow = 1,
SortKeyBagAssignmentSort = true,
BarMoveSource = nil,
BarMoveDestination = nil,
},
Rules = {
Enabled = false, -- change this to module check
},
NewItemResetTime = nil,
Junk = {
run = false,
sold = 0,
destroyed = 0,
money = 0,
},
}
ArkInventory.Config = {
Internal = {
type = "group",
childGroups = "tree",
name = ArkInventory.Const.Program.Name,
},
Blizzard = {
type = "group",
childGroups = "tree",
name = ArkInventory.Const.Program.Name,
},
}
ArkInventory.Collection = { }
-- Binding Variables
BINDING_HEADER_ARKINV = ArkInventory.Const.Program.Name
BINDING_NAME_ARKINV_TOGGLE_BAG = ArkInventory.Localise["BACKPACK"]
BINDING_NAME_ARKINV_TOGGLE_BANK = ArkInventory.Localise["BANK"]
BINDING_NAME_ARKINV_TOGGLE_VAULT = ArkInventory.Localise["VAULT"]
BINDING_NAME_ARKINV_TOGGLE_MAIL = ArkInventory.Localise["MAILBOX"]
BINDING_NAME_ARKINV_TOGGLE_WEARING = ArkInventory.Localise["LOCATION_WEARING"]
BINDING_NAME_ARKINV_TOGGLE_PET = ArkInventory.Localise["PET"]
BINDING_NAME_ARKINV_TOGGLE_MOUNT = ArkInventory.Localise["MOUNT"]
BINDING_NAME_ARKINV_TOGGLE_TOYBOX = ArkInventory.Localise["TOYBOX"]
BINDING_NAME_ARKINV_TOGGLE_HEIRLOOM = ArkInventory.Localise["HEIRLOOM"]
BINDING_NAME_ARKINV_TOGGLE_TOKEN = ArkInventory.Localise["CURRENCY"]
BINDING_NAME_ARKINV_TOGGLE_VOID = ArkInventory.Localise["VOIDSTORAGE"]
BINDING_NAME_ARKINV_TOGGLE_EDIT = ArkInventory.Localise["MENU_ACTION_EDITMODE"]
BINDING_NAME_ARKINV_TOGGLE_RULES = ArkInventory.Localise["CONFIG_RULE_PLURAL"]
BINDING_NAME_ARKINV_TOGGLE_SEARCH = ArkInventory.Localise["SEARCH"]
BINDING_NAME_ARKINV_REFRESH = ArkInventory.Localise["REFRESH"]
BINDING_NAME_ARKINV_RELOAD = ArkInventory.Localise["RELOAD"]
BINDING_NAME_ARKINV_RESTACK = ArkInventory.Localise["RESTACK"]
BINDING_NAME_ARKINV_MENU = ArkInventory.Localise["MENU"]
BINDING_NAME_ARKINV_CONFIG = ArkInventory.Localise["CONFIG_TEXT"]
BINDING_NAME_ARKINV_LDB_PETS_SUMMON = ArkInventory.Localise["LDB_PETS_SUMMON"]
_G["BINDING_NAME_CLICK ARKINV_MountToggle:LeftButton"] = ArkInventory.Localise["LDB_MOUNTS_SUMMON"]
ArkInventory.Const.DatabaseDefaults.global = {
["option"] = {
["version"] = 0,
["auto"] = {
["open"] = {
["*"] = true,
},
["close"] = {
["*"] = true,
},
["reposition"] = true,
},
["design"] = { -- layout and style data
["data"] = {
["**"] = {
["system"] = false,
["used"] = "N", -- Y(es) | N(o) | D(eleted)
["name"] = "",
-- ** style **
["font"] = {
["custom"] = false,
["face"] = ArkInventory.Const.Font.Face,
["height"] = ArkInventory.Const.Font.Height,
},
["window"] = {
["scale"] = 1,
["width"] = 16,
["height"] = 800,
["border"] = {
["style"] = ArkInventory.Const.Texture.BorderDefault,
["size"] = nil,
["offset"] = nil,
["scale"] = 1,
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
},
["pad"] = 8,
["background"] = {
["style"] = ArkInventory.Const.Texture.BackgroundDefault,
["colour"] = {
["r"] = 0,
["g"] = 0,
["b"] = 0,
["a"] = 0.75,
},
},
["strata"] = "MEDIUM",
["list"] = false,
},
["bar"] = {
["per"] = 5,
["pad"] = {
["internal"] = 8,
["external"] = 8,
},
["border"] = {
["style"] = ArkInventory.Const.Texture.BorderDefault,
["size"] = nil,
["offset"] = nil,
["scale"] = 1,
["colour"] = {
["r"] = 0.3,
["g"] = 0.3,
["b"] = 0.3,
},
},
["background"] = {
["colour"] = {
["r"] = 0,
["g"] = 0,
["b"] = 0.4,
["a"] = 0.4,
},
},
["showempty"] = false,
["anchor"] = ArkInventory.Const.Anchor.BottomRight,
["compact"] = false,
["hide"] = false,
["name"] = {
["show"] = false,
["colour"] = {
["r"] = 1,
["b"] = 1,
["g"] = 1,
},
["height"] = ArkInventory.Const.Font.Height,
["justify"] = ArkInventory.Const.Anchor.Left,
["anchor"] = ArkInventory.Const.Anchor.Default,
},
["data"] = { -- ** layout **
["*"] = {
["sort"] = {
["method"] = nil,
},
["border"] = {
["custom"] = 1, -- 1 = default, 2 = custom
["colour"] = {
["r"] = 0.3,
["g"] = 0.3,
["b"] = 0.3,
},
},
["background"] = {
["custom"] = 1, -- 1 = default, 2 = custom, 3 = border
["colour"] = {
["r"] = 0,
["g"] = 0,
["b"] = 0.4,
["a"] = 0.4,
},
},
["name"] = {
["text"] = "",
["custom"] = 1, -- 1 = default, 2 = custom
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
},
["width"] = {
["min"] = nil,
["max"] = nil,
},
},
},
},
["slot"] = {
["empty"] = {
["alpha"] = 1,
["icon"] = true,
["border"] = true,
["first"] = 0,
["clump"] = false,
["position"] = true,
},
["data"] = { -- slot type data
["**"] = {
["colour"] = { r = 0.30, g = 0.30, b = 0.30 },
},
[ArkInventory.Const.Slot.Type.Unknown] = {
["colour"] = { r = 1.00, g = 0.00, b = 0.00 },
},
[ArkInventory.Const.Slot.Type.Herb] = {
["colour"] = { r = 0.00, g = 1.00, b = 0.00 },
},
[ArkInventory.Const.Slot.Type.Enchanting] = {
["colour"] = { r = 0.06, g = 0.88, b = 0.93 },
},
[ArkInventory.Const.Slot.Type.Engineering] = {
["colour"] = { r = 0.61, g = 0.74, b = 0.29 },
},
[ArkInventory.Const.Slot.Type.Gem] = {
["colour"] = { r = 0.63, g = 0.00, b = 0.56 },
},
[ArkInventory.Const.Slot.Type.Mining] = {
["colour"] = { r = 0.79, g = 0.79, b = 0.00 },
},
[ArkInventory.Const.Slot.Type.Leatherworking] = {
["colour"] = { r = 0.63, g = 0.45, b = 0.10 },
},
[ArkInventory.Const.Slot.Type.Inscription] = {
["colour"] = { r = 0.46, g = 0.67, b = 0.63 },
},
[ArkInventory.Const.Slot.Type.Tackle] = {
["colour"] = { r = 0.12, g = 0.56, b = 0.42 },
},
[ArkInventory.Const.Slot.Type.ReagentBank] = {
["colour"] = { r = 0.10, g = 0.30, b = 1.00 },
},
},
["pad"] = 4,
["border"] = {
["style"] = ArkInventory.Const.Texture.BorderDefault,
["size"] = nil,
["offset"] = nil,
["scale"] = 1,
["rarity"] = true,
["raritycutoff"] = LE_ITEM_QUALITY_POOR,
},
["anchor"] = ArkInventory.Const.Anchor.BottomRight,
["age"] = {
["show"] = false,
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
["cutoff"] = 0,
["font"] = {
["height"] = ArkInventory.Const.Font.Height,
},
},
["offline"] = {
["fade"] = true,
},
["unusable"] = {
["tint"] = false,
},
["cooldown"] = {
["show"] = true,
["global"] = false,
["combat"] = true,
},
["scale"] = 1,
["itemlevel"] = {
["show"] = false,
["anchor"] = ArkInventory.Const.Anchor.Default,
["min"] = 1,
["colour"] = {
["r"] = 1,
["g"] = 0.82,
["b"] = 0,
},
["font"] = {
["height"] = ArkInventory.Const.Font.Height,
},
},
["itemcount"] = {
["show"] = true,
["anchor"] = ArkInventory.Const.Anchor.Default,
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
["font"] = {
["height"] = ArkInventory.Const.Font.Height,
},
},
["new"] = {
["enable"] = false,
["cutoff"] = 2,
},
["compress"] = {
["count"] = 0,
["identify"] = false,
["position"] = 1,
},
-- ["upgrade"] = true, -- need to remove from saved data
["upgradeicon"] = {
["show"] = true,
["anchor"] = ArkInventory.Const.Anchor.Default,
},
["junkicon"] = {
["show"] = false,
["anchor"] = ArkInventory.Const.Anchor.Default,
["merchant"] = true,
},
["transmogicon"] = {
["show"] = true,
["anchor"] = ArkInventory.Const.Anchor.Default,
["alternative"] = true,
},
["size"] = ArkInventory.Const.SLOT_SIZE,
["quest"] = {
["bang"] = true,
["border"] = true,
},
},
["title"] = {
["hide"] = false,
["size"] = 1,
["colour"] = {
["online"] = {
["r"] = 0,
["g"] = 1,
["b"] = 0,
},
["offline"] = {
["r"] = 1,
["g"] = 0,
["b"] = 0,
},
},
["font"] = {
["height"] = 20,
},
},
["search"] = {
["hide"] = false,
["label"] = {
["colour"] = {
["r"] = 0,
["g"] = 1,
["b"] = 0,
},
},
["text"] = {
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
},
["font"] = {
["height"] = 12,
},
},
["changer"] = {
["hide"] = false,
["highlight"] = {
["show"] = true,
["colour"] = {
["r"] = 0,
["g"] = 1,
["b"] = 0,
},
},
["freespace"] = {
["show"] = true,
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
},
["font"] = {
["height"] = 20,
},
},
["status"] = {
["hide"] = false,
["emptytext"] = { -- slot>empty>display
["show"] = true,
["colour"] = false,
["full"] = true,
["includetype"] = true,
},
["font"] = {
["height"] = 16,
},
},
["sort"] = {
["when"] = ArkInventory.Const.SortWhen.Open,
["method"] = 9999, -- the default sort method for this layout
},
-- ** layout **
["bag"] = {
["*"] = { -- [bag_id]
["bar"] = nil, -- bar number to put all bag slots on
},
},
["category"] = {
["*"] = nil, -- [category number] = bar number to put it on
},
},
[9999] = {
["system"] = true,
["used"] = "Y",
["name"] = ArkInventory.Localise["DEFAULT"],
},
[9998] = {
["system"] = true,
["used"] = "Y",
["name"] = ArkInventory.Localise["VAULT"],
["window"] = {
["width"] = NUM_SLOTS_PER_GUILDBANK_GROUP,
},
["sort"] = {
["method"] = 9995,
},
},
[9997] = {
["system"] = true,
["used"] = "Y",
["name"] = "List",
["window"] = {
["list"] = true,
["width"] = 10,
},
["bar"] = {
["per"] = 1,
["data"] = {
[1] = {
["width"] = {
["max"] = 1,
},
},
},
},
["slot"] = {
["anchor"] = ArkInventory.Const.Anchor.BottomLeft,
},
["changer"] = {
["hide"] = true,
},
["status"] = {
["hide"] = true,
},
["sort"] = {
["method"] = 9993,
},
},
[1000] = {
["system"] = false,
["used"] = "Y",
["name"] = ArkInventory.Localise["DEFAULT"],
},
},
["min"] = 1000,
["next"] = 1000,
["max"] = 8999,
},
["category"] = {
["**"] = {
--[[
see ArkInventory.Const.Category.Type
-- System = 1,
-- Custom = 2,
-- Rule = 3,
]]--
["data"] = {
["**"] = { -- [number] = { data }
["system"] = false,
["used"] = "N", -- Y(es) | N(o) | D(eleted)
["name"] = "",
-- rules
["order"] = 1000,
["formula"] = "false",
["damaged"] = false,
},
},
["min"] = 1000,
["next"] = 1000,
["max"] = 8999,
},
},
["catset"] = { -- category sets
["data"] = {
["**"] = {
["system"] = false,
["used"] = "N", -- Y(es) | N(o) | D(eleted)
["name"] = "",
["category"] = {
["assign"] = {
["*"] = nil, -- item id = category number to assign the item to
},
["active"] = {
["*"] = { -- category type
["*"] = false, -- category id = enabled
},
[ArkInventory.Const.Category.Type.System] = {
["*"] = true,
},
},
["junk"] = {
["*"] = { -- category type
["*"] = false, -- true = autosell
},
[ArkInventory.Const.Category.Type.System] = {
["*"] = false,
[402] = true,
},
},
},
},
[9999] = {
["system"] = true,
["used"] = "Y",
["name"] = ArkInventory.Localise["DEFAULT"],
},
[1000] = {
["system"] = false,
["used"] = "Y",
["name"] = ArkInventory.Localise["DEFAULT"],
},
},
["min"] = 1000,
["next"] = 1000,
["max"] = 8999,
},
["profile"] = {
["data"] = {
["**"] = { -- id
["system"] = false,
["used"] = "N", -- Y(es) | N(o) | D(eleted)
["name"] = "",
["location"] = {
["**"] = { -- loc_id
["monitor"] = true,
["save"] = true,
["override"] = false,
["special"] = true,
["notify"] = false,
["anchor"] = {
["point"] = ArkInventory.Const.Anchor.TopRight,
["locked"] = false,
["t"] = nil,
["b"] = nil,
["l"] = nil,
["r"] = nil,
},
["style"] = 1000,
["layout"] = 1000,
["catset"] = 1000,
["container"] = {
["width"] = 400,
["height"] = 400,
},
},
[ArkInventory.Const.Location.Bag] = {
["notify"] = true,
["override"] = true,
},
[ArkInventory.Const.Location.Bank] = {
["notify"] = true,
["override"] = true,
},
[ArkInventory.Const.Location.Vault] = {
["notify"] = true,
["override"] = true,
},
},
},
[1000] = {
["system"] = false,
["used"] = "Y",
["name"] = ArkInventory.Localise["DEFAULT"],
},
[9999] = {
["system"] = true,
["used"] = "Y",
["name"] = ArkInventory.Localise["DEFAULT"],
},
},
["min"] = 1000,
["next"] = 1000,
["max"] = 8999,
},
["sort"] = {
["method"] = {
["data"] = {
["**"] = {
["system"] = false,
["used"] = "N", -- Y(es) | N(o) | D(eleted)
["name"] = "",
["bagslot"] = true,
["ascending"] = true,
["reversed"] = false,
["active"] = { },
["order"] = { },
},
[9999] = {
["system"] = true,
["used"] = "Y",
["name"] = ArkInventory.Localise["CONFIG_SORTING_METHOD_BAGSLOT"],
},
[9998] = {
["system"] = true,
["used"] = "Y",
["name"] = "Rarity > Category > Location > Name",
["bagslot"] = false,
["active"] = {
["quality"] = true,
["category"] = true,
["location"] = true,
["name"] = true,
},
["order"] = {
[1] = "quality",
[2] = "category",
[3] = "location",
[4] = "name",
},
},
[9997] = {
["system"] = true,
["used"] = "Y",
["name"] = "Name (Ascending)",
["bagslot"] = false,
["active"] = {
["name"] = true,
},
["order"] = {
[1] = "name",
},
},
[9996] = {
["system"] = true,
["used"] = "Y",
["name"] = "Vendor Price",
["bagslot"] = false,
["active"] = {
["vendorprice"] = true,
},
["order"] = {
[1] = "vendorprice",
},
},
[9995] = {
["system"] = true,
["used"] = "Y",
["name"] = string.format( "%s / %s", ArkInventory.Localise["VAULT"], ArkInventory.Localise["VOIDSTORAGE"] ),
},
[9994] = {
["system"] = true,
["used"] = "Y",
["name"] = "Name (Descending)",
["bagslot"] = false,
["ascending"] = false,
["active"] = {
["name"] = true,
},
["order"] = {
[1] = "name",
},
},
[9993] = {
["system"] = true,
["used"] = "Y",
["name"] = string.format( "%s (%s)", ArkInventory.Localise["CONFIG_SORTING_METHOD_BAGSLOT"], "Descending" ),
["ascending"] = false,
},
},
["min"] = 1000,
["next"] = 1000,
["max"] = 8999,
},
},
["showdisabled"] = true,
["restack"] = {
["blizzard"] = true, -- use blizzard cleanup function
-- cleanup options
["reverse"] = false,
["deposit"] = false, -- blizzard - run deposit all items
-- restack options
["refresh"] = false, -- do a refresh when the restack is finished
["topup"] = true, -- top up stacks in the bank (and reagent bank) with items from bags
["bank"] = false, -- fill up empty bank slots from bag
["priority"] = true, -- true = full reagent bank first, false = fill profession bags first
},
["bucket"] = {
["*"] = nil
},
["bugfix"] = {
["framelevel"] = {
["enable"] = true,
["alert"] = 0,
},
["zerosizebag"] = {
["enable"] = true,
["alert"] = true,
},
},
["tooltip"] = {
["show"] = true, -- show tooltips for items
["scale"] = {
["enabled"] = false,
["amount"] = 1,
},
["me"] = false, -- only show my data
["highlight"] = "", -- highlight my data
["faction"] = true, -- only show my faction
["realm"] = true, -- only show my realm
["crossrealm"] = false, -- show connected realms
["add"] = { -- things to add to the tooltip
["empty"] = false, -- empty line / seperator
["count"] = true, -- item count
["vendor"] = false, -- vendor price (deprecated)
["ilvl"] = false, -- item level (deprecated)
["vault"] = true,
["tabs"] = true,
},
["colour"] = {
["count"] = {
["r"] = 1,
["g"] = 0.5,
["b"] = 0.15,
},
["vendor"] = {
["r"] = 0.5,
["g"] = 0.5,
["b"] = 0.5,
},
["class"] = false,
},
["battlepet"] = {
["enable"] = true,
["source"] = true,
["description"] = true,
["mouseover"] = {
["enable"] = true,
["detailed"] = true,
},
},
["reputation"] = { -- need to add this to the config at some point
["enable"] = true,
["description"] = true,
["custom"] = 1, -- 1 = default, 2 = custom
["style"] = {
["normal"] = "",
["count"] = "",
},
},
["precalc"] = false,
["refresh"] = true,
},
["tracking"] = {
["items"] = { },
["reputation"] = {
["custom"] = 1, -- 1 = default, 2 = custom
["style"] = {
["ldb"] = "",
["tooltip"] = "",
},
},
},
["message"] = {
["translation"] = {
["interim"] = true,
["final"] = true,
},
["restack"] = {
["*"] = true,
},
["battlepet"] = {
["opponent"] = true,
},
["mount"] = {
["warnings"] = true,
},
["bag"] = {
["unknown"] = true,
},
["rules"] = {
["hooked"] = true,
["registration"] = true,
},
},
["mount"] = {
["correction"] = { }, -- [spell] = mountType
},
["junk"] = {
["sell"] = false,
["limit"] = true,
["delete"] = false,
["notify"] = true,
["raritycutoff"] = LE_ITEM_QUALITY_POOR, -- max quality to sell/destroy
["list"] = true,
["test"] = true,
},
["font"] = {
["face"] = ArkInventory.Const.Font.Face,
["height"] = ArkInventory.Const.Font.Height,
},
["menu"] = {
["font"] = {
["face"] = ArkInventory.Const.Font.Face,
["height"] = ArkInventory.Const.Font.Height,
},
},
["newitemglow"] = {
["enable"] = true,
["colour"] = { r = 0.7, g = 0.7, b = 0.7, a = 0.5 },
["clearonclose"] = false,
},
["transmog"] = {
["enable"] = true,
["anchor"] = ArkInventory.Const.Anchor.Default,
["secondary"] = false,
["icon"] = {
[ArkInventory.Const.Transmog.State.CanLearnMyself] = {
["style"] = ArkInventory.Const.Transmog.StyleDefault,
["colour"] = { r = 0.00, g = 1.00, b = 0.00, a = 1 }, -- green
},
[ArkInventory.Const.Transmog.State.CanLearnMyselfSecondary] = {
["style"] = ArkInventory.Const.Transmog.StyleDefault,
["colour"] = { r = 0.08, g = 0.76, b = 0.94, a = 1 },
},
[ArkInventory.Const.Transmog.State.CanLearnOther] = {
["style"] = ArkInventory.Const.Transmog.StyleDefault,
["colour"] = { r = 1.00, g = 1.00, b = 0.00, a = 1 },
},
[ArkInventory.Const.Transmog.State.CanLearnOtherSecondary] = {
["style"] = ArkInventory.Const.Transmog.StyleDefault,
["colour"] = { r = 1.00, g = 0.78, b = 1.00, a = 1 },
},
},
},
["conflict"] = {
["tsm"] = {
["mailbox"] = false,
["merchant"] = false,
},
},
["ui"] = {
["search"] = {
["scale"] = 1,
["background"] = {
["style"] = ArkInventory.Const.Texture.BackgroundDefault,
["colour"] = {
["r"] = 0,
["g"] = 0,
["b"] = 0,
["a"] = 0.75,
},
},
["border"] = {
["style"] = ArkInventory.Const.Texture.BorderDefault,
["size"] = nil,
["offset"] = nil,
["scale"] = 1,
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
},
["font"] = {
["height"] = ArkInventory.Const.Font.Height,
},
["strata"] = "MEDIUM"
},
["rules"] = {
["scale"] = 1,
["background"] = {
["style"] = ArkInventory.Const.Texture.BackgroundDefault,
["colour"] = {
["r"] = 0,
["g"] = 0,
["b"] = 0,
["a"] = 0.75,
},
},
["border"] = {
["style"] = ArkInventory.Const.Texture.BorderDefault,
["size"] = nil,
["offset"] = nil,
["scale"] = 1,
["colour"] = {
["r"] = 1,
["g"] = 1,
["b"] = 1,
},
},
["font"] = {
["height"] = ArkInventory.Const.Font.Height,
},
["strata"] = "MEDIUM"
},
},
["thread"] = {
["debug"] = false,
["timeout"] = {
["normal"] = 25,
["combat"] = 100, -- 200ms appears to be the actual limit
["tooltip"] = 50, -- tooltip generation queue
["junksell"] = 75, -- this is a minimum duration timer, not a timeout, must be above 50 (will occasionally fail when that low)
},
},
},
["player"] = {
["version"] = 0,
["data"] = {
["*"] = { -- player or guild name
["erasesilent"] = false,
["ldb"] = {
["bags"] = {
["colour"] = false,
["full"] = true,
["includetype"] = true,
},
["pets"] = {
["randomise"] = true,
["useall"] = true,
["selected"] = {
["*"] = nil,
},
},
["mounts"] = {
["randomise"] = true,
["type"] = {
["l"] = { -- land (ground)
["useflying"] = false,
["usesurface"] = false,
["useall"] = true,
["selected"] = {
["*"] = nil,
},
},
["a"] = { -- air (flying)
["dismount"] = false,
["useall"] = true,
["selected"] = {
["*"] = nil,
},
},
["u"] = { -- underwater
["useall"] = true,
["selected"] = {
["*"] = nil,
},
},
["s"] = { -- surface (water)
["useall"] = true,
["selected"] = {
["*"] = nil,
},
},
["x"] = { -- unknown
["useall"] = true,
["selected"] = {
["*"] = nil,
},
},
},
},
["tracking"] = {
["currency"] = {
["tracked"] = {
["*"] = false,
},
},
["item"] = {
["tracked"] = {
["*"] = false,
},
},
["reputation"] = {
["tracked"] = {
["*"] = false,
},
["watched"] = nil,
},
},
["travelform"] = false,
},
["option"] = { -- mostly moved to profile
["**"] = { -- loc_id
["bag"] = {
["*"] = { -- bag_id
["display"] = true,
["restack"] = {
["ignore"] = false,
},
},
},
},
},
["info"] = {
["*"] = nil,
["money"] = 0,
},
["location"] = {
["*"] = {
["slot_count"] = 0,
["bag"] = {
["*"] = {
["status"] = ArkInventory.Const.Bag.Status.Unknown,
-- ["texture"] = nil,
-- ["h"] = nil,
-- ["q"] = nil,
["type"] = ArkInventory.Const.Slot.Type.Unknown,
["count"] = 0,
["empty"] = 0,
["slot"] = {
-- stuff
},
},
},
},
},
["profile"] = 1000,
},
},
},
["cache"] = {
["version"] = 0,
["default"] = {
["*"] = nil, -- key generated via ObjectIDCategory( )
},
["rule"] = {
["*"] = nil, -- key generated via ObjectIDRule( )
},
},
}
ArkInventory.Const.DatabaseDefaults.profile = {
["option"] = {
["version"] = 0,
},
}
function ArkInventory.TOCVersionFail( quiet )
if true then return false end
--ArkInventory.Output( ArkInventory.Const.TOC, " / ", ArkInventory.Const.TOC_Min, " / ", ArkInventory.Const.TOC_Name )
if ArkInventory.Const.TOC < ArkInventory.Const.TOC_Min then
if not quiet then
ArkInventory.Output( ArkInventory.Global.Version, ArkInventory.Localise["DISABLED"] )
ArkInventory.OutputError( ArkInventory.Const.TOC_Name, " (Alpha/Beta) Server required. Do not run this version on the Live servers.")
ArkInventory:Disable( )
end
return true
end
end
function ArkInventory.OnLoad( )
-- called via hidden frame in xml
ArkInventory.Const.Program.Version = 0 + GetAddOnMetadata( ArkInventory.Const.Program.Name, "Version" )
ArkInventory.Global.Version = string.format( "v%s", string.gsub( ArkInventory.Const.Program.Version, "(%d-)(%d%d)(%d%d)$", "%1.%2.%3" ) )
local releasetype = GetAddOnMetadata( ArkInventory.Const.Program.Name, "X-ReleaseType" )
if releasetype ~= "" then
ArkInventory.Global.Version = string.format( "%s %s(%s)%s", ArkInventory.Global.Version, RED_FONT_COLOR_CODE, releasetype, FONT_COLOR_CODE_CLOSE )
end
local loc_id = 0
local bags
-- bags
loc_id = ArkInventory.Const.Location.Bag
bags = ArkInventory.Global.Location[loc_id].Bags
bags[#bags + 1] = BACKPACK_CONTAINER
for x = 1, NUM_BAG_SLOTS do
bags[#bags + 1] = x
end
ArkInventory.Global.Location[loc_id].bagCount = #bags
-- bank
loc_id = ArkInventory.Const.Location.Bank
bags = ArkInventory.Global.Location[loc_id].Bags
bags[#bags + 1] = BANK_CONTAINER
for x = NUM_BAG_SLOTS + 1, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS do
bags[#bags + 1] = x
end
bags[#bags + 1] = REAGENTBANK_CONTAINER
ArkInventory.Global.Location[loc_id].tabReagent = #bags
ArkInventory.Global.Location[loc_id].bagCount = #bags
-- vault
loc_id = ArkInventory.Const.Location.Vault
bags = ArkInventory.Global.Location[loc_id].Bags
for x = 1, MAX_GUILDBANK_TABS do
bags[#bags + 1] = ArkInventory.Const.Offset.Vault + x
end
ArkInventory.Global.Location[loc_id].bagCount = #bags
-- mail
loc_id = ArkInventory.Const.Location.Mail
bags = ArkInventory.Global.Location[loc_id].Bags
for x = 1, 2 do
bags[#bags + 1] = ArkInventory.Const.Offset.Mail + x
end
ArkInventory.Global.Location[loc_id].bagCount = #bags
-- wearing
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Wearing].Bags, ArkInventory.Const.Offset.Wearing + 1 )
-- pet
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Pet].Bags, ArkInventory.Const.Offset.Pet + 1 )
-- mount
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Mount].Bags, ArkInventory.Const.Offset.Mount + 1 )
-- toybox
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Toybox].Bags, ArkInventory.Const.Offset.Toybox + 1 )
-- heirloom
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Heirloom].Bags, ArkInventory.Const.Offset.Heirloom + 1 )
-- currency
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Token].Bags, ArkInventory.Const.Offset.Token + 1 )
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Token].Bags, -4 )
-- auctions
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Auction].Bags, ArkInventory.Const.Offset.Auction + 1 )
-- void storage
for x = 1, ArkInventory.Const.VOID_STORAGE_PAGES do
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Void].Bags, ArkInventory.Const.Offset.Void + x )
end
-- reputation
table.insert( ArkInventory.Global.Location[ArkInventory.Const.Location.Reputation].Bags, ArkInventory.Const.Offset.Reputation + 1 )
-- setup reverse lookup cache
for loc_id, loc_data in pairs( ArkInventory.Global.Location ) do
for bag_id, v in pairs( loc_data.Bags ) do
ArkInventory.Global.Cache.BlizzardBagIdToInternalId[v] = { loc_id=loc_id, bag_id=bag_id }
end
end
end
function ArkInventory.OnInitialize( )
-- pre acedb load, the database is just a table
ArkInventory.DatabaseUpgradePreLoad( )
-- load database, use default profile as we dont need them, metatables now active
ArkInventory.acedb = LibStub( "AceDB-3.0" ):New( "ARKINVDB", ArkInventory.Const.DatabaseDefaults, true )
ArkInventory.db = ArkInventory.acedb.global
ArkInventory.StartupChecks( )
-- config menu (internal)
ArkInventory.Lib.Config:RegisterOptionsTable( ArkInventory.Const.Frame.Config.Internal, ArkInventory.Config.Internal )
ArkInventory.Lib.Dialog:SetDefaultSize( ArkInventory.Const.Frame.Config.Internal, 1250, 650 )
-- config menu (blizzard)
ArkInventory.ConfigBlizzard( )
ArkInventory.Lib.Config:RegisterOptionsTable( ArkInventory.Const.Frame.Config.Blizzard, ArkInventory.Config.Blizzard, { "arkinventory", "arkinv", "ai" } )
ArkInventory.Lib.Dialog:AddToBlizOptions( ArkInventory.Const.Frame.Config.Blizzard, ArkInventory.Const.Program.Name )
-- tooltip
ArkInventory.Global.Tooltip.Scan = ArkInventory.TooltipScanInit( "ARKINV_ScanTooltip" )
ArkInventory.PlayerInfoSet( )
ArkInventory.MediaRegister( )
local me = ArkInventory.GetPlayerCodex( )
for loc_id, loc_data in pairs( ArkInventory.Global.Location ) do
if loc_data.canView then
if me.profile.location[loc_id].special then
local frame = ArkInventory.Frame_Main_Get( loc_id )
table.insert( UISpecialFrames, frame:GetName( ) )
end
end
end
if not ARKINV_MountToggle then
-- secure mount button to be able to cancel shapeshift forms
local btn = CreateFrame( "ItemButton", "ARKINV_MountToggle", UIParent, "SecureActionButtonTemplate" )
local macrotext = "/dismount [combat, mounted, noflying]\n" -- dismount if in combat and mounted and not flying
macrotext = macrotext .. "/stopmacro [combat]\n" -- abort if in combat
if ( me.player.data.info.class == "DRUID" ) or ( me.player.data.info.class == "WARLOCK" ) or ( me.player.data.info.class == "SHAMAN" ) then
macrotext = macrotext .. "/cancelform [noform:0]\n" -- cancel any form
end
-- class shapeshifts
if me.player.data.ldb.travelform then
if me.player.data.info.class == "DRUID" then
local cat_form = GetSpellInfo( 768 )
local travel_form = GetSpellInfo( 783 )
macrotext = macrotext .. "/cast [indoors] " .. cat_form .. "; " .. travel_form .. "\n"
end
-- shaman ghost wolf?
else
macrotext = macrotext .. "/run ArkInventory.LDB.Mounts:OnClick( )\n"
end
--ArkInventory.Output( macrotext )
btn:SetAttribute( "type", "macro" )
btn:SetAttribute( "macrotext", macrotext )
btn:SetPoint( "CENTER" )
btn:Hide( )
end
end
function ArkInventory.OnEnable( )
-- Called when the addon is enabled
--ArkInventory.Output( "OnEnable" )
if ArkInventory.TOCVersionFail( ) then return end
ArkInventory.PlayerInfoSet( )
ArkInventory.BlizzardAPIHook( )
ArkInventory.DatabaseUpgradePostLoad( )
ArkInventory.CategoryGenerate( )
-- tag all locations as changed
ArkInventory.LocationSetValue( nil, "changed", true )
-- tag all locations to be rebuilt from scratch
--ArkInventory.OutputWarning( "OnEnable - .restart window draw" )
ArkInventory.Frame_Main_DrawStatus( nil, ArkInventory.Const.Window.Draw.Restart )
-- init location player id
ArkInventory.LocationSetValue( nil, "player_id", ArkInventory.PlayerIDSelf( ) )
-- fix companion data
ArkInventory.CompanionDataUpdate( )
-- register events
--ArkInventory:RegisterMessage( "EVENT_ARKINV_STORAGE" )
ArkInventory:RegisterEvent( "PLAYER_ENTERING_WORLD", "EVENT_ARKINV_PLAYER_ENTER" ) -- not really needed but seems to fix a bug where ace doesnt seem to init again
ArkInventory:RegisterEvent( "PLAYER_LEAVING_WORLD", "EVENT_ARKINV_PLAYER_LEAVE" ) -- when the player logs out or the UI is reloaded.
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_PLAYER_MONEY_BUCKET", 1 )
ArkInventory:RegisterEvent( "PLAYER_MONEY", "EVENT_ARKINV_PLAYER_MONEY" )
ArkInventory:RegisterEvent( "SKILL_LINES_CHANGED", "EVENT_ARKINV_PLAYER_SKILLS" ) -- triggered when you gain or lose a skill, skillup, collapse/expand a skill header
ArkInventory:RegisterEvent( "PLAYER_REGEN_DISABLED", "EVENT_ARKINV_COMBAT_ENTER" ) -- player entered combat
ArkInventory:RegisterEvent( "PLAYER_REGEN_ENABLED", "EVENT_ARKINV_COMBAT_LEAVE" ) -- player left combat
local bucket1 = ArkInventory.db.option.bucket[ArkInventory.Const.Location.Bag] or 0.5
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_TOOLTIP_REBUILD_QUEUE_UPDATE_BUCKET", bucket1 )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_BAG_RESCAN_BUCKET", 5 )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_BAG_UPDATE_BUCKET", bucket1 )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_LOCATION_SCANNED_BUCKET", bucket1 * 2 )
ArkInventory:RegisterEvent( "BAG_UPDATE", "EVENT_ARKINV_BAG_UPDATE" )
ArkInventory:RegisterEvent( "ITEM_LOCK_CHANGED", "EVENT_ARKINV_BAG_LOCK" )
-- ArkInventory:RegisterEvent( "BAG_NEW_ITEMS_UPDATED", "EVENT_ARKINV_BAG_UPDATE" ) -- fix me : do something with it?
-- ArkInventory:RegisterEvent( "BAG_SLOT_FLAGS_UPDATED", "EVENT_ARKINV_BAG_UPDATE" ) -- fix me : do something with it?
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_BAG_UPDATE_COOLDOWN_BUCKET", bucket1 )
ArkInventory:RegisterEvent( "BAG_UPDATE_COOLDOWN", "EVENT_ARKINV_BAG_UPDATE_COOLDOWN" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_CHANGER_UPDATE_BUCKET", 1 )
ArkInventory:RegisterEvent( "ACTIVE_TALENT_GROUP_CHANGED", "EVENT_ARKINV_TALENT_CHANGED" )
ArkInventory:RegisterEvent( "BANKFRAME_OPENED", "EVENT_ARKINV_BANK_ENTER" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_BANK_LEAVE_BUCKET", 0.3 )
ArkInventory:RegisterEvent( "BANKFRAME_CLOSED", "EVENT_ARKINV_BANK_LEAVE" )
ArkInventory:RegisterEvent( "PLAYERBANKSLOTS_CHANGED", "EVENT_ARKINV_BANK_UPDATE" ) -- a bag_update event for the bank (-1)
ArkInventory:RegisterEvent( "PLAYERBANKBAGSLOTS_CHANGED", "EVENT_ARKINV_BANK_SLOT" ) -- triggered when you purchase a new bank bag slot
--ArkInventory:RegisterEvent( "BANK_BAG_SLOT_FLAGS_UPDATED", "EVENT_ARKINV_BANK_UPDATE" )
ArkInventory:RegisterEvent( "REAGENTBANK_PURCHASED", "EVENT_ARKINV_BANK_TAB" ) -- triggered when you purchase a bank tab (reagent bank)
ArkInventory:RegisterEvent( "PLAYERREAGENTBANKSLOTS_CHANGED", "EVENT_ARKINV_REAGENTBANK_UPDATE" ) -- a bag_update event for the reagent bank (-3)
ArkInventory:RegisterEvent( "REAGENTBANK_UPDATE", "EVENT_ARKINV_REAGENTBANK_UPDATE" )
ArkInventory:RegisterEvent( "GUILDBANKFRAME_OPENED", "EVENT_ARKINV_VAULT_ENTER" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_VAULT_LEAVE_BUCKET", 0.3 )
ArkInventory:RegisterEvent( "GUILDBANKFRAME_CLOSED", "EVENT_ARKINV_VAULT_LEAVE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_VAULT_UPDATE_BUCKET", ArkInventory.db.option.bucket[ArkInventory.Const.Location.Vault] or 1.5 )
ArkInventory:RegisterEvent( "GUILDBANKBAGSLOTS_CHANGED", "EVENT_ARKINV_VAULT_UPDATE" )
ArkInventory:RegisterEvent( "GUILDBANK_ITEM_LOCK_CHANGED", "EVENT_ARKINV_VAULT_LOCK" )
ArkInventory:RegisterEvent( "GUILDBANK_UPDATE_MONEY", "EVENT_ARKINV_VAULT_MONEY" )
ArkInventory:RegisterEvent( "GUILDBANK_UPDATE_TABS", "EVENT_ARKINV_VAULT_TABS" )
ArkInventory:RegisterEvent( "GUILDBANKLOG_UPDATE", "EVENT_ARKINV_VAULT_LOG" )
ArkInventory:RegisterEvent( "GUILDBANK_UPDATE_TEXT", "EVENT_ARKINV_VAULT_INFO" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_VOID_UPDATE_BUCKET", 0.5 )
ArkInventory:RegisterEvent( "VOID_STORAGE_UPDATE", "EVENT_ARKINV_VOID_UPDATE" )
--ArkInventory:RegisterEvent( "VOID_TRANSFER_DONE", "EVENT_ARKINV_VOID_UPDATE" )
--ArkInventory:RegisterEvent( "VOID_STORAGE_DEPOSIT_UPDATE", "EVENT_ARKINV_VOID_UPDATE" )
ArkInventory:RegisterEvent( "VOID_STORAGE_CONTENTS_UPDATE", "EVENT_ARKINV_VOID_UPDATE" )
--ArkInventory:RegisterEvent( "VOID_DEPOSIT_WARNING", "EVENT_ARKINV_VOID_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_INVENTORY_CHANGE_BUCKET", bucket1 )
ArkInventory:RegisterEvent( "UNIT_INVENTORY_CHANGED", "EVENT_ARKINV_INVENTORY_CHANGE" )
ArkInventory:RegisterEvent( "MAIL_SHOW", "EVENT_ARKINV_MAIL_ENTER" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_MAIL_LEAVE_BUCKET", 0.3 )
ArkInventory:RegisterEvent( "MAIL_CLOSED", "EVENT_ARKINV_MAIL_LEAVE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_MAIL_UPDATE_BUCKET", ArkInventory.db.option.bucket[ArkInventory.Const.Location.Mail] or 2 )
ArkInventory:RegisterEvent( "MAIL_INBOX_UPDATE", "EVENT_ARKINV_MAIL_UPDATE" )
ArkInventory:RegisterEvent( "MAIL_SEND_SUCCESS", "EVENT_ARKINV_MAIL_SEND_SUCCESS" )
ArkInventory:RegisterEvent( "TRADE_SHOW", "EVENT_ARKINV_TRADE_ENTER" )
ArkInventory:RegisterEvent( "TRADE_CLOSED", "EVENT_ARKINV_TRADE_LEAVE" )
ArkInventory:RegisterEvent( "AUCTION_HOUSE_SHOW", "EVENT_ARKINV_AUCTION_ENTER" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_AUCTION_LEAVE_BUCKET", 0.3 )
ArkInventory:RegisterEvent( "AUCTION_HOUSE_CLOSED", "EVENT_ARKINV_AUCTION_LEAVE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_AUCTION_UPDATE_MASSIVE_BUCKET", 60 )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_AUCTION_UPDATE_BUCKET", 2 )
ArkInventory:RegisterEvent( "AUCTION_OWNED_LIST_UPDATE", "EVENT_ARKINV_AUCTION_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_MERCHANT_LEAVE_BUCKET", 0.3 )
ArkInventory:RegisterEvent( "MERCHANT_SHOW", "EVENT_ARKINV_MERCHANT_ENTER" )
ArkInventory:RegisterEvent( "MERCHANT_CLOSED", "EVENT_ARKINV_MERCHANT_LEAVE" )
ArkInventory:RegisterEvent( "TRANSMOGRIFY_OPEN", "EVENT_ARKINV_TRANSMOG_ENTER" )
ArkInventory:RegisterEvent( "TRANSMOGRIFY_CLOSE", "EVENT_ARKINV_MERCHANT_LEAVE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_COLLECTION_MOUNT_UPDATE_BUCKET", 1 )
-- ArkInventory:RegisterEvent( "COMPANION_UPDATE", "EVENT_ARKINV_COLLECTION_COMPANION_UPDATE" ) -- do i really need this? it triggers when other people mount/dismount as well
ArkInventory:RegisterEvent( "COMPANION_LEARNED", "EVENT_ARKINV_COLLECTION_COMPANION_UPDATE" )
ArkInventory:RegisterEvent( "COMPANION_UNLEARNED", "EVENT_ARKINV_COLLECTION_COMPANION_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_COLLECTION_PET_UPDATE_BUCKET", 1 )
ArkInventory:RegisterEvent( "NEW_PET_ADDED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_JOURNAL_LIST_UPDATE", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_JOURNAL_PET_DELETED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_JOURNAL_PET_RESTORED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_JOURNAL_PET_REVOKED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_JOURNAL_PETS_HEALED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "BATTLE_PET_CURSOR_CLEAR", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_BATTLE_LEVEL_CHANGED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_BATTLE_QUEUE_STATUS", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_BATTLE_CLOSE", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterEvent( "PET_BATTLE_OPENING_DONE", "EVENT_ARKINV_BATTLEPET_OPENING_DONE" )
--ArkInventory:RegisterEvent( "CHAT_MSG_PET_BATTLE_COMBAT_LOG", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
--ArkInventory:RegisterEvent( "CHAT_MSG_PET_INFO", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
--ArkInventory:RegisterEvent( "CHAT_MSG_PET_BATTLE_INFO", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
--ArkInventory:RegisterEvent( "PET_BATTLE_PET_CHANGED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
--ArkInventory:RegisterEvent( "PET_BATTLE_PET_ROUND_RESULTS", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
--ArkInventory:RegisterEvent( "PET_BATTLE_XP_CHANGED", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
--ArkInventory:RegisterEvent( "PET_BATTLE_OVER", "EVENT_ARKINV_COLLECTION_PET_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_COLLECTION_TOYBOX_UPDATE_BUCKET", 1 )
ArkInventory:RegisterEvent( "TOYS_UPDATED", "EVENT_ARKINV_COLLECTION_TOYBOX_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_COLLECTION_HEIRLOOM_UPDATE_BUCKET", 1 )
ArkInventory:RegisterEvent( "HEIRLOOMS_UPDATED", "EVENT_ARKINV_COLLECTION_HEIRLOOM_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_COLLECTION_REPUTATION_UPDATE_BUCKET", 1 )
ArkInventory:RegisterEvent( "UPDATE_FACTION", "EVENT_ARKINV_COLLECTION_REPUTATION_UPDATE" )
ArkInventory:RegisterEvent( "LFG_BONUS_FACTION_ID_UPDATED", "EVENT_ARKINV_COLLECTION_REPUTATION_UPDATE" )
--ArkInventory:RegisterEvent( "QUEST_LOG_UPDATE", "" ) -- triggers too often to be usable
ArkInventory:RegisterEvent( "EQUIPMENT_SETS_CHANGED", "EVENT_ARKINV_EQUIPMENT_SETS_CHANGED" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_COLLECTION_CURRENCY_UPDATE_BUCKET", 1 )
ArkInventory:RegisterEvent( "CURRENCY_DISPLAY_UPDATE", "EVENT_ARKINV_COLLECTION_CURRENCY_UPDATE" )
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_QUEST_UPDATE_BUCKET", 3 ) -- update quest item glows. not super urgent just get them there eventually
ArkInventory:RegisterEvent( "QUEST_ACCEPTED", "EVENT_ARKINV_QUEST_UPDATE" )
-- ArkInventory:RegisterEvent( "QUEST_ITEM_UPDATED", "EVENT_ARKINV_QUEST_UPDATE" ) -- no longer valid in BFA
ArkInventory:RegisterEvent( "QUEST_FINISHED", "EVENT_ARKINV_QUEST_UPDATE" )
ArkInventory:RegisterEvent( "UNIT_QUEST_LOG_CHANGED", "EVENT_ARKINV_QUEST_UPDATE" )
ArkInventory:RegisterEvent( "CVAR_UPDATE", "EVENT_ARKINV_CVAR_UPDATE" )
-- ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_ZONE_CHANGED_BUCKET", 5 )
-- ArkInventory:RegisterEvent( "ZONE_CHANGED", "EVENT_ARKINV_ZONE_CHANGED" )
-- ArkInventory:RegisterEvent( "ZONE_CHANGED_INDOORS", "EVENT_ARKINV_ZONE_CHANGED" )
-- ArkInventory:RegisterEvent( "ZONE_CHANGED_NEW_AREA", "EVENT_ARKINV_ZONE_CHANGED" )
-- ldb mount/pet updates
ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_ACTIONBAR_UPDATE_USABLE_BUCKET", 1 )
ArkInventory:RegisterEvent( "ACTIONBAR_UPDATE_USABLE", "EVENT_ARKINV_ACTIONBAR_UPDATE_USABLE" )
--soul shards
--ArkInventory:RegisterBucketMessage( "EVENT_ARKINV_UNIT_POWER_BUCKET", 1 )
--ArkInventory:RegisterEvent( "UNIT_POWER", "EVENT_ARKINV_UNIT_POWER" )
-- scrapping
ArkInventory:RegisterEvent( "SCRAPPING_MACHINE_SHOW", "EVENT_ARKINV_SCRAP_ENTER" )
ArkInventory:RegisterEvent( "SCRAPPING_MACHINE_CLOSE", "EVENT_ARKINV_SCRAP_LEAVE" )
for loc_id, loc_data in pairs( ArkInventory.Global.Location ) do
-- initialise codex for each location
ArkInventory.GetLocationCodex( loc_id )
end
ArkInventory.ScanProfessions( )
ArkInventory.ScanLocation( )
ArkInventory.LDB.Money:Update( )
ArkInventory.LDB.Bags:Update( )
ArkInventory.LDB.Tracking_Currency:Update( )
ArkInventory.LDB.Tracking_Item:Update( )
ArkInventory.LDB.Tracking_Reputation:Update( )
ArkInventory.ScanAuctionExpire( )
ArkInventory.Output( ArkInventory.Global.Version, " ", ArkInventory.Localise["ENABLED"] )
ArkInventory.MediaMenuFontSet( ArkInventory.db.option.font.face, ArkInventory.db.option.menu.font.height )
if not ArkInventory.Global.Thread.Use then
-- should be set to true by default so if its not then i forgot to put it back
ArkInventory.OutputWarning( "Thread.Use is disabled (this may be deliberate if this is an Alpha/Beta version)" )
end
SetSortBagsRightToLeft( ArkInventory.db.option.restack.reverse )
end
function ArkInventory.OnDisable( )
--ArkInventory.Frame_Main_Hide( )
if ArkInventory.TOCVersionFail( true ) then return end
ArkInventory.BlizzardAPIHook( true )
ArkInventory.Output( ArkInventory.Global.Version, " ", ArkInventory.Localise["DISABLED"] )
end
function ArkInventory.ItemSortKeyClear( loc_id )
-- clear sort keys
local codex = ArkInventory.GetLocationCodex( loc_id )
if not codex.workpad.bar then return end
for _, bar in pairs( codex.workpad.bar ) do
for _, item in pairs( bar.item ) do
item.sortkey = nil
end
end
end
function ArkInventory.ItemSortKeyGenerate( i, bar_id, codex )
if not i then return nil end
local codex = codex or ArkInventory.GetLocationCodex( i.loc_id )
local sid = codex.style.sort.method
if bar_id then
sid = codex.layout.bar.data[bar_id].sort.method or sid
end
local sorting = ArkInventory.ConfigInternalSortMethodGet( sid )
local s = { }
local sx = ""
if sid == 9995 then
-- vault layout / void storage layout
s["!bagslot"] = string.format( "%04i %04i", i.bag_id or 0, i.did or i.slot_id or 0 )
else
-- all other bag/slot
s["!bagslot"] = string.format( "%04i %04i", i.bag_id or 0, i.slot_id or 0 )
end
if sorting.used and not sorting.bagslot then
local t
local info = ArkInventory.ObjectInfoArray( i.h, i )
-- slot type
t = 0
if sorting.active.slottype then
t = info.osd.slottype
end
s["!slottype"] = string.format( "%04i", t or 0 )
-- item count (system)
t = i.count
s["!count"] = string.format( "%010i", t or 1 )
-- item name
t = "!"
if sorting.active.name then
if i.h then
t = info.name
if t and type( i.cn ) == "string" and i.cn ~= "" then
t = string.format( "%s %s", t, i.cn )
end
t = t or "!"
if sorting.reversed then
t = ArkInventory.ReverseName( t )
end
else
if codex.style.slot.empty.position then
-- first alphabetically (default)
t = "!"
else
-- last alphabetically
t = "_"
end
end
end
s["name"] = t or "!"
-- item quality
t = 0
if i.q and sorting.active.quality then
t = i.q
end
s["quality"] = string.format( "%02i", t or 0 )
-- equip location
t = "!"
if i.h and info.class == "item" and sorting.active.location then
if type( info.equiploc ) == "string" and info.equiploc ~= "" and _G[info.equiploc] then
t = _G[info.equiploc]
end
end
s["location"] = string.format( "%s", t or "!" )
-- item type / subtype
local item_type = 0
local item_subtype = 0
if sorting.active.itemtype then
item_type = info.itemtypeid
item_subtype = info.itemsubtypeid
end
s["itemtype"] = string.format( "%04i %04i", item_type or 0, item_subtype or 0 )
-- item (use) level
t = 0
if i.h and sorting.active.itemuselevel then
t = info.uselevel
end
s["itemuselevel"] = string.format( "%04i", t or 0 )
-- item (stat) level
t = 0
if i.h and sorting.active.itemstatlevel then
t = info.ilvl
end
s["itemstatlevel"] = string.format( "%04i", t or 0 )
-- item age
t