Skip to content

Commit

Permalink
Merge pull request #8 from pangyikhei/7-save-init-state
Browse files Browse the repository at this point in the history
Save the initialized state in the save game.
  • Loading branch information
pangyikhei authored Oct 31, 2020
2 parents 0ff7894 + e228358 commit a693b7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions hooks/load.lua
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand All @@ -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!" },
Expand Down
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit a693b7d

Please sign in to comment.