diff --git a/Classes/BuildListControl.lua b/Classes/BuildListControl.lua index 3ee63b6d..35c552d7 100644 --- a/Classes/BuildListControl.lua +++ b/Classes/BuildListControl.lua @@ -29,7 +29,7 @@ local BuildListClass = common.NewClass("BuildList", "Control", "ControlHost", fu end self.controls.nameEdit.width = function() local width, height = self:GetSize() - return width - 160 + return width - 20 end end) @@ -101,9 +101,11 @@ function BuildListClass:Draw(viewPort) SetDrawColor(0, 0, 0) end DrawImage(nil, 0, lineY + 1, width - 22, 18) - DrawString(0, lineY + 2, "LEFT", 16, "VAR", "^7"..(build.buildName or "?")) - SetDrawColor(build.className and data.colorCodes[build.className:upper()] or "^7") - DrawString(width - 160, lineY + 2, "LEFT", 16, "VAR", string.format("Level %d %s", build.level or 1, (build.ascendClassName ~= "None" and build.ascendClassName) or build.className or "?")) + if self.listMode.edit ~= index then + DrawString(0, lineY + 2, "LEFT", 16, "VAR", "^7"..(build.buildName or "?")) + SetDrawColor(build.className and data.colorCodes[build.className:upper()] or "^7") + DrawString(width - 160, lineY + 2, "LEFT", 16, "VAR", string.format("Level %d %s", build.level or 1, (build.ascendClassName ~= "None" and build.ascendClassName) or build.className or "?")) + end end SetViewport() if self.listMode.edit then diff --git a/Modules/BuildList.lua b/Modules/BuildList.lua index de9dfd96..4c26fc67 100644 --- a/Modules/BuildList.lua +++ b/Modules/BuildList.lua @@ -121,10 +121,11 @@ function listMode:SelByFileName(selFileName) end end -function listMode:EditInit(finFunc) +function listMode:EditInit(prompt, finFunc) self.edit = self.sel self.editFinFunc = finFunc self.controls.buildList:ScrollSelIntoView() + self.controls.buildList.controls.nameEdit.prompt = prompt self.controls.buildList.controls.nameEdit:SetText(self.list[self.sel].buildName or "") end @@ -151,7 +152,7 @@ end function listMode:New() table.insert(self.list, 1, { fileName = "", level = 1 }) self.sel = 1 - self:EditInit(function(buf) + self:EditInit("New build name", function(buf) if #buf < 1 then return "No name entered" end @@ -188,7 +189,7 @@ function listMode:CopySel() table.insert(self.list, self.sel + 1, copyTable(self.list[self.sel])) self.sel = self.sel + 1 self.list[self.sel].fileName = srcName:gsub("%.xml$","") .. " (copy)" - self:EditInit(function(buf) + self:EditInit("Enter new name", function(buf) if #buf < 1 then return "No name entered" end @@ -220,7 +221,7 @@ function listMode:RenameSel() return end local oldName = self.list[self.sel].fileName - self:EditInit(function(buf) + self:EditInit("Enter new name", function(buf) if #buf < 1 then return "No name entered" end diff --git a/manifest.xml b/manifest.xml index ff79fdb4..fcc57ff4 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,12 +1,12 @@ - + - + @@ -34,7 +34,7 @@ - + @@ -91,7 +91,7 @@ - + diff --git a/runtime-win32.zip b/runtime-win32.zip index 3ae53787..13422dea 100644 Binary files a/runtime-win32.zip and b/runtime-win32.zip differ