90 lines
No EOL
4.1 KiB
Lua
90 lines
No EOL
4.1 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 CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_ENABLED == nil then
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_ENABLED = true;
|
|
end
|
|
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
|
|
if CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING == nil then
|
|
CzechQuestsAddon_Store.config.TRANSLATION_QUEST_FRAME_TEXTURE_ALPHA_ONLY_MOVING = true;
|
|
end
|
|
|
|
-- Speech
|
|
if CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ENABLED == nil then
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ENABLED = true;
|
|
end
|
|
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE then
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_TEXT_FONT_SIZE = 15;
|
|
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_ORIGINAL_WHEN_MISSING then
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_ORIGINAL_WHEN_MISSING = false;
|
|
end
|
|
if not CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION then
|
|
CzechQuestsAddon_Store.config.TRANSLATION_SPEECH_FRAME_POSITION = { x = 0, y = 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) |