Skip to content

Instantly share code, notes, and snippets.

@tobylane
Created February 14, 2018 15:24
Show Gist options
  • Save tobylane/18b2c04ef9653cc34293282be2022dc1 to your computer and use it in GitHub Desktop.
Save tobylane/18b2c04ef9653cc34293282be2022dc1 to your computer and use it in GitHub Desktop.
Close all dialogs not in demo when opening a full game savefile
if old.demo and not TheApp.using_demo_files then
print("Using savegame from demo on full game")
-- Enable advisor to help with research
elseif old.demo and not TheApp.using_demo_files then
print("Using savegame from full game on demo")
-- Close dialogs not in demo
if old.window.open then
for _, v in pairs({ "dialogBankManager", "dialogBankStats", "dialogTownMap",
"dialogDrugCasebook", "dialogResearch","dialogStatus", "dialogCharts", "dialogPolicy" }) do
if old.window.v.open then
new.window.v:close()
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment