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 <localidentity2@gmail.com>
This commit is contained in:
Никита Троянов
2025-06-29 10:04:02 +03:00
committed by GitHub
parent abb56bc39b
commit 039d582917
3 changed files with 12 additions and 1 deletions

View File

@@ -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

View File

@@ -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:")

View File

@@ -488,6 +488,7 @@ end
function main:SetMode(newMode, ...)
self.newMode = newMode
self.newModeArgs = {...}
self.predefinedBuildName = nil
end
function main:CallMode(func, ...)