Add more config options
This commit is contained in:
28
Heimdall.lua
28
Heimdall.lua
@@ -173,9 +173,19 @@ local function init()
|
|||||||
---@field tagTTL number
|
---@field tagTTL number
|
||||||
---@field alertTTL number
|
---@field alertTTL number
|
||||||
---@field combatTTL number
|
---@field combatTTL number
|
||||||
|
---@field helpTTL number
|
||||||
---@field tagSound boolean
|
---@field tagSound boolean
|
||||||
---@field alertSound boolean
|
---@field alertSound boolean
|
||||||
---@field combatSound boolean
|
---@field combatSound boolean
|
||||||
|
---@field helpSound boolean
|
||||||
|
---@field tagSoundFile string
|
||||||
|
---@field alertSoundFile string
|
||||||
|
---@field combatSoundFile string
|
||||||
|
---@field helpSoundFile string
|
||||||
|
---@field tagSoundThrottle number
|
||||||
|
---@field alertSoundThrottle number
|
||||||
|
---@field combatSoundThrottle number
|
||||||
|
---@field helpSoundThrottle number
|
||||||
|
|
||||||
--- Data ---
|
--- Data ---
|
||||||
---@class HeimdallMessengerData
|
---@class HeimdallMessengerData
|
||||||
@@ -281,7 +291,7 @@ local function init()
|
|||||||
},
|
},
|
||||||
bully = {
|
bully = {
|
||||||
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "bully", "enabled" }, false),
|
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "bully", "enabled" }, false),
|
||||||
debug = shared.GetOrDefault(Heimdall_Data, { "config", "bully", "debug" }, false) ,
|
debug = shared.GetOrDefault(Heimdall_Data, { "config", "bully", "debug" }, false),
|
||||||
},
|
},
|
||||||
agentTracker = {
|
agentTracker = {
|
||||||
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "agentTracker", "enabled" }, false),
|
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "agentTracker", "enabled" }, false),
|
||||||
@@ -346,9 +356,25 @@ local function init()
|
|||||||
tagTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagTTL" }, 1),
|
tagTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagTTL" }, 1),
|
||||||
alertTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertTTL" }, 1),
|
alertTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertTTL" }, 1),
|
||||||
combatTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatTTL" }, 1),
|
combatTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatTTL" }, 1),
|
||||||
|
helpTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpTTL" }, 1),
|
||||||
tagSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSound" }, false),
|
tagSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSound" }, false),
|
||||||
alertSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSound" }, false),
|
alertSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSound" }, false),
|
||||||
combatSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSound" }, false),
|
combatSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSound" }, false),
|
||||||
|
helpSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSound" }, false),
|
||||||
|
tagSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSoundFile" },
|
||||||
|
"MGSSpot.ogg"),
|
||||||
|
alertSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSoundFile" },
|
||||||
|
"OOF.ogg"),
|
||||||
|
combatSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSoundFile" },
|
||||||
|
"StarScream.mp3"),
|
||||||
|
helpSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSoundFile" },
|
||||||
|
"MedicGangsterParadise.ogg"),
|
||||||
|
tagSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSoundThrottle" }, 0),
|
||||||
|
alertSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSoundThrottle" },
|
||||||
|
0),
|
||||||
|
combatSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSoundThrottle" },
|
||||||
|
2),
|
||||||
|
helpSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSoundThrottle" }, 2),
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1354,7 +1354,7 @@ function shared.Config.Init()
|
|||||||
local minimapTaggerConfigFrame = GridFrame.new("HeimdallMinimapTaggerConfig",
|
local minimapTaggerConfigFrame = GridFrame.new("HeimdallMinimapTaggerConfig",
|
||||||
UIParent, 12, 20)
|
UIParent, 12, 20)
|
||||||
minimapTaggerConfigFrame.frame:SetBackdropColor(r, g, b, 0.3)
|
minimapTaggerConfigFrame.frame:SetBackdropColor(r, g, b, 0.3)
|
||||||
configFrame:Add(minimapTaggerConfigFrame, 3, 3)
|
configFrame:Add(minimapTaggerConfigFrame, 9, 5)
|
||||||
|
|
||||||
local title = CreateFancyText("HeimdallMinimapTaggerConfigTitle", minimapTaggerConfigFrame.frame,
|
local title = CreateFancyText("HeimdallMinimapTaggerConfigTitle", minimapTaggerConfigFrame.frame,
|
||||||
"Minimap Tagger",
|
"Minimap Tagger",
|
||||||
@@ -1391,20 +1391,190 @@ function shared.Config.Init()
|
|||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(masterChannel, 2, 6)
|
minimapTaggerConfigFrame:Add(masterChannel, 2, 6)
|
||||||
|
|
||||||
local ttl = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTTL",
|
local tagSound = CreateBasicButton("HeimdallMinimapTaggerConfigTagSound",
|
||||||
minimapTaggerConfigFrame.frame, "TTL",
|
minimapTaggerConfigFrame.frame, "Tag Sound", function()
|
||||||
Heimdall_Data.config.minimapTagger.ttl,
|
Heimdall_Data.config.minimapTagger.tagSound = not Heimdall_Data.config.minimapTagger.tagSound
|
||||||
|
return Heimdall_Data.config.minimapTagger.tagSound
|
||||||
|
end)
|
||||||
|
tagSound:UpdateColor(Heimdall_Data.config.minimapTagger.tagSound)
|
||||||
|
minimapTaggerConfigFrame:Add(tagSound, 2, 3)
|
||||||
|
|
||||||
|
local tagTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagTTL",
|
||||||
|
minimapTaggerConfigFrame.frame, "Tag TTL",
|
||||||
|
Heimdall_Data.config.minimapTagger.tagTTL,
|
||||||
function(self)
|
function(self)
|
||||||
local text = self:GetText()
|
local text = self:GetText()
|
||||||
if string.match(text, "%d+") then
|
if string.match(text, "%d+") then
|
||||||
Heimdall_Data.config.minimapTagger.ttl = tonumber(text)
|
Heimdall_Data.config.minimapTagger.tagTTL = tonumber(text)
|
||||||
print("TTL set to", tostring(text))
|
print("Tag TTL set to", tostring(text))
|
||||||
else
|
else
|
||||||
print("Invalid ttl", tostring(text))
|
print("Invalid tag TTL", tostring(text))
|
||||||
self:SetText(Heimdall_Data.config.minimapTagger.ttl)
|
self:SetText(Heimdall_Data.config.minimapTagger.tagTTL)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(ttl, 2, 6)
|
minimapTaggerConfigFrame:Add(tagTTL, 2, 3)
|
||||||
|
|
||||||
|
local tagSoundFile = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagSoundFile",
|
||||||
|
minimapTaggerConfigFrame.frame, "Tag Sound File",
|
||||||
|
Heimdall_Data.config.minimapTagger.tagSoundFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.tagSoundFile = text
|
||||||
|
print("Tag sound file set to", tostring(text))
|
||||||
|
else
|
||||||
|
print("Invalid tag sound file", tostring(text))
|
||||||
|
self:SetText(Heimdall_Data.config.minimapTagger.tagSoundFile)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(tagSoundFile, 2, 3)
|
||||||
|
|
||||||
|
local tagSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagSoundThrottle",
|
||||||
|
minimapTaggerConfigFrame.frame, "Tag Sound Throttle",
|
||||||
|
Heimdall_Data.config.minimapTagger.tagSoundThrottle,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.tagSoundThrottle = tonumber(text)
|
||||||
|
print("Tag sound throttle set to", tostring(text))
|
||||||
|
else
|
||||||
|
print("Invalid tag sound throttle", tostring(text))
|
||||||
|
self:SetText(Heimdall_Data.config.minimapTagger.tagSoundThrottle)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(tagSoundThrottle, 2, 3)
|
||||||
|
|
||||||
|
local alertSound = CreateBasicButton("HeimdallMinimapTaggerConfigAlertSound",
|
||||||
|
minimapTaggerConfigFrame.frame, "Alert Sound", function()
|
||||||
|
Heimdall_Data.config.minimapTagger.alertSound = not Heimdall_Data.config.minimapTagger.alertSound
|
||||||
|
return Heimdall_Data.config.minimapTagger.alertSound
|
||||||
|
end)
|
||||||
|
alertSound:UpdateColor(Heimdall_Data.config.minimapTagger.alertSound)
|
||||||
|
minimapTaggerConfigFrame:Add(alertSound, 2, 3)
|
||||||
|
|
||||||
|
local alertTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertTTL",
|
||||||
|
minimapTaggerConfigFrame.frame, "Alert TTL",
|
||||||
|
Heimdall_Data.config.minimapTagger.alertTTL,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.alertTTL = tonumber(text)
|
||||||
|
print("Alert TTL set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(alertTTL, 2, 3)
|
||||||
|
|
||||||
|
local alertSoundFile = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertSoundFile",
|
||||||
|
minimapTaggerConfigFrame.frame, "Alert Sound File",
|
||||||
|
Heimdall_Data.config.minimapTagger.alertSoundFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.alertSoundFile = text
|
||||||
|
print("Alert sound file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(alertSoundFile, 2, 3)
|
||||||
|
|
||||||
|
local alertSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertSoundThrottle",
|
||||||
|
minimapTaggerConfigFrame.frame, "Alert Sound Throttle",
|
||||||
|
Heimdall_Data.config.minimapTagger.alertSoundThrottle,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.alertSoundThrottle = tonumber(text)
|
||||||
|
print("Alert sound throttle set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(alertSoundThrottle, 2, 3)
|
||||||
|
|
||||||
|
local combatSound = CreateBasicButton("HeimdallMinimapTaggerConfigCombatSound",
|
||||||
|
minimapTaggerConfigFrame.frame, "Combat Sound", function()
|
||||||
|
Heimdall_Data.config.minimapTagger.combatSound = not Heimdall_Data.config.minimapTagger.combatSound
|
||||||
|
return Heimdall_Data.config.minimapTagger.combatSound
|
||||||
|
end)
|
||||||
|
combatSound:UpdateColor(Heimdall_Data.config.minimapTagger.combatSound)
|
||||||
|
minimapTaggerConfigFrame:Add(combatSound, 2, 3)
|
||||||
|
|
||||||
|
local combatTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatTTL",
|
||||||
|
minimapTaggerConfigFrame.frame, "Combat TTL",
|
||||||
|
Heimdall_Data.config.minimapTagger.combatTTL,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.combatTTL = tonumber(text)
|
||||||
|
print("Combat TTL set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(combatTTL, 2, 3)
|
||||||
|
|
||||||
|
local combatSoundFile = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatSoundFile",
|
||||||
|
minimapTaggerConfigFrame.frame, "Combat Sound File",
|
||||||
|
Heimdall_Data.config.minimapTagger.combatSoundFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.combatSoundFile = text
|
||||||
|
print("Combat sound file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(combatSoundFile, 2, 3)
|
||||||
|
|
||||||
|
local combatSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatSoundThrottle",
|
||||||
|
minimapTaggerConfigFrame.frame, "Combat Sound Throttle",
|
||||||
|
Heimdall_Data.config.minimapTagger.combatSoundThrottle,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.combatSoundThrottle = tonumber(text)
|
||||||
|
print("Combat sound throttle set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(combatSoundThrottle, 2, 3)
|
||||||
|
|
||||||
|
local helpSound = CreateBasicButton("HeimdallMinimapTaggerConfigHelpSound",
|
||||||
|
minimapTaggerConfigFrame.frame, "Help Sound", function()
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSound = not Heimdall_Data.config.minimapTagger.helpSound
|
||||||
|
return Heimdall_Data.config.minimapTagger.helpSound
|
||||||
|
end)
|
||||||
|
helpSound:UpdateColor(Heimdall_Data.config.minimapTagger.helpSound)
|
||||||
|
minimapTaggerConfigFrame:Add(helpSound, 2, 3)
|
||||||
|
|
||||||
|
local helpTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpTTL",
|
||||||
|
minimapTaggerConfigFrame.frame, "Help TTL",
|
||||||
|
Heimdall_Data.config.minimapTagger.helpTTL,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.helpTTL = tonumber(text)
|
||||||
|
print("Help TTL set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(helpTTL, 2, 3)
|
||||||
|
|
||||||
|
local helpSoundFile = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpSoundFile",
|
||||||
|
minimapTaggerConfigFrame.frame, "Help Sound File",
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSoundFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSoundFile = text
|
||||||
|
print("Help sound file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(helpSoundFile, 2, 3)
|
||||||
|
|
||||||
|
local helpSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpSoundThrottle",
|
||||||
|
minimapTaggerConfigFrame.frame, "Help Sound Throttle",
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSoundThrottle,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%d+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.helpSoundThrottle = tonumber(text)
|
||||||
|
print("Help sound throttle set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(helpSoundThrottle, 2, 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Whisper Notify
|
-- Whisper Notify
|
||||||
@@ -1455,7 +1625,7 @@ function shared.Config.Init()
|
|||||||
stinkiesConfigFrame:Add(stinkies, 16, 12)
|
stinkiesConfigFrame:Add(stinkies, 16, 12)
|
||||||
end
|
end
|
||||||
|
|
||||||
configFrame.frame:Hide()
|
--configFrame.frame:Hide()
|
||||||
print("[Heimdall] Config loaded")
|
print("[Heimdall] Config loaded")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user