Add configuration for textures
This commit is contained in:
55
Heimdall.lua
55
Heimdall.lua
@@ -171,21 +171,25 @@ local function init()
|
|||||||
---@field throttle number
|
---@field throttle number
|
||||||
---@field scale number
|
---@field scale number
|
||||||
---@field tagTTL number
|
---@field tagTTL number
|
||||||
---@field alertTTL number
|
|
||||||
---@field combatTTL number
|
|
||||||
---@field helpTTL number
|
|
||||||
---@field tagSound boolean
|
---@field tagSound boolean
|
||||||
---@field alertSound boolean
|
|
||||||
---@field combatSound boolean
|
|
||||||
---@field helpSound boolean
|
|
||||||
---@field tagSoundFile string
|
---@field tagSoundFile string
|
||||||
---@field alertSoundFile string
|
|
||||||
---@field combatSoundFile string
|
|
||||||
---@field helpSoundFile string
|
|
||||||
---@field tagSoundThrottle number
|
---@field tagSoundThrottle number
|
||||||
|
---@field tagTextureFile string
|
||||||
|
---@field alertTTL number
|
||||||
|
---@field alertSound boolean
|
||||||
|
---@field alertSoundFile string
|
||||||
---@field alertSoundThrottle number
|
---@field alertSoundThrottle number
|
||||||
|
---@field alertTextureFile string
|
||||||
|
---@field combatTTL number
|
||||||
|
---@field combatSound boolean
|
||||||
|
---@field combatSoundFile string
|
||||||
---@field combatSoundThrottle number
|
---@field combatSoundThrottle number
|
||||||
|
---@field combatTextureFile string
|
||||||
|
---@field helpTTL number
|
||||||
|
---@field helpSound boolean
|
||||||
|
---@field helpSoundFile string
|
||||||
---@field helpSoundThrottle number
|
---@field helpSoundThrottle number
|
||||||
|
---@field helpTextureFile string
|
||||||
|
|
||||||
--- Data ---
|
--- Data ---
|
||||||
---@class HeimdallMessengerData
|
---@class HeimdallMessengerData
|
||||||
@@ -354,27 +358,36 @@ local function init()
|
|||||||
throttle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "throttle" }, 10),
|
throttle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "throttle" }, 10),
|
||||||
scale = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "scale" }, 3),
|
scale = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "scale" }, 3),
|
||||||
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),
|
|
||||||
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),
|
||||||
|
tagSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSoundFile" }, "MGSSpot.ogg"),
|
||||||
|
tagSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagSoundThrottle" }, 0),
|
||||||
|
tagTextureFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "tagTextureFile" }, "Tag.tga"),
|
||||||
|
---
|
||||||
|
alertTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertTTL" }, 1),
|
||||||
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),
|
|
||||||
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" },
|
alertSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSoundFile" },
|
||||||
"OOF.ogg"),
|
"OOF.ogg"),
|
||||||
combatSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSoundFile" },
|
|
||||||
"StarScream.ogg"),
|
|
||||||
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" },
|
alertSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertSoundThrottle" },
|
||||||
0),
|
0),
|
||||||
|
alertTextureFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "alertTextureFile" },
|
||||||
|
"Alert.tga"),
|
||||||
|
---
|
||||||
|
combatTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatTTL" }, 1),
|
||||||
|
combatSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSound" }, false),
|
||||||
|
combatSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSoundFile" },
|
||||||
|
"StarScream.ogg"),
|
||||||
combatSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSoundThrottle" },
|
combatSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatSoundThrottle" },
|
||||||
2),
|
2),
|
||||||
|
combatTextureFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "combatTextureFile" },
|
||||||
|
"Fight.tga"),
|
||||||
|
---
|
||||||
|
helpTTL = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpTTL" }, 1),
|
||||||
|
helpSound = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSound" }, false),
|
||||||
|
helpSoundFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSoundFile" },
|
||||||
|
"MedicGangsterParadise.ogg"),
|
||||||
helpSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSoundThrottle" }, 2),
|
helpSoundThrottle = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpSoundThrottle" }, 2),
|
||||||
|
helpTextureFile = shared.GetOrDefault(Heimdall_Data, { "config", "minimapTagger", "helpTextureFile" },
|
||||||
|
"Help.tga"),
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1409,13 +1409,14 @@ function shared.Config.Init()
|
|||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(scale, 2, 3)
|
minimapTaggerConfigFrame:Add(scale, 2, 3)
|
||||||
|
|
||||||
|
--region Tag
|
||||||
local tagSound = CreateBasicButton("HeimdallMinimapTaggerConfigTagSound",
|
local tagSound = CreateBasicButton("HeimdallMinimapTaggerConfigTagSound",
|
||||||
minimapTaggerConfigFrame.frame, "Tag Sound", function()
|
minimapTaggerConfigFrame.frame, "Tag Sound", function()
|
||||||
Heimdall_Data.config.minimapTagger.tagSound = not Heimdall_Data.config.minimapTagger.tagSound
|
Heimdall_Data.config.minimapTagger.tagSound = not Heimdall_Data.config.minimapTagger.tagSound
|
||||||
return Heimdall_Data.config.minimapTagger.tagSound
|
return Heimdall_Data.config.minimapTagger.tagSound
|
||||||
end)
|
end)
|
||||||
tagSound:UpdateColor(Heimdall_Data.config.minimapTagger.tagSound)
|
tagSound:UpdateColor(Heimdall_Data.config.minimapTagger.tagSound)
|
||||||
minimapTaggerConfigFrame:Add(tagSound, 2, 3)
|
minimapTaggerConfigFrame:Add(tagSound, 2, 1)
|
||||||
|
|
||||||
local tagTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagTTL",
|
local tagTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagTTL",
|
||||||
minimapTaggerConfigFrame.frame, "Tag TTL",
|
minimapTaggerConfigFrame.frame, "Tag TTL",
|
||||||
@@ -1430,22 +1431,7 @@ function shared.Config.Init()
|
|||||||
self:SetText(Heimdall_Data.config.minimapTagger.tagTTL)
|
self:SetText(Heimdall_Data.config.minimapTagger.tagTTL)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(tagTTL, 2, 3)
|
minimapTaggerConfigFrame:Add(tagTTL, 2, 1)
|
||||||
|
|
||||||
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",
|
local tagSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagSoundThrottle",
|
||||||
minimapTaggerConfigFrame.frame, "Tag Sound Throttle",
|
minimapTaggerConfigFrame.frame, "Tag Sound Throttle",
|
||||||
@@ -1460,15 +1446,43 @@ function shared.Config.Init()
|
|||||||
self:SetText(Heimdall_Data.config.minimapTagger.tagSoundThrottle)
|
self:SetText(Heimdall_Data.config.minimapTagger.tagSoundThrottle)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(tagSoundThrottle, 2, 3)
|
minimapTaggerConfigFrame:Add(tagSoundThrottle, 2, 2)
|
||||||
|
|
||||||
|
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, 4)
|
||||||
|
|
||||||
|
local tagTexture = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigTagTexture",
|
||||||
|
minimapTaggerConfigFrame.frame, "Tag Texture",
|
||||||
|
Heimdall_Data.config.minimapTagger.tagTextureFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.tagTextureFile = text
|
||||||
|
print("Tag texture file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(tagTexture, 2, 4)
|
||||||
|
--endregion
|
||||||
|
--region Alert
|
||||||
local alertSound = CreateBasicButton("HeimdallMinimapTaggerConfigAlertSound",
|
local alertSound = CreateBasicButton("HeimdallMinimapTaggerConfigAlertSound",
|
||||||
minimapTaggerConfigFrame.frame, "Alert Sound", function()
|
minimapTaggerConfigFrame.frame, "Alert Sound", function()
|
||||||
Heimdall_Data.config.minimapTagger.alertSound = not Heimdall_Data.config.minimapTagger.alertSound
|
Heimdall_Data.config.minimapTagger.alertSound = not Heimdall_Data.config.minimapTagger.alertSound
|
||||||
return Heimdall_Data.config.minimapTagger.alertSound
|
return Heimdall_Data.config.minimapTagger.alertSound
|
||||||
end)
|
end)
|
||||||
alertSound:UpdateColor(Heimdall_Data.config.minimapTagger.alertSound)
|
alertSound:UpdateColor(Heimdall_Data.config.minimapTagger.alertSound)
|
||||||
minimapTaggerConfigFrame:Add(alertSound, 2, 3)
|
minimapTaggerConfigFrame:Add(alertSound, 2, 1)
|
||||||
|
|
||||||
local alertTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertTTL",
|
local alertTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertTTL",
|
||||||
minimapTaggerConfigFrame.frame, "Alert TTL",
|
minimapTaggerConfigFrame.frame, "Alert TTL",
|
||||||
@@ -1480,19 +1494,7 @@ function shared.Config.Init()
|
|||||||
print("Alert TTL set to", tostring(text))
|
print("Alert TTL set to", tostring(text))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(alertTTL, 2, 3)
|
minimapTaggerConfigFrame:Add(alertTTL, 2, 1)
|
||||||
|
|
||||||
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",
|
local alertSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertSoundThrottle",
|
||||||
minimapTaggerConfigFrame.frame, "Alert Sound Throttle",
|
minimapTaggerConfigFrame.frame, "Alert Sound Throttle",
|
||||||
@@ -1504,15 +1506,40 @@ function shared.Config.Init()
|
|||||||
print("Alert sound throttle set to", tostring(text))
|
print("Alert sound throttle set to", tostring(text))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(alertSoundThrottle, 2, 3)
|
minimapTaggerConfigFrame:Add(alertSoundThrottle, 2, 2)
|
||||||
|
|
||||||
|
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, 4)
|
||||||
|
|
||||||
|
local alertTexture = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigAlertTexture",
|
||||||
|
minimapTaggerConfigFrame.frame, "Alert Texture",
|
||||||
|
Heimdall_Data.config.minimapTagger.alertTextureFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.alertTextureFile = text
|
||||||
|
print("Alert texture file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(alertTexture, 2, 4)
|
||||||
|
--endregion
|
||||||
|
--region Combat
|
||||||
local combatSound = CreateBasicButton("HeimdallMinimapTaggerConfigCombatSound",
|
local combatSound = CreateBasicButton("HeimdallMinimapTaggerConfigCombatSound",
|
||||||
minimapTaggerConfigFrame.frame, "Combat Sound", function()
|
minimapTaggerConfigFrame.frame, "Combat Sound", function()
|
||||||
Heimdall_Data.config.minimapTagger.combatSound = not Heimdall_Data.config.minimapTagger.combatSound
|
Heimdall_Data.config.minimapTagger.combatSound = not Heimdall_Data.config.minimapTagger.combatSound
|
||||||
return Heimdall_Data.config.minimapTagger.combatSound
|
return Heimdall_Data.config.minimapTagger.combatSound
|
||||||
end)
|
end)
|
||||||
combatSound:UpdateColor(Heimdall_Data.config.minimapTagger.combatSound)
|
combatSound:UpdateColor(Heimdall_Data.config.minimapTagger.combatSound)
|
||||||
minimapTaggerConfigFrame:Add(combatSound, 2, 3)
|
minimapTaggerConfigFrame:Add(combatSound, 2, 1)
|
||||||
|
|
||||||
local combatTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatTTL",
|
local combatTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatTTL",
|
||||||
minimapTaggerConfigFrame.frame, "Combat TTL",
|
minimapTaggerConfigFrame.frame, "Combat TTL",
|
||||||
@@ -1524,19 +1551,7 @@ function shared.Config.Init()
|
|||||||
print("Combat TTL set to", tostring(text))
|
print("Combat TTL set to", tostring(text))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(combatTTL, 2, 3)
|
minimapTaggerConfigFrame:Add(combatTTL, 2, 1)
|
||||||
|
|
||||||
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",
|
local combatSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatSoundThrottle",
|
||||||
minimapTaggerConfigFrame.frame, "Combat Sound Throttle",
|
minimapTaggerConfigFrame.frame, "Combat Sound Throttle",
|
||||||
@@ -1548,15 +1563,40 @@ function shared.Config.Init()
|
|||||||
print("Combat sound throttle set to", tostring(text))
|
print("Combat sound throttle set to", tostring(text))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(combatSoundThrottle, 2, 3)
|
minimapTaggerConfigFrame:Add(combatSoundThrottle, 2, 2)
|
||||||
|
|
||||||
|
|
||||||
|
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, 4)
|
||||||
|
local combatTexture = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigCombatTexture",
|
||||||
|
minimapTaggerConfigFrame.frame, "Combat Texture",
|
||||||
|
Heimdall_Data.config.minimapTagger.combatTextureFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.combatTextureFile = text
|
||||||
|
print("Combat texture file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(combatTexture, 2, 4)
|
||||||
|
--endregion
|
||||||
|
--region Help
|
||||||
local helpSound = CreateBasicButton("HeimdallMinimapTaggerConfigHelpSound",
|
local helpSound = CreateBasicButton("HeimdallMinimapTaggerConfigHelpSound",
|
||||||
minimapTaggerConfigFrame.frame, "Help Sound", function()
|
minimapTaggerConfigFrame.frame, "Help Sound", function()
|
||||||
Heimdall_Data.config.minimapTagger.helpSound = not Heimdall_Data.config.minimapTagger.helpSound
|
Heimdall_Data.config.minimapTagger.helpSound = not Heimdall_Data.config.minimapTagger.helpSound
|
||||||
return Heimdall_Data.config.minimapTagger.helpSound
|
return Heimdall_Data.config.minimapTagger.helpSound
|
||||||
end)
|
end)
|
||||||
helpSound:UpdateColor(Heimdall_Data.config.minimapTagger.helpSound)
|
helpSound:UpdateColor(Heimdall_Data.config.minimapTagger.helpSound)
|
||||||
minimapTaggerConfigFrame:Add(helpSound, 2, 3)
|
minimapTaggerConfigFrame:Add(helpSound, 2, 1)
|
||||||
|
|
||||||
local helpTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpTTL",
|
local helpTTL = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpTTL",
|
||||||
minimapTaggerConfigFrame.frame, "Help TTL",
|
minimapTaggerConfigFrame.frame, "Help TTL",
|
||||||
@@ -1568,19 +1608,7 @@ function shared.Config.Init()
|
|||||||
print("Help TTL set to", tostring(text))
|
print("Help TTL set to", tostring(text))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(helpTTL, 2, 3)
|
minimapTaggerConfigFrame:Add(helpTTL, 2, 1)
|
||||||
|
|
||||||
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",
|
local helpSoundThrottle = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpSoundThrottle",
|
||||||
minimapTaggerConfigFrame.frame, "Help Sound Throttle",
|
minimapTaggerConfigFrame.frame, "Help Sound Throttle",
|
||||||
@@ -1592,7 +1620,32 @@ function shared.Config.Init()
|
|||||||
print("Help sound throttle set to", tostring(text))
|
print("Help sound throttle set to", tostring(text))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
minimapTaggerConfigFrame:Add(helpSoundThrottle, 2, 3)
|
minimapTaggerConfigFrame:Add(helpSoundThrottle, 2, 2)
|
||||||
|
|
||||||
|
|
||||||
|
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, 4)
|
||||||
|
local helpTexture = CreateBasicSmallEditBox("HeimdallMinimapTaggerConfigHelpTexture",
|
||||||
|
minimapTaggerConfigFrame.frame, "Help Texture",
|
||||||
|
Heimdall_Data.config.minimapTagger.helpTextureFile,
|
||||||
|
function(self)
|
||||||
|
local text = self:GetText()
|
||||||
|
if string.match(text, "%S+") then
|
||||||
|
Heimdall_Data.config.minimapTagger.helpTextureFile = text
|
||||||
|
print("Help texture file set to", tostring(text))
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
minimapTaggerConfigFrame:Add(helpTexture, 2, 4)
|
||||||
|
--endregion
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Whisper Notify
|
-- Whisper Notify
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ function shared.MinimapTagger.Init()
|
|||||||
frame.custom = { busy = false }
|
frame.custom = { busy = false }
|
||||||
local texture = frame:CreateTexture(nil, "ARTWORK")
|
local texture = frame:CreateTexture(nil, "ARTWORK")
|
||||||
texture:SetAllPoints(frame)
|
texture:SetAllPoints(frame)
|
||||||
texture:SetTexture(TextureRoot .. "Alert.tga")
|
texture:SetTexture(TextureRoot .. Heimdall_Data.config.minimapTagger.alertTextureFile)
|
||||||
table.insert(alertFramePool, frame)
|
table.insert(alertFramePool, frame)
|
||||||
end
|
end
|
||||||
local muteAlertUntil = 0
|
local muteAlertUntil = 0
|
||||||
@@ -131,7 +131,7 @@ function shared.MinimapTagger.Init()
|
|||||||
frame.custom = { busy = false }
|
frame.custom = { busy = false }
|
||||||
local texture = frame:CreateTexture(nil, "ARTWORK")
|
local texture = frame:CreateTexture(nil, "ARTWORK")
|
||||||
texture:SetAllPoints(frame)
|
texture:SetAllPoints(frame)
|
||||||
texture:SetTexture(TextureRoot .. "Tag.tga")
|
texture:SetTexture(TextureRoot .. Heimdall_Data.config.minimapTagger.tagTextureFile)
|
||||||
table.insert(tagFramePool, frame)
|
table.insert(tagFramePool, frame)
|
||||||
end
|
end
|
||||||
local muteTagUntil = 0
|
local muteTagUntil = 0
|
||||||
@@ -174,27 +174,27 @@ function shared.MinimapTagger.Init()
|
|||||||
end
|
end
|
||||||
--endregion
|
--endregion
|
||||||
|
|
||||||
--region Battle
|
--region Combat
|
||||||
---@type Frame[]
|
---@type Frame[]
|
||||||
local battleFramePool = {}
|
local combatFramePool = {}
|
||||||
local battleFramePoolMaxSize = 20
|
local combatFramePoolMaxSize = 20
|
||||||
for i = 1, battleFramePoolMaxSize do
|
for i = 1, combatFramePoolMaxSize do
|
||||||
local frame = CreateFrame("Frame")
|
local frame = CreateFrame("Frame")
|
||||||
frame.custom = { busy = false }
|
frame.custom = { busy = false }
|
||||||
local texture = frame:CreateTexture(nil, "ARTWORK")
|
local texture = frame:CreateTexture(nil, "ARTWORK")
|
||||||
texture:SetAllPoints(frame)
|
texture:SetAllPoints(frame)
|
||||||
texture:SetTexture(TextureRoot .. "Fight.tga")
|
texture:SetTexture(TextureRoot .. Heimdall_Data.config.minimapTagger.combatTextureFile)
|
||||||
table.insert(battleFramePool, frame)
|
table.insert(combatFramePool, frame)
|
||||||
end
|
end
|
||||||
local muteBattleUntil = 0
|
local muteCombatUntil = 0
|
||||||
---@param x number
|
---@param x number
|
||||||
---@param y number
|
---@param y number
|
||||||
---@param scale number?
|
---@param scale number?
|
||||||
local function PlantBattle(x, y, scale)
|
local function PlantCombat(x, y, scale)
|
||||||
local frame = nil
|
local frame = nil
|
||||||
for _, battleFrame in ipairs(battleFramePool) do
|
for _, combatFrame in ipairs(combatFramePool) do
|
||||||
if not battleFrame.custom.busy then
|
if not combatFrame.custom.busy then
|
||||||
frame = battleFrame
|
frame = combatFrame
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -209,12 +209,12 @@ function shared.MinimapTagger.Init()
|
|||||||
print(string.format("[%s] Playing combat sound: %s", ModuleName,
|
print(string.format("[%s] Playing combat sound: %s", ModuleName,
|
||||||
Heimdall_Data.config.minimapTagger.combatSoundFile))
|
Heimdall_Data.config.minimapTagger.combatSoundFile))
|
||||||
end
|
end
|
||||||
if muteBattleUntil > GetTime() then
|
if muteCombatUntil > GetTime() then
|
||||||
if Heimdall_Data.config.minimapTagger.debug then
|
if Heimdall_Data.config.minimapTagger.debug then
|
||||||
print(string.format("[%s] Combat sound is muted until %d", ModuleName, muteBattleUntil))
|
print(string.format("[%s] Combat sound is muted until %d", ModuleName, muteCombatUntil))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
muteBattleUntil = GetTime() + Heimdall_Data.config.minimapTagger.combatSoundThrottle
|
muteCombatUntil = GetTime() + Heimdall_Data.config.minimapTagger.combatSoundThrottle
|
||||||
local ok = PlaySoundFile(SoundRoot .. Heimdall_Data.config.minimapTagger.combatSoundFile, "Master")
|
local ok = PlaySoundFile(SoundRoot .. Heimdall_Data.config.minimapTagger.combatSoundFile, "Master")
|
||||||
if not ok and Heimdall_Data.config.minimapTagger.debug then
|
if not ok and Heimdall_Data.config.minimapTagger.debug then
|
||||||
print(string.format("[%s] Failed to play combat sound: %s", ModuleName,
|
print(string.format("[%s] Failed to play combat sound: %s", ModuleName,
|
||||||
@@ -235,7 +235,7 @@ function shared.MinimapTagger.Init()
|
|||||||
frame.custom = { busy = false }
|
frame.custom = { busy = false }
|
||||||
local texture = frame:CreateTexture(nil, "ARTWORK")
|
local texture = frame:CreateTexture(nil, "ARTWORK")
|
||||||
texture:SetAllPoints(frame)
|
texture:SetAllPoints(frame)
|
||||||
texture:SetTexture(TextureRoot .. "Help.tga")
|
texture:SetTexture(TextureRoot .. Heimdall_Data.config.minimapTagger.helpTextureFile)
|
||||||
table.insert(helpFramePool, frame)
|
table.insert(helpFramePool, frame)
|
||||||
end
|
end
|
||||||
local muteHelpUntil = 0
|
local muteHelpUntil = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user