Skip to content

Instantly share code, notes, and snippets.

-- debug utils
local df = df or function(...) print(string.format(...)) end
local function dstring(arg)
if type(arg) == "string" then
return string.format("%q", arg)
else
return tostring(arg)
@merlight
merlight / MultiCraft.lua
Last active November 26, 2015 13:52
MultiCraft modified using ZO_Spinner
--[[
File : MultiCraft.lua
Author: Ayantir
Version : 3
]]--
-- MultiCraft totally rewrited by Ayantir
local ADDON_NAME = "MultiCraft"
@merlight
merlight / LAM_CreateOptionsControlsRecursively.lua
Created March 8, 2015 14:53
LAM CreateOptionsControlsRecursively
--INTERNAL FUNCTION
--creates controls when options panel is first shown
--controls anchoring of these controls in the panel
local function CreateOptionsControlsRecursively(parent, optionsTable, maxDepth)
if not optionsTable or maxDepth < 0 then
return
end
local lastAddedControl, lacAtHalfRow
local anchorOffset = 0
local wm = WINDOW_MANAGER
local PRIVATE = {}
local function df(...)
d(string.format(...))
end
function PRIVATE.init()
local MAJOR, MINOR = "libFilters", 11.2
local libFilters, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
if not libFilters then return end --the same or newer version of this lib is already loaded into memory
--thanks to Seerah for the previous lines and library
--some constants for your filters
LAF_BAGS = 1
LAF_BANK = 2
LAF_GUILDBANK = 3
LAF_STORE = 4
@merlight
merlight / ChangeFilter.lua
Created August 14, 2014 14:19
AdvancedFilters layout update
local newFilter = self:GetTabFilterInfo(inventoryType, filterTab)
if subfilterRows[newFilter] then
UpdateInventoryAnchors(self, inventoryType, ADV_FILTER_HEIGHT)
else
UpdateInventoryAnchors(self, inventoryType, 0)
end
local HarvensTraitAndStyle = {}
local g_savedVars = {}
local UnknowableTraitTypes = {
[ITEM_TRAIT_TYPE_NONE] = "none",
[ITEM_TRAIT_TYPE_WEAPON_INTRICATE] = "weapon",
[ITEM_TRAIT_TYPE_WEAPON_ORNATE] = "weapon",
[ITEM_TRAIT_TYPE_ARMOR_INTRICATE] = "armor",
[ITEM_TRAIT_TYPE_ARMOR_ORNATE] = "armor",
[ITEM_TRAIT_TYPE_JEWELRY_HEALTHY] = "jewelry",