From 039d582917a4289a063a7929d6f7db9992befa2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=A2=D1=80=D0=BE?= =?UTF-8?q?=D1=8F=D0=BD=D0=BE=D0=B2?= <36129181+n1tr0xs@users.noreply.github.com> Date: Sun, 29 Jun 2025 10:04:02 +0300 Subject: [PATCH] Predefine build name on character import. (#8185) * predefine build name on import * # * nulling predefined build name on new build * Remove account discriminator from account name * Only use the predefined name when on a blank build --------- Co-authored-by: LocalIdentity --- src/Classes/ImportTab.lua | 10 ++++++++++ src/Modules/Build.lua | 2 +- src/Modules/Main.lua | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Classes/ImportTab.lua b/src/Classes/ImportTab.lua index 00af8ebc..bb501636 100644 --- a/src/Classes/ImportTab.lua +++ b/src/Classes/ImportTab.lua @@ -161,6 +161,7 @@ You can get this from your web browser's cookies while logged into the Path of E else self:DownloadPassiveTree() end + self:SetPredefinedBuildName() end) self.controls.charImportTree.enabled = function() return self.charImportMode == "SELECTCHAR" @@ -168,6 +169,7 @@ You can get this from your web browser's cookies while logged into the Path of E self.controls.charImportTreeClearJewels = new("CheckBoxControl", {"LEFT",self.controls.charImportTree,"RIGHT"}, {90, 0, 18}, "Delete jewels:", nil, "Delete all existing jewels when importing.", true) self.controls.charImportItems = new("ButtonControl", {"LEFT",self.controls.charImportTree, "LEFT"}, {0, 36, 110, 20}, "Items and Skills", function() self:DownloadItems() + self:SetPredefinedBuildName() end) self.controls.charImportItems.enabled = function() return self.charImportMode == "SELECTCHAR" @@ -1191,3 +1193,11 @@ function ImportTabClass:ProcessJSON(json) end return data end + +function ImportTabClass:SetPredefinedBuildName() + local accountName = self.controls.accountName.buf:gsub('%s+', ''):gsub("#%d+", "") + local charSelect = self.controls.charSelect + local charData = charSelect.list[charSelect.selIndex].char + local charName = charData.name + main.predefinedBuildName = accountName.." - "..charName +end \ No newline at end of file diff --git a/src/Modules/Build.lua b/src/Modules/Build.lua index b9f83f50..a54fa533 100644 --- a/src/Modules/Build.lua +++ b/src/Modules/Build.lua @@ -1251,7 +1251,7 @@ function buildMode:OpenSaveAsPopup() end controls.label = new("LabelControl", nil, {0, 20, 0, 16}, "^7Enter new build name:") controls.edit = new("EditControl", nil, {0, 40, 450, 20}, - (self.buildName or self.dbFileName):gsub("[\\/:%*%?\"<>|%c]", "-"), nil, "\\/:%*%?\"<>|%c", 100, function(buf) + not self.dbFileName and main.predefinedBuildName or (self.buildName or self.dbFileName):gsub("[\\/:%*%?\"<>|%c]", "-"), nil, "\\/:%*%?\"<>|%c", 100, function(buf) updateBuildName() end) controls.folderLabel = new("LabelControl", {"TOPLEFT",nil,"TOPLEFT"}, {10, 70, 0, 16}, "^7Folder:") diff --git a/src/Modules/Main.lua b/src/Modules/Main.lua index 37b35f3b..06a7592b 100644 --- a/src/Modules/Main.lua +++ b/src/Modules/Main.lua @@ -488,6 +488,7 @@ end function main:SetMode(newMode, ...) self.newMode = newMode self.newModeArgs = {...} + self.predefinedBuildName = nil end function main:CallMode(func, ...)