Files
coa-clique/Clique/ImportExport.lua
Anthony Narkevicius 9c36ee6e47 Update to 1.6 version (#6)
* Merge from origin https://gitlab.com/Tsoukie/clique-3.3.5

* Linting

* Ascension Modifications
Fixes Spec swap and adds the 12 slots
Fixes ascension compact raid frame support
Fixes ascension spell panel integration

* Add profile dropdown to binding window

* Fix menu buttons showing as invisible

* cleanup xml button definitions

* enable or disable Bind Spell button when spellbook is visible

* give the labels a bit more spacing for default UI
2025-11-09 10:40:17 -07:00

35 lines
1.1 KiB
Lua

local addonName, addon = ...
local LibSerialize = LibStub("LibSerialize")
local LibDeflate = LibStub("LibDeflate")
function addon:GetExportString()
local data = addon.db.profile.bindings
local serialized = LibSerialize:Serialize(data)
local compressed = LibDeflate:CompressDeflate(serialized)
local encoded = LibDeflate:EncodeForPrint(compressed)
return string.format("CL01:%s", encoded)
end
function addon:DecodeExportString(text)
local header = string.sub(text, 1, 5)
if header ~= "CL01:" then return end
local payload = string.sub(text, 6, string.len(text))
local decoded = LibDeflate:DecodeForPrint(payload)
if not decoded then return end
local decompressed = LibDeflate:DecompressDeflate(decoded)
if not decompressed then return end
local success, data = LibSerialize:Deserialize(decompressed)
if not success then return end
return data
end
function addon:ImportBindings(importBindings)
self.db.profile.bindings = importBindings
self.bindings = self.db.profile.bindings
addon:Printf("Importing new bindings into current profile")
self:FireMessage("BINDINGS_CHANGED")
end