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

Weather disable option

git-svn-id: http://svn.net-core.org/repos/t-engine4@2596 51575b47-30f0-44d4-a5cc-537603b46e54
parent 975e9f87
No related branches found
No related tags found
No related merge requests found
......@@ -434,6 +434,8 @@ end
-- Weather stuff
--------------------------------------------------------------------
function _M:makeWeather(level, nb, params, typ)
if not config.settings.tome.weather_effects then return end
local ps = {}
params.width = level.map.w*level.map.tile_w
params.height = level.map.h*level.map.tile_h
......
......@@ -78,17 +78,19 @@ return {
},
post_process = function(level)
-- Place a lore note on each level
game:placeRandomLoreObject("NOTE"..level.level)
if not config.settings.tome.weather_effects then return end
local Map = require "engine.Map"
level.foreground_particle = require("engine.Particles").new("raindrops", 1, {width=Map.viewport.width, height=Map.viewport.height})
game.state:makeWeather(level, 6, {max_nb=3, chance=1, dir=110, speed={0.1, 0.6}, alpha={0.3, 0.5}, particle_name="weather/dark_cloud_%02d"})
-- Place a lore note on each level
game:placeRandomLoreObject("NOTE"..level.level)
end,
foreground = function(level, x, y, nb_keyframes)
local Map = require "engine.Map"
if not config.settings.tome.weather_effects or not level.foreground_particle then return end
level.foreground_particle.ps:toScreen(x, y, true, 1)
end,
}
......@@ -101,5 +101,14 @@ function _M:generateList()
end))
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Enables or disables weather effects in some zones.\nDisabling it can gain some performance, it will not affect previously visited zones.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Weather effects#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.weather_effects and "enabled" or "disabled")
end, fct=function(item)
config.settings.tome.weather_effects = not config.settings.tome.weather_effects
game:saveSettings("tome.weather_effects", ("tome.weather_effects = %s\n"):format(tostring(config.settings.tome.weather_effects)))
self.c_list:drawItem(item)
end,}
self.list = list
end
......@@ -185,6 +185,7 @@ end
if type(config.settings.tome.autosave) == "nil" then config.settings.tome.autosave = true end
if not config.settings.tome.smooth_move then config.settings.tome.smooth_move = 3 end
if not config.settings.tome.gfx then config.settings.tome.gfx = {size="32x32", tiles="mushroom"} end
if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome.weather_effects = true end
Map.smooth_scroll = config.settings.tome.smooth_move
return {require "mod.class.Game", require "mod.class.World"}
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