From b2a68303cf3839fdc053036236a90d05fc2f73e0 Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Sun, 26 Oct 2025 09:17:21 +0000 Subject: [PATCH 1/2] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/pull/1463 --- src/Export/Main.lua | 20 +++++++++++++++++--- src/Export/Main.lua.rej | 30 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 src/Export/Main.lua.rej diff --git a/src/Export/Main.lua b/src/Export/Main.lua index 64611ba40e..b2bb97d32b 100644 --- a/src/Export/Main.lua +++ b/src/Export/Main.lua @@ -177,7 +177,7 @@ function main:Init() self:SetCurrentDat() end) - self.controls.scriptAll = new("ButtonControl", nil, {270, 10, 100, 18}, "Run All", function() + self.controls.scriptAll = new("ButtonControl", nil, {270, 10, 140, 18}, "Run All", function() do -- run stat desc first local errMsg = PLoadModule("Scripts/".."statdesc"..".lua") if errMsg then @@ -210,17 +210,31 @@ function main:Init() end, nil, false) self.controls.helpText = new("LabelControl", {"TOPLEFT",self.controls.clearOutput,"BOTTOMLEFT"}, {0, 42, 100, 16}, "Press Ctrl+F5 to re-export\ndata from the game") - self.controls.scriptList = new("ScriptListControl", nil, {270, 35, 100, 300}) { + self.controls.scriptList = new("ScriptListControl", nil, {270, 35, 140, 400}) { shown = function() return not self.curDatFile end } - self.controls.scriptOutput = new("TextListControl", nil, {380, 10, 800, 600}, nil, self.scriptOutput) { + self.controls.scriptOutput = new("TextListControl", nil, {420, 10, 800, 600}, nil, self.scriptOutput) { shown = function() return not self.curDatFile end } + self.controls.copyScriptOutput = new("ButtonControl",{"TOPRIGHT", self.controls.scriptOutput, "BOTTOMRIGHT"},{0, 4, 80, 20},"Copy",function() + local lines = {} + local textList = self.controls.scriptOutput.list or {} -- grab the actual list + for _, entry in ipairs(textList) do + local line = entry[1] or "" + line = line:gsub("^%^[0-9a-fA-F]+", "") -- remove color codes + if line ~= "" then + table.insert(lines, line) + end + end + Copy(table.concat(lines, "\n")) + end + ) + self.controls.datSearch = new("EditControl", {"TOPLEFT", self.controls.datSource, "BOTTOMLEFT"}, {0, 2, 250, 18}, nil, "^7Search", nil, nil, function(buf) self.controls.datList.searchBuf = buf self.controls.datList:BuildFilteredList() diff --git a/src/Export/Main.lua.rej b/src/Export/Main.lua.rej new file mode 100644 index 0000000000..b9c96f3681 --- /dev/null +++ b/src/Export/Main.lua.rej @@ -0,0 +1,30 @@ +diff a/src/Export/Main.lua b/src/Export/Main.lua (rejected hunks) +@@ -225,17 +225,17 @@ function main:Init() + } + + self.controls.copyScriptOutput = new("ButtonControl", {"TOPRIGHT", self.controls.scriptOutput, "BOTTOMRIGHT"}, {0, 4, 80, 20}, "Copy", function() +- local lines = {} +- local textList = self.controls.scriptOutput.list or {} -- grab the actual list +- for _, entry in ipairs(textList) do +- local line = entry[1] or "" +- line = line:gsub("^%^[0-9]+", "") -- remove color codes +- if line ~= "" then +- table.insert(lines, line) +- end +- end +- Copy(table.concat(lines, "\n")) +- end ++ local lines = {} ++ local textList = self.controls.scriptOutput.list or {} ++ for _, entry in ipairs(textList) do ++ local line = entry[1] or "" ++ line = line:gsub("^%^[0-9]+", "") -- remove color codes ++ if line ~= "" then ++ table.insert(lines, line) ++ end ++ end ++ Copy(table.concat(lines, "\n")) ++ end + ) + + self.controls.datSearch = new("EditControl", {"TOPLEFT", self.controls.datSource, "BOTTOMLEFT"}, {0, 2, 250, 18}, nil, "^7Search", nil, nil, function(buf) From 163f96a876dedd9cb183bac56096dede939ec4a6 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Sun, 26 Oct 2025 04:23:11 -0500 Subject: [PATCH 2/2] Fix whitespace --- src/Export/Main.lua | 22 +++++++++++----------- src/Export/Main.lua.rej | 30 ------------------------------ 2 files changed, 11 insertions(+), 41 deletions(-) delete mode 100644 src/Export/Main.lua.rej diff --git a/src/Export/Main.lua b/src/Export/Main.lua index b2bb97d32b..d05c7c5378 100644 --- a/src/Export/Main.lua +++ b/src/Export/Main.lua @@ -222,17 +222,17 @@ function main:Init() } self.controls.copyScriptOutput = new("ButtonControl",{"TOPRIGHT", self.controls.scriptOutput, "BOTTOMRIGHT"},{0, 4, 80, 20},"Copy",function() - local lines = {} - local textList = self.controls.scriptOutput.list or {} -- grab the actual list - for _, entry in ipairs(textList) do - local line = entry[1] or "" - line = line:gsub("^%^[0-9a-fA-F]+", "") -- remove color codes - if line ~= "" then - table.insert(lines, line) - end - end - Copy(table.concat(lines, "\n")) - end + local lines = {} + local textList = self.controls.scriptOutput.list or {} -- grab the actual list + for _, entry in ipairs(textList) do + local line = entry[1] or "" + line = line:gsub("^%^[0-9a-fA-F]+", "") -- remove color codes + if line ~= "" then + table.insert(lines, line) + end + end + Copy(table.concat(lines, "\n")) + end ) self.controls.datSearch = new("EditControl", {"TOPLEFT", self.controls.datSource, "BOTTOMLEFT"}, {0, 2, 250, 18}, nil, "^7Search", nil, nil, function(buf) diff --git a/src/Export/Main.lua.rej b/src/Export/Main.lua.rej deleted file mode 100644 index b9c96f3681..0000000000 --- a/src/Export/Main.lua.rej +++ /dev/null @@ -1,30 +0,0 @@ -diff a/src/Export/Main.lua b/src/Export/Main.lua (rejected hunks) -@@ -225,17 +225,17 @@ function main:Init() - } - - self.controls.copyScriptOutput = new("ButtonControl", {"TOPRIGHT", self.controls.scriptOutput, "BOTTOMRIGHT"}, {0, 4, 80, 20}, "Copy", function() -- local lines = {} -- local textList = self.controls.scriptOutput.list or {} -- grab the actual list -- for _, entry in ipairs(textList) do -- local line = entry[1] or "" -- line = line:gsub("^%^[0-9]+", "") -- remove color codes -- if line ~= "" then -- table.insert(lines, line) -- end -- end -- Copy(table.concat(lines, "\n")) -- end -+ local lines = {} -+ local textList = self.controls.scriptOutput.list or {} -+ for _, entry in ipairs(textList) do -+ local line = entry[1] or "" -+ line = line:gsub("^%^[0-9]+", "") -- remove color codes -+ if line ~= "" then -+ table.insert(lines, line) -+ end -+ end -+ Copy(table.concat(lines, "\n")) -+ end - ) - - self.controls.datSearch = new("EditControl", {"TOPLEFT", self.controls.datSource, "BOTTOMLEFT"}, {0, 2, 250, 18}, nil, "^7Search", nil, nil, function(buf)