addon/Addon/Code/DataApi.lua

25 lines
639 B
Lua
Raw Normal View History

local _, addon = ...
local function ResolveGender(maleVersion, femaleVersion)
local gender = UnitSex("player")
if gender == 2 then
return maleVersion
else
return femaleVersion == nil and maleVersion or femaleVersion
end
end
addon.API.ResolveGender = ResolveGender
function CzechQuestsAddon:GetData(key, id)
if addon.data[key] then
if key == "quest" then
return addon.API.GetQuest(id)
elseif key == "speech" then
return addon.API.GetSpeech(id)
elseif addon.data[key][id] then
return addon.data[key][id]
end
end
return nil
end