From e228358ba93912c11d87db320710a5c8f1d579cb Mon Sep 17 00:00:00 2001 From: Alex Pang Date: Sat, 31 Oct 2020 00:13:19 -0400 Subject: [PATCH] Save the initialized state in the save game. --- hooks/load.lua | 9 ++++----- init.lua | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hooks/load.lua b/hooks/load.lua index c7342cb..d610867 100644 --- a/hooks/load.lua +++ b/hooks/load.lua @@ -1,10 +1,9 @@ -- load.lua local EscortRewards = require("mod.class.EscortRewards") -local initialized = false class:bindHook("EscortRewards:givers", function(self,data) - if not initialized then + if not game.state.initialized_sye then return data end @@ -41,7 +40,7 @@ class:bindHook("ToME:birthDone", function(self, data) local escort_choices = initEscortChoices(possible_escorts) game.state.escortNum = 1 - initialized = true + game.state.initialized_sye = true local Chat = require "engine.Chat" local chat = Chat.new("escort-select", { name = "Select your Escorts!" }, game.player, @@ -73,7 +72,7 @@ class:bindHook("Game:alterGameMenu", function(self, data) return end - initialized = false + game.state.initialized_sye = false local possible_escorts = EscortRewards:listGivers() local escort_choices = initEscortChoices(possible_escorts) @@ -88,7 +87,7 @@ class:bindHook("Game:alterGameMenu", function(self, data) game.state.escort_selection_counts[game.state.escort_selections[i]] = game.state.escort_selection_counts[game.state.escort_selections[i]] + 1 end - initialized = true + game.state.initialized_sye = true local chat = Chat.new("escort-select", { name = "Select your Escorts!" }, diff --git a/init.lua b/init.lua index 967c962..9985685 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,7 @@ long_name = "Select your Escorts" short_name = "select-your-escorts" -- Determines the name of your addon's file. for_module = "tome" version = {1,7,0} -addon_version = {2,3,0} +addon_version = {2,3,1} weight = 512 -- The lower this value, the sooner your addon will load compared to other addons. author = {'Pseudoku'} homepage = 'https://steamcommunity.com/id/Pseudoku/home'