Skip to content

Commit 556769b

Browse files
author
LocalIdentity
committed
Fix input issues
Regex was wrong and was rejecting integers Unsupported mods text issue
1 parent aa6f290 commit 556769b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Classes/CompareBuySimilar.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function M.openPopup(item, slotName, primaryBuild)
350350
-- Helper: create a numeric EditControl without +/- spinner buttons, and
351351
-- with a preset changeFunc
352352
local function newPlainNumericEdit(anchor, rect, init, prompt, limit, integer)
353-
local format = integer and "%d" or "^%d."
353+
local format = integer and "%D" or "^%d."
354354
local ctrl = new("EditControl", anchor, rect, init, prompt, format, limit, rebuildUrl)
355355
-- Remove the +/- spinner buttons that "%D" filter triggers
356356
ctrl.isNumeric = false
@@ -422,7 +422,7 @@ function M.openPopup(item, slotName, primaryBuild)
422422
-- Truncate long mod text to fit
423423
--- @type string[]
424424
local displayTexts = entry.formattedLines
425-
for _, displayText in ipairs(displayTexts) do
425+
for index, displayText in ipairs(displayTexts) do
426426
local colorCodeLength = displayText:match("(%^x%x%x%x%x%x%x)") or displayText:gsub("(%^%x)", "") or ""
427427

428428
if not canSearch then
@@ -432,6 +432,7 @@ function M.openPopup(item, slotName, primaryBuild)
432432
if #displayText > (#colorCodeLength + 62) then
433433
displayText = displayText:sub(1, #colorCodeLength + 54) .. "..."
434434
end
435+
displayTexts[index] = displayText
435436
end
436437

437438

0 commit comments

Comments
 (0)