open gui/launcher with the command on right arrow

develop
myk002 2022-11-06 16:47:45 -08:00
parent ae2d9008ef
commit fb7b55fb11
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 5 additions and 0 deletions

@ -126,11 +126,13 @@ function MenuScreen:onSelect(_, choice)
end end
function MenuScreen:onSubmit(_, choice) function MenuScreen:onSubmit(_, choice)
if not choice then return end
self:dismiss() self:dismiss()
dfhack.run_command(choice.command) dfhack.run_command(choice.command)
end end
function MenuScreen:onSubmit2(_, choice) function MenuScreen:onSubmit2(_, choice)
if not choice then return end
self:dismiss() self:dismiss()
dfhack.run_script('gui/launcher', choice.command) dfhack.run_script('gui/launcher', choice.command)
end end
@ -139,6 +141,9 @@ function MenuScreen:onInput(keys)
if keys.LEAVESCREEN then if keys.LEAVESCREEN then
self:dismiss() self:dismiss()
return true return true
elseif keys.STANDARDSCROLL_RIGHT then
self:onSubmit2(self.subviews.list:getSelected())
return true
end end
return self:inputToSubviews(keys) return self:inputToSubviews(keys)
end end