diff --git a/Modules/Config.lua b/Modules/Config.lua index 0ebe545..fe5d58c 100644 --- a/Modules/Config.lua +++ b/Modules/Config.lua @@ -474,6 +474,62 @@ function shared.Config.Init() spotterConfigFrame:Add(throttleTime, 2, 4) end + do + local whoerConfigFrame = GridFrame.new("HeimdallWhoerConfig", + UIParent, 12, 20) + configFrame:Add(whoerConfigFrame, 5, 3) + + local title = whoerConfigFrame.frame:CreateFontString(nil, "ARTWORK", "GameFontNormal") + title:SetText("Whoer") + whoerConfigFrame:Add(title, 1, 12) + + local enableButton = BasicButton("HeimdallWhoerConfigEnableButton", + whoerConfigFrame.frame, "Enabled", function() + Heimdall_Data.config.who.enabled = not Heimdall_Data.config.who.enabled + return Heimdall_Data.config.who.enabled + end) + enableButton:UpdateColor(Heimdall_Data.config.who.enabled) + whoerConfigFrame:Add(enableButton, 1, 6) + + local doWhisperButton = BasicButton("HeimdallWhoerConfigDoWhisperButton", + whoerConfigFrame.frame, "Do Whisper", function() + Heimdall_Data.config.who.doWhisper = not Heimdall_Data.config.who.doWhisper + return Heimdall_Data.config.who.doWhisper + end) + doWhisperButton:UpdateColor(Heimdall_Data.config.who.doWhisper) + whoerConfigFrame:Add(doWhisperButton, 1, 6) + + local notifyChannel = CreateBasicSmallEditBox("HeimdallWhoerConfigNotifyChannel", + whoerConfigFrame.frame, "Notify Channel", + Heimdall_Data.config.who.notifyChannel, + function(self) + local text = self:GetText() + if string.match(text, "%S+") then + Heimdall_Data.config.who.notifyChannel = text + print("Notify channel set to", tostring(text)) + else + print("Invalid channel name", tostring(text)) + self:SetText(Heimdall_Data.config.who.notifyChannel) + end + end) + whoerConfigFrame:Add(notifyChannel, 2, 6) + + local ttl = CreateBasicSmallEditBox("HeimdallWhoerConfigTTL", + whoerConfigFrame.frame, "TTL", + Heimdall_Data.config.who.ttl, + function(self) + local text = self:GetText() + if string.match(text, "%d+") then + Heimdall_Data.config.who.ttl = tonumber(text) + print("TTL set to", tostring(text)) + else + print("Invalid TTL", tostring(text)) + self:SetText(Heimdall_Data.config.who.ttl) + end + end) + whoerConfigFrame:Add(ttl, 2, 6) + end + --local spotterEveryoneButton = BasicButton("HeimdallSpotterEveryone", spotterConfigFrame, "Everyone", function(state) -- Heimdall_Data.config.spotter.everyone = state --end)