Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoL: Confirm import with 1-click or Return key #4054

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/Classes/ButtonControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ function ButtonClass:OnKeyDown(key)
end
if key == "LEFTBUTTON" then
self.clicked = true
elseif self.enterFunc then
self.enterFunc()
end
return self
end
Expand Down
12 changes: 6 additions & 6 deletions src/Classes/ImportTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ You can get this from your web browser's cookies while logged into the Path of E
self.controls.importCodeMode.selIndex = 2
end
end)
self.controls.importCodeIn.enterFunc = function()
if self.importCodeState == "VALID" then
self.controls.importCodeGo.onClick()
end
end
self.controls.importCodeState = new("LabelControl", {"LEFT",self.controls.importCodeIn,"RIGHT"}, 4, 0, 0, 16)
self.controls.importCodeState.label = function()
return (self.importCodeState == "VALID" and colorCodes.POSITIVE.."Code is valid") or (self.importCodeState == "INVALID" and colorCodes.NEGATIVE.."Invalid code") or ""
Expand Down Expand Up @@ -270,6 +265,11 @@ You can get this from your web browser's cookies while logged into the Path of E
self.controls.importCodeGo.enabled = function()
return self.importCodeState == "VALID"
end
self.controls.importCodeGo.enterFunc = function()
if self.importCodeState == "VALID" then
self.controls.importCodeGo.onClick()
end
end
end)

function ImportTabClass:Load(xml, fileName)
Expand Down Expand Up @@ -987,8 +987,8 @@ function ImportTabClass:OpenImportFromWebsitePopup()
controls.import.enabled = true
else
self.controls.importCodeIn:SetText(data, true)
main:SelectControl(self.controls.importCodeGo)
main:ClosePopup()
main:SelectControl(self.controls.importCodeIn)
end
end)
end)
Expand Down