addon/CzechQuests.lua

66 lines
3.4 KiB
Lua
Raw Normal View History

local _, addon = ...
-- Prepare API object
addon.API = {}
2025-03-29 07:44:17 +01:00
-- Prepare Data objects
addon.data = {};
addon.data.quest = {};
addon.data.item = {};
addon.data.speech = {}
2025-03-29 07:44:17 +01:00
addon.data.tactic = {}
-- Expose object as global for other addon integration
CzechQuestsAddon = {}
CzechQuestsAddon.data = addon.data
local function InitStore()
-- Init Store
CzechQuestsAddon_Store = CzechQuestsAddon_Store or {}
CzechQuestsAddon_Store.config = CzechQuestsAddon_Store.config or {}
-- General Settings
CzechQuestsAddon_Store.config.DEBUG_MODE = CzechQuestsAddon_Store.config.DEBUG_MODE or false
-- Quest Settings
CzechQuestsAddon_Store.config.QUEST_ENABLED = CzechQuestsAddon_Store.config.QUEST_ENABLED or true
CzechQuestsAddon_Store.config.QUEST_DARK_MODE = CzechQuestsAddon_Store.config.QUEST_DARK_MODE or false
CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_SIZE = CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_SIZE or 18
CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_SIZE = CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_SIZE or 14
CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_NAME = CzechQuestsAddon_Store.config.QUEST_HEADER_FONT_NAME or 'morpheus_cz.ttf'
CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_NAME = CzechQuestsAddon_Store.config.QUEST_TEXT_FONT_NAME or 'frizquadratatt_cz.ttf'
CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA = CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA or 80
CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA_ONLY_MOVING = CzechQuestsAddon_Store.config.QUEST_TEXTURE_ALPHA_ONLY_MOVING or true
-- Speech Settings
CzechQuestsAddon_Store.config.SPEECH_ENABLED = CzechQuestsAddon_Store.config.SPEECH_ENABLED or true
CzechQuestsAddon_Store.config.SPEECH_TEXT_FONT_SIZE = CzechQuestsAddon_Store.config.SPEECH_TEXT_FONT_SIZE or 13
CzechQuestsAddon_Store.config.SPEECH_TEXT_FONT_NAME = CzechQuestsAddon_Store.config.SPEECH_TEXT_FONT_NAME or 'frizquadratatt_cz.ttf'
CzechQuestsAddon_Store.config.SPEECH_FRAME_WIDTH = CzechQuestsAddon_Store.config.SPEECH_FRAME_WIDTH or 320
CzechQuestsAddon_Store.config.SPEECH_ORIGINAL_WHEN_MISSING = CzechQuestsAddon_Store.config.SPEECH_ORIGINAL_WHEN_MISSING or false
CzechQuestsAddon_Store.config.SPEECH_MESSAGE_TEXTURE_ALPHA = CzechQuestsAddon_Store.config.SPEECH_MESSAGE_TEXTURE_ALPHA or 40
CzechQuestsAddon_Store.config.SPEECH_FRAME_POSITION_X = CzechQuestsAddon_Store.config.SPEECH_FRAME_POSITION_X or 0
CzechQuestsAddon_Store.config.SPEECH_FRAME_POSITION_Y = CzechQuestsAddon_Store.config.SPEECH_FRAME_POSITION_Y or 0
2025-03-28 10:45:45 +01:00
2025-03-29 07:44:17 +01:00
-- Tactic Settings
CzechQuestsAddon_Store.config.TACTIC_ENABLED = CzechQuestsAddon_Store.config.TACTIC_ENABLED or true
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_SIZE = CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_SIZE or 12
CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_NAME = CzechQuestsAddon_Store.config.TACTIC_TEXT_FONT_NAME or 'frizquadratatt_cz.ttf'
end
2025-03-28 10:45:45 +01:00
2025-03-29 07:44:17 +01:00
-- Event handler frame
local frame = CreateFrame("Frame")
local function OnEvent(self, event, addonName, ...)
if event == "ADDON_LOADED" and addonName == 'CzechQuests' then
InitStore()
addon.API.InitOptions()
addon.API.InitQuests()
addon.API.InitSpeeches()
addon.API.InitTactics()
self:UnregisterEvent("ADDON_LOADED")
2025-03-28 10:45:45 +01:00
end
2024-08-25 11:50:46 +02:00
end
2025-03-29 07:44:17 +01:00
-- Register the event
2024-08-25 11:50:46 +02:00
frame:RegisterEvent("ADDON_LOADED")
2025-03-29 07:44:17 +01:00
frame:SetScript("OnEvent", OnEvent)