This commit is contained in:
NoM0Re
2025-05-31 22:54:39 +02:00
committed by GitHub
parent 9def6a5ab8
commit bda851552d
58 changed files with 2518 additions and 1671 deletions
@@ -110,7 +110,16 @@ function OptionsPrivate.CreateFrame()
frame:SetResizable(true)
frame:SetMinResize(minWidth, minHeight)
frame:SetFrameStrata("DIALOG")
frame.PortraitContainer.portrait:SetTexture([[Interface\AddOns\WeakAuras\Media\Textures\logo_256_round.tga]])
local now = time()
local y = date("*t", now).year
local inJune = now >= time{year=y, month=6, day=1, hour=0} and now < time{year=y, month=7, day=1, hour=0}
if inJune then
frame.PortraitContainer.portrait:SetTexture([[Interface\AddOns\WeakAuras\Media\Textures\logo_256_round_pride.tga]])
else
frame.PortraitContainer.portrait:SetTexture([[Interface\AddOns\WeakAuras\Media\Textures\logo_256_round.tga]])
end
frame.window = "default"
local xOffset, yOffset
@@ -508,7 +517,7 @@ function OptionsPrivate.CreateFrame()
end
local awesomeWotlkButton
if not WeakAuras.isAwesomeEnabled() then
if not WeakAuras.IsAwesomeEnabled() then
awesomeWotlkButton = addFooter("Awesome WotLK", [[Interface\AddOns\WeakAuras\Media\Textures\GitHub.tga]], "https://github.com/FrostAtom/awesome_wotlk/releases",
L["Unlock nameplate anchoring & units in WeakAuras with the Awesome WotLK client patch"])
awesomeWotlkButton:SetParent(tipFrame)
+30 -33
View File
@@ -157,6 +157,7 @@ local function ConstructTextEditor(frame)
group:SetLayout("flow")
local editor = AceGUI:Create("MultiLineEditBox")
editor.editBox.group = group
editor:SetFullWidth(true)
editor:SetFullHeight(true)
editor:DisableButton(true)
@@ -504,7 +505,7 @@ local function ConstructTextEditor(frame)
editor.editBox.timeMachine = {}
editor.editBox.timeMachinePos = 1
local TimeMachineMaximumRollback = 10
--[[ Doesn't exist, we need a workaround for that
editor.editBox:HookScript(
"OnKeyDown",
function(self, key)
@@ -539,10 +540,35 @@ local function ConstructTextEditor(frame)
end
end
)
]]
editor.editBox:HookScript(
"OnTextChanged",
function(self, userInput)
local str = editor.editBox:GetText()
if not str or str:trim() == "" or editor.combinedText == true then
self.group.editorError:SetText("")
else
local func, errorString
if (self.group.enclose) then
func, errorString = OptionsPrivate.Private.LoadFunction("return function() " .. str .. "\n end", self.group.data.id, true)
else
func, errorString = OptionsPrivate.Private.LoadFunction("return " .. str, self.group.data.id, true)
end
if not errorString and self.group.validator then
errorString = self.group.validator(func)
end
if errorString then
if self.url then
helpButton:Show()
end
self.group.editorError:Show()
self.group.editorError:SetText(errorString)
else
self.group.editorError:SetText("")
end
end
if not userInput then return end
if self.skipOnTextChanged then
self.skipOnTextChanged = false
@@ -596,6 +622,7 @@ local function ConstructTextEditor(frame)
editorError:SetTextColor(1, 0, 0)
editorError:SetPoint("LEFT", helpButton, "RIGHT", 0, 4)
editorError:SetPoint("RIGHT", settings_frame, "LEFT")
group.editorError = editorError
local editorLine = CreateFrame("EditBox", nil, group.frame, "WA_InputBoxTemplate")
-- Set script on enter pressed..
@@ -658,6 +685,8 @@ local function ConstructTextEditor(frame)
self.reloadOptions = reloadOptions
self.setOnParent = setOnParent
self.url = url
self.enclose = enclose
self.validator = validator
if url then
helpButton:Show()
else
@@ -694,36 +723,6 @@ local function ConstructTextEditor(frame)
-- catch it so that escape doesn't default to losing focus (after which another escape would close config)
end
)
self.oldOnTextChanged = editor.editBox:GetScript("OnTextChanged")
editor.editBox:SetScript(
"OnTextChanged",
function(...)
local str = editor.editBox:GetText()
if not str or str:trim() == "" or editor.combinedText == true then
editorError:SetText("")
else
local func, errorString
if (enclose) then
func, errorString = OptionsPrivate.Private.LoadFunction("return function() " .. str .. "\n end", true)
else
func, errorString = OptionsPrivate.Private.LoadFunction("return " .. str, true)
end
if not errorString and validator then
errorString = validator(func)
end
if errorString then
if self.url then
helpButton:Show()
end
editorError:Show()
editorError:SetText(errorString)
else
editorError:SetText("")
end
end
self.oldOnTextChanged(...)
end
)
if setOnParent then
editor:SetText(OptionsPrivate.Private.ValueFromPath(data, path) or "")
@@ -767,7 +766,6 @@ local function ConstructTextEditor(frame)
end
function group.CancelClose(self)
editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged)
editor:ClearFocus()
frame:HideTip()
frame.window = "default"
@@ -827,7 +825,6 @@ local function ConstructTextEditor(frame)
WeakAuras.ClearAndUpdateOptions(self.data.id)
editor.editBox:SetScript("OnTextChanged", self.oldOnTextChanged)
editor:ClearFocus()
frame.window = "default"
@@ -73,7 +73,10 @@ local function scamCheck(codes, data)
if (data.actions) then
if data.actions.init then
addCode(codes, L["%s - Init Action"]:format(data.id), data.actions.init.custom, data.actions.init.do_custom)
addCode(codes, L["%s - OnLoad"]:format(data.id), data.actions.init.customOnLoad, data.actions.init.do_custom_load)
addCode(codes, L["%s - OnUnload"]:format(data.id), data.actions.init.customOnUnload, data.actions.init.do_custom_unload)
end
if data.actions.start then
addCode(codes, L["%s - Start Action"]:format(data.id), data.actions.start.custom, data.actions.start.do_custom)
addCode(codes, L["%s - Start Custom Text"]:format(data.id), data.actions.start.message_custom, data.actions.start.do_message)