Skip to content

Commit

Permalink
Update manager-quantity docs and fix with Lua 5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lethosor committed Aug 25, 2016
1 parent b65ef97 commit 0a022e8
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions gui/manager-quantity.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
-- Sets the quantity of the selected manager job
--[[
Sample usage:
keybinding add Alt-Q@jobmanagement manager-quantity
]]
--[====[
gui/manager-quantity
====================
Sets the quantity of the selected manager job
Sample usage::
keybinding add Alt-Q@jobmanagement gui/manager-quantity
]====]

local dialog = require 'gui.dialogs'
local args = {...}
Expand All @@ -16,6 +24,7 @@ if dfhack.gui.getCurFocus() == 'jobmanagement' then
local orders = df.global.world.manager_orders
function set_quantity(value)
if tonumber(value) then
value = tonumber(value)
local i = scr.sel_idx
local old_total = orders[i].amount_total
orders[i].amount_total = math.max(1, value)
Expand All @@ -41,4 +50,4 @@ if dfhack.gui.getCurFocus() == 'jobmanagement' then
end
else
dfhack.printerr('Must be called on the manager screen (j-m or u-m)')
end
end

1 comment on commit 0a022e8

@PeridexisErrant
Copy link
Contributor

@PeridexisErrant PeridexisErrant commented on 0a022e8 Aug 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that - as in #5 - keybindings will be detected and automatically listed when docs are built with Sphinx. DFHack/dfhack#963 proposes adding similar information at runtime.

Please sign in to comment.