Skip to content

Commit

Permalink
Merge pull request #15 from wowsims/sockets
Browse files Browse the repository at this point in the history
Fix socket bonus + non-english stat matching in reforge detection
  • Loading branch information
raethkcj committed Jun 3, 2024
2 parents c155756 + 7737495 commit 50e445e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions CataReforgeDetection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local statIdToStrings = {
}
-- Add strings without the placeholder.
for _, v in pairs(statIdToStrings) do
v.statStringNoVar = v.statString:gsub("%%s", "")
v.statStringNoVar = v.statString:format(".-")
end

-- Map localised strings to stat IDs.
Expand Down Expand Up @@ -167,6 +167,8 @@ local function GetItemEnchantText(unit, itemSlot)
return ""
end

local socketBonus = "^" .. ITEM_SOCKET_BONUS:format("")

---Parse stats used in reforging and their current value from item tooltip.
---@param unit string
---@param itemSlot integer
Expand All @@ -183,7 +185,7 @@ local function GetItemCurrentStats(unit, itemSlot, enchantText)
local region = regions[i]
if region and region:GetObjectType() == "FontString" then
local text = region:GetText()
if text and text ~= enchantText then
if text and text ~= enchantText and not text:find(socketBonus) then
for statId, v in pairs(statIdToStrings) do
local pos = text:find(v.statStringNoVar)
if pos then
Expand Down
2 changes: 1 addition & 1 deletion WowSimsExporter-Cata.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Title: WowSimsExporter v@project-version@ |cffff3a03Cataclysm|r
## Title: WowSimsExporter @project-version@ |cffff3a03Cataclysm|r
## Version: @project-version@
## Author: generalwrex(Natop of Old Blanchy), namreeb, coolmodi(FelixPflaum), riotdog
## Interface: 40400
Expand Down
2 changes: 1 addition & 1 deletion WowSimsExporter-Vanilla.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Title: WowSimsExporter v@project-version@ |cffff8000Classic SoD|r
## Title: WowSimsExporter @project-version@ |cffff8000Classic SoD|r
## Version: @project-version@
## Author: generalwrex(Natop of Old Blanchy), namreeb, coolmodi(FelixPflaum), riotdog
## Interface: 11500
Expand Down
2 changes: 1 addition & 1 deletion WowSimsExporter-Wrath.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Title: WowSimsExporter v@project-version@ |c0000ffffWOTLK|r
## Title: WowSimsExporter @project-version@ |c0000ffffWOTLK|r
## Version: @project-version@
## Author: generalwrex(Natop of Old Blanchy), namreeb, coolmodi(FelixPflaum), riotdog
## Interface: 30403
Expand Down
2 changes: 2 additions & 0 deletions embeds.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Ui xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.blizzard.com/wow/ui/">
<!--@non-debug@
<Script file="Libs\LibStub\LibStub.lua"/>
<Script file="Libs\LibParse\LibParse.lua"/>
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
Expand All @@ -9,4 +10,5 @@
<Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
@end-non-debug@-->
</Ui>

0 comments on commit 50e445e

Please sign in to comment.