Fix "exportlegends maps"

Correct list index error which skipped export of detailed map.  Allow
region-maps-only export to start from detailed maps viewscreen.  More
informative error message.  Closes #445.,
develop
PeridexisErrant 2014-12-15 10:22:05 +11:00
parent 9dbe639919
commit b93eac1c7a
1 changed files with 5 additions and 2 deletions

@ -51,7 +51,7 @@ end
function wait_for_export_maps_vs() function wait_for_export_maps_vs()
local vs = dfhack.gui.getCurViewscreen() local vs = dfhack.gui.getCurViewscreen()
if dfhack.gui.getCurFocus() == "export_graphical_map" then if dfhack.gui.getCurFocus() == "export_graphical_map" then
vs.sel_idx = i vs.sel_idx = i-1
print(' Exporting: '..MAPS[i]..' map') print(' Exporting: '..MAPS[i]..' map')
gui.simulateInput(vs, 'SELECT') gui.simulateInput(vs, 'SELECT')
i = i + 1 i = i + 1
@ -88,6 +88,9 @@ if dfhack.gui.getCurFocus() == "legends" then
export_site_maps() export_site_maps()
else dfhack.printerr('Valid arguments are "all", "info", "maps" or "sites"') else dfhack.printerr('Valid arguments are "all", "info", "maps" or "sites"')
end end
elseif args[1] == "maps" and
dfhack.gui.getCurFocus() == "export_graphical_map" then
wait_for_export_maps_vs()
else else
dfhack.printerr('Not in main legends view') dfhack.printerr('Exportlegends must be run from the main legends view')
end end