Added whole bunch of editable things (units, jobs, flows)

develop
Warmist 2012-09-01 01:22:51 +03:00
parent 262233aa33
commit af155db3be
1 changed files with 22 additions and 3 deletions

@ -2,8 +2,27 @@
-- TODO use this: MechanismList = defclass(MechanismList, guidm.MenuOverlay) -- TODO use this: MechanismList = defclass(MechanismList, guidm.MenuOverlay)
local gui = require 'gui' local gui = require 'gui'
if dfhack.gui.getCurFocus() ~= 'item' then local my_trg
qerror("This script requires the item view.") if dfhack.gui.getCurFocus() == 'item' then
my_trg=dfhack.gui.getCurViewscreen().item
elseif dfhack.gui.getCurFocus() == 'joblist' then
local t_screen=dfhack.gui.getCurViewscreen()
my_trg=t_screen.jobs[t_screen.cursor_pos]
elseif dfhack.gui.getCurFocus() == 'createquota' then
local t_screen=dfhack.gui.getCurViewscreen()
my_trg=t_screen.orders[t_screen.sel_idx]
elseif dfhack.gui.getCurFocus() == 'dwarfmode/LookAround/Flow' then
local t_look=df.global.ui_look_list.items[df.global.ui_look_cursor]
my_trg=t_look.flow
elseif dfhack.gui.getSelectedUnit(true) then
my_trg=dfhack.gui.getSelectedUnit(true)
elseif dfhack.gui.getSelectedItem(true) then
my_trg=dfhack.gui.getSelectedItem(true)
elseif dfhack.gui.getSelectedJob(true) then
my_trg=dfhack.gui.getSelectedJob(true)
else
qerror("No valid target found")
end end
TextInputDialog = defclass(TextInputDialog, gui.FramedScreen) TextInputDialog = defclass(TextInputDialog, gui.FramedScreen)
@ -177,5 +196,5 @@ local item_screen={
local screen = mkinstance(gui.FramedScreen,item_screen):init(dfhack.gui.getCurViewscreen().item) local screen = mkinstance(gui.FramedScreen,item_screen):init(my_trg)
screen:show() screen:show()