Fix a compability issue with Super API

This commit is contained in:
konaka
2025-09-27 00:41:05 +08:00
parent 9995af537f
commit c54b3c43d6
+15 -1
View File
@@ -139,6 +139,20 @@ end
function UnitXP_SP3_detoured_CombatText_AddMessage(message, scrollFunction, r, g, b, displayType, isStaggered)
if UnitXP_SP3_Addon["combatTextSP3"] then
-- Reported by Heallios
-- Super WoW/API is also hooking CombatText_AddMessage to process the message doing a GUID to name conversion.
-- However as UnitXP_SP3 would not call underlying function when using its own combat text facility, this conversion would be skipped.
-- For now, we copy pasTA Super WoW/API conversion code.
if SUPERWOW_VERSION then
message = gsub(message, "(%s%[)(0x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x)(%])", function(bracket1, hex, bracket2)
if UnitIsUnit(hex, "player") then
return nil;
else
return " [" .. UnitName(hex) .. "]";
end
end);
end
if displayType == "crit" then
pcall(UnitXP, "addCombatText", "crit", message, r, g, b);
else
@@ -493,7 +507,7 @@ function UnitXP_SP3_UI_OnClick(widget)
xpsp3_editBox_FPScap:ClearFocus();
xpsp3_editBox_combatTextSP3_fontSize:ClearFocus();
skipUpdateMessage = false;
if string.find(widget:GetName(), "_editBox_") then