From d10079dbc1a83c8c9f52ce75d0c0bcbc1f0bd749 Mon Sep 17 00:00:00 2001 From: konaka <> Date: Sat, 24 Jan 2026 01:22:12 +0800 Subject: [PATCH] Beauty XML and add PNG screenshot --- UnitXP_SP3_Addon.lua | 33 +- UnitXP_SP3_Addon.xml | 1722 +++++++++++++++++++++--------------------- 2 files changed, 888 insertions(+), 867 deletions(-) mode change 100755 => 100644 UnitXP_SP3_Addon.xml diff --git a/UnitXP_SP3_Addon.lua b/UnitXP_SP3_Addon.lua index a21a71e..d363481 100755 --- a/UnitXP_SP3_Addon.lua +++ b/UnitXP_SP3_Addon.lua @@ -387,6 +387,20 @@ local function UnitXP_SP3_setWeatherAlwaysClear(enable) return result; end +local function UnitXP_SP3_screenshotQuality(perfect) + local test, result = pcall(UnitXP, "screenshot", perfect); + + if not test then + if not skipUpdateMessage then + skipUpdateMessage = true; + UnitXP_SP3_Print( + "UnitXP_SP3.dll failed to execute \"screenshot\". You might need to update UnitXP_SP3.dll to support this method."); + end + return false; + end + return result; +end + local function UnitXP_SP3_setCameraPinHeight(enable) local test, result = pcall(UnitXP, "cameraPinHeight", enable); @@ -600,6 +614,14 @@ local function UnitXP_SP3_reloadConfig() xpsp3_checkButton_weatherAlwaysClear:SetChecked(false); end + if UnitXP_SP3_Addon["perfectScreenshot"] then + UnitXP_SP3_screenshotQuality("perfect"); + xpsp3_checkButton_perfectScreenshot:SetChecked(true); + else + UnitXP_SP3_screenshotQuality("good"); + xpsp3_checkButton_perfectScreenshot:SetChecked(false); + end + for ev, v in pairs(UnitXP_SP3_Addon["notify_flashTaskbarIcon"]) do xpsp3Frame:UnregisterEvent(ev); end @@ -766,6 +788,14 @@ function UnitXP_SP3_UI_OnClick(widget) end end + if string.find(widget:GetName(), "_perfectScreenshot") then + if widget:GetChecked() then + UnitXP_SP3_Addon["perfectScreenshot"] = true; + else + UnitXP_SP3_Addon["perfectScreenshot"] = false; + end + end + if string.find(widget:GetName(), "_showInCombatNameplatesNearPlayer") then if widget:GetChecked() then UnitXP_SP3_Addon["showInCombatNameplatesNearPlayer"] = true; @@ -856,7 +886,7 @@ end function UnitXP_SP3_OnEvent(event) if event == "ADDON_LOADED" and arg1 == "UnitXP_SP3_Addon" then - local dataVersion = 33; + local dataVersion = 34; if UnitXP_SP3_Addon == nil or UnitXP_SP3_Addon["dataVersion"] ~= dataVersion then UnitXP_SP3_Addon = {}; UnitXP_SP3_Addon["dataVersion"] = dataVersion; @@ -879,6 +909,7 @@ function UnitXP_SP3_OnEvent(event) UnitXP_SP3_Addon["combatTextSP3_nameplateHeight"] = 55; UnitXP_SP3_Addon["combatTextSP3_fontName"] = "Cambria"; UnitXP_SP3_Addon["hideEXPtext"] = false; + UnitXP_SP3_Addon["perfectScreenshot"] = false; UnitXP_SP3_Addon["notify_flashTaskbarIcon"] = {}; UnitXP_SP3_Addon["notify_flashTaskbarIcon"]["PLAYER_REGEN_DISABLED"] = true; diff --git a/UnitXP_SP3_Addon.xml b/UnitXP_SP3_Addon.xml old mode 100755 new mode 100644 index 93ed0d8..f003b7c --- a/UnitXP_SP3_Addon.xml +++ b/UnitXP_SP3_Addon.xml @@ -1,866 +1,856 @@ - - - - -