From b1a382d2dacd82a4a390a85fcffba69341afa532 Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Sun, 28 Sep 2025 02:40:37 -0500 Subject: [PATCH 1/3] Add copy button to exporter and increase script list size --- src/Export/Main.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Export/Main.lua b/src/Export/Main.lua index 7c7e47a521..d3a2400c44 100644 --- a/src/Export/Main.lua +++ b/src/Export/Main.lua @@ -181,7 +181,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 @@ -198,7 +198,7 @@ function main:Init() return not self.curDatFile end } - self.controls.clearOutput = new("ButtonControl", nil, {1190, 10, 100, 18}, "Clear", function() + self.controls.clearOutput = new("ButtonControl", nil, {1230, 10, 100, 18}, "Clear", function() wipeTable(self.scriptOutput) end) { shown = function() @@ -213,17 +213,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() From b4925d16f6a8ff6375f96c3560cf56c47f706239 Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Sun, 28 Sep 2025 02:40:37 -0500 Subject: [PATCH 2/3] Add copy button to exporter and increase script list size --- src/Export/Main.lua | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Export/Main.lua b/src/Export/Main.lua index 7c7e47a521..86683ac3b5 100644 --- a/src/Export/Main.lua +++ b/src/Export/Main.lua @@ -181,7 +181,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 @@ -198,7 +198,7 @@ function main:Init() return not self.curDatFile end } - self.controls.clearOutput = new("ButtonControl", nil, {1190, 10, 100, 18}, "Clear", function() + self.controls.clearOutput = new("ButtonControl", nil, {1230, 10, 100, 18}, "Clear", function() wipeTable(self.scriptOutput) end) { shown = function() @@ -213,17 +213,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, 575}) { 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() From 0d22193bb4d6e97b640f82d57b38261b3cf22c02 Mon Sep 17 00:00:00 2001 From: Blitz54 Date: Sun, 28 Sep 2025 04:22:43 -0500 Subject: [PATCH 3/3] Fix spaces --- src/Export/Main.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Export/Main.lua b/src/Export/Main.lua index ee22271081..ceebf77035 100644 --- a/src/Export/Main.lua +++ b/src/Export/Main.lua @@ -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)