addon/CzechQuests.lua

84 lines
No EOL
3.8 KiB
Lua

-- Namespace
CzechQuestsAddon = {};
CzechQuestsAddon.fontPath = "Interface\\AddOns\\CzechQuests\\Assets\\Fonts\\"
-- Define data
CzechQuestsAddon.data = {};
CzechQuestsAddon.data.quest = {};
CzechQuestsAddon.data.item = {};
CzechQuestsAddon.data.speech = {}
-- Event handler frame
local frame = CreateFrame("Frame")
-- OnEvent function for event processing
local function OnEvent(self, event, addonName, ...)
if event == "ADDON_LOADED" and addonName == 'CzechQuests' then
-- Initialize the SavedVariables if it doesn't exist
if not CzechQuestsAddon_Store then
CzechQuestsAddon_Store = {}
end
if not CzechQuestsAddon_Store.config then
CzechQuestsAddon_Store.config = {}
end
if not CzechQuestsAddon_Store.config.DEBUG_MODE then
CzechQuestsAddon_Store.config.DEBUG_MODE = false;
end
-- Quests
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_DARK_MODE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_DARK_MODE = false;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_PRIMARY_HEADER_FONT_SIZE = 18;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_SECONDARY_HEADER_FONT_SIZE = 16;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_SIZE = 14;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_HEADER_FONT_FAMILY = 'morpheus_cz.ttf';
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXT_FONT_FAMILY = 'frizquadratatt_cz.ttf';
end
if not CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA then
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA = 80;
end
-- Speech
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_SIZE = 14;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE = 12;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_NPC_FONT_FAMILY = 'frizquadratatt_cz.ttf';
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_FAMILY = 'frizquadratatt_cz.ttf';
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_WIDTH = 320;
end
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION then
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION = "0,0";
end
-- Initialize settings
CzechQuestsAddon:InitializeSettings()
-- Initialize Quests
CzechQuestsAddon:InitializeTranslations()
-- Unregister the ADDON_LOADED event after handling it
self:UnregisterEvent("ADDON_LOADED")
end
end
-- Register the event
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent", OnEvent)