Skip to content
Snippets Groups Projects
Commit 27173547 authored by dg's avatar dg
Browse files

Main menu will not consume ressources if background anim is disabled

git-svn-id: http://svn.net-core.org/repos/t-engine4@2362 51575b47-30f0-44d4-a5cc-537603b46e54
parent 1fd9ae8c
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,11 @@ function _M:init()
-- self.refuse_threads = true
self.normal_key = self.key
self.stopped = config.settings.boot_menu_background
if self.stopped then
core.game.setRealtime(0)
else
core.game.setRealtime(8)
end
self:loaded()
end
......@@ -213,7 +218,7 @@ function _M:updateNews()
end
function _M:tick()
if self.stopped then engine.Game.tick(self) return false end
if self.stopped then engine.Game.tick(self) return true end
if self.level then
engine.GameEnergyBased.tick(self)
-- Fun stuff: this can make the game realtime, although calling it in display() will make it work better
......
......@@ -72,6 +72,12 @@ function _M:switchBackground()
game:saveSettings("boot_menu_background", ("boot_menu_background = %s\n"):format(tostring(game.stopped)))
self.c_background.text = game.stopped and "Enable background" or "Disable background"
self.c_background:generate()
if game.stopped then
core.game.setRealtime(0)
else
core.game.setRealtime(8)
end
end
function _M:on_recover_focus()
......
......@@ -58,7 +58,7 @@ ActorAI:loadDefinition("/mod/ai/")
-- Birther descriptor
Birther:loadDefinition("/data/birth/descriptors.lua")
-- Switch to realtime, with 10 ticks per second
-- Switch to realtime, with 8 ticks per second
core.game.setRealtime(8)
return {require "mod.class.Game" }
......@@ -71,8 +71,7 @@ newEntity{ define_as = "MELINDA",
name = "Melinda",
type = "humanoid", subtype = "human", female=true,
display = "@", color=colors.LIGHT_BLUE,
desc = [[A female Human lying unconscious on a black altar, twisted sigils scored into her naked flesh.
You can discern great beauty under the stains of blood covering her skin.]],
desc = [[A female Human with twisted sigils scored into her naked flesh. Her wrists and ankles are sore and hurt by ropes and chains. You can discern great beauty beyond the stains of blood covering her skin.]],
autolevel = "tank",
ai = "summoned", ai_real = "move_dmap", ai_state = { ai_target="target_player", talent_in=4, },
stats = { str=8, dex=7, mag=8, con=12 },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment