Fix Advanced Item Description error popup problems (#8311)
* show as warning, once per session * move to keypress handling code
This commit is contained in:
@@ -298,10 +298,6 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
|
||||
self.rawLines = { }
|
||||
-- Find non-blank lines and trim whitespace
|
||||
for line in raw:gmatch("%s*([^\n]*%S)") do
|
||||
if line:match("^{ ") then
|
||||
main:OpenMessagePopup("Error", "\"Advanced Item Description\" (Ctrl+Alt+c) is currently unsupported.\nPlease try again using Ctrl+c only.")
|
||||
return
|
||||
end
|
||||
t_insert(self.rawLines, line)
|
||||
end
|
||||
local mode = rarity and "GAME" or "WIKI"
|
||||
|
||||
@@ -1170,6 +1170,11 @@ function ItemsTabClass:Draw(viewPort, inputEvents)
|
||||
if event.type == "KeyDown" then
|
||||
if event.key == "v" and IsKeyDown("CTRL") then
|
||||
local newItem = Paste()
|
||||
if newItem:find("{ ", 0, true) then
|
||||
main:OpenConfirmPopup("Warning", "\"Advanced Item Descriptions\" (Ctrl+Alt+c) are unsupported.\n\nAbort paste?", "OK", function()
|
||||
self:SetDisplayItem()
|
||||
end)
|
||||
end
|
||||
if newItem then
|
||||
self:CreateDisplayItemFromRaw(newItem, true)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user