Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions src/Export/Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -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 {}
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)
self.controls.datList.searchBuf = buf
self.controls.datList:BuildFilteredList()
Expand Down