|
|
@ -397,6 +397,7 @@ function export_more_legends_xml()
|
|
|
|
--io.write ("\t\t".."<"..k.."_item_mat_index"..">"..tostring(event.props.item.mat_index).."</"..k.."_item_mat_index"..">".."\n")
|
|
|
|
--io.write ("\t\t".."<"..k.."_item_mat_index"..">"..tostring(event.props.item.mat_index).."</"..k.."_item_mat_index"..">".."\n")
|
|
|
|
io.write ("\t\t".."<"..k.."_pile_type"..">"..tostring(event.props.pile_type).."</"..k.."_pile_type"..">".."\n")
|
|
|
|
io.write ("\t\t".."<"..k.."_pile_type"..">"..tostring(event.props.pile_type).."</"..k.."_pile_type"..">".."\n")
|
|
|
|
elseif event:getType() == df.history_event_type.ASSUME_IDENTITY and k == "identity" then
|
|
|
|
elseif event:getType() == df.history_event_type.ASSUME_IDENTITY and k == "identity" then
|
|
|
|
|
|
|
|
if (table.contains(df.global.world.identities.all,v)) then
|
|
|
|
if (df.global.world.identities.all[v].histfig_id == -1) then
|
|
|
|
if (df.global.world.identities.all[v].histfig_id == -1) then
|
|
|
|
local thisIdentity = df.global.world.identities.all[v]
|
|
|
|
local thisIdentity = df.global.world.identities.all[v]
|
|
|
|
io.write ("\t\t".."<identity_name>"..thisIdentity.name.first_name.."</identity_name>".."\n")
|
|
|
|
io.write ("\t\t".."<identity_name>"..thisIdentity.name.first_name.."</identity_name>".."\n")
|
|
|
@ -405,6 +406,7 @@ function export_more_legends_xml()
|
|
|
|
else
|
|
|
|
else
|
|
|
|
io.write ("\t\t".."<identity_hf>"..df.global.world.identities.all[v].histfig_id.."</identity_hf>".."\n")
|
|
|
|
io.write ("\t\t".."<identity_hf>"..df.global.world.identities.all[v].histfig_id.."</identity_hf>".."\n")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
elseif event:getType() == df.history_event_type.MASTERPIECE_CREATED_ARCH_CONSTRUCT and k == "building_type" then
|
|
|
|
elseif event:getType() == df.history_event_type.MASTERPIECE_CREATED_ARCH_CONSTRUCT and k == "building_type" then
|
|
|
|
io.write ("\t\t".."<building_type>"..df.building_type[v]:lower().."</building_type>".."\n")
|
|
|
|
io.write ("\t\t".."<building_type>"..df.building_type[v]:lower().."</building_type>".."\n")
|
|
|
|
elseif event:getType() == df.history_event_type.MASTERPIECE_CREATED_ARCH_CONSTRUCT and k == "building_subtype" then
|
|
|
|
elseif event:getType() == df.history_event_type.MASTERPIECE_CREATED_ARCH_CONSTRUCT and k == "building_subtype" then
|
|
|
@ -523,10 +525,13 @@ function export_legends_info()
|
|
|
|
export_more_legends_xml()
|
|
|
|
export_more_legends_xml()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- presses 'd' for detailed maps
|
|
|
|
--- presses 'd' for detailed maps
|
|
|
|
function wait_for_legends_vs()
|
|
|
|
function wait_for_legends_vs()
|
|
|
|
local vs = dfhack.gui.getCurViewscreen()
|
|
|
|
local vs = dfhack.gui.getCurViewscreen()
|
|
|
|
if i <= #MAPS then
|
|
|
|
if i <= #MAPS then
|
|
|
|
|
|
|
|
if df.viewscreen_legendsst:is_instance(vs.parent) then
|
|
|
|
|
|
|
|
vs = vs.parent
|
|
|
|
|
|
|
|
end
|
|
|
|
if df.viewscreen_legendsst:is_instance(vs) then
|
|
|
|
if df.viewscreen_legendsst:is_instance(vs) then
|
|
|
|
gui.simulateInput(vs, 'LEGENDS_EXPORT_DETAILED_MAP')
|
|
|
|
gui.simulateInput(vs, 'LEGENDS_EXPORT_DETAILED_MAP')
|
|
|
|
dfhack.timeout(10,'frames',wait_for_export_maps_vs)
|
|
|
|
dfhack.timeout(10,'frames',wait_for_export_maps_vs)
|
|
|
@ -553,6 +558,9 @@ end
|
|
|
|
-- export site maps
|
|
|
|
-- export site maps
|
|
|
|
function export_site_maps()
|
|
|
|
function export_site_maps()
|
|
|
|
local vs = dfhack.gui.getCurViewscreen()
|
|
|
|
local vs = dfhack.gui.getCurViewscreen()
|
|
|
|
|
|
|
|
if ((dfhack.gui.getCurFocus() ~= "legends" ) and (not table.contains(vs, "main_cursor"))) then -- Using open-legends
|
|
|
|
|
|
|
|
vs = vs.parent
|
|
|
|
|
|
|
|
end
|
|
|
|
print(' Exporting: All possible site maps')
|
|
|
|
print(' Exporting: All possible site maps')
|
|
|
|
vs.main_cursor = 1
|
|
|
|
vs.main_cursor = 1
|
|
|
|
gui.simulateInput(vs, 'SELECT')
|
|
|
|
gui.simulateInput(vs, 'SELECT')
|
|
|
|