diff --git a/game/engines/default/modules/boot/dialogs/NewGame.lua b/game/engines/default/modules/boot/dialogs/NewGame.lua index 79898cbbd1827ce528ec1371e32afa82d39f9b6c..927119643011831711f2a42b09b897466256434f 100644 --- a/game/engines/default/modules/boot/dialogs/NewGame.lua +++ b/game/engines/default/modules/boot/dialogs/NewGame.lua @@ -60,6 +60,13 @@ function _M:init() } end +function _M:on_register() + if #self.list == 1 then + game:unregisterDialog(self) + self.list[1]:fct() + end +end + function _M:select(item) if item and self.uis[2] then self.uis[2].ui = item.zone @@ -72,7 +79,7 @@ function _M:generateList() for i = 1, #list do for j, mod in ipairs(list[i].versions) do if not self.c_switch.checked and j > 1 then break end - if not mod.is_boot then + if not mod.is_boot and (not mod.show_only_on_cheat or config.settings.cheat) then mod.name = tstring{{"font","bold"}, {"color","GOLD"}, mod.name, {"font","normal"}} mod.fct = function(mod) if mod.no_get_name then diff --git a/game/modules/example/init.lua b/game/modules/example/init.lua index e05737e268b974d000820ceeb64893fe001cbc88..470117037d9ecb080b7335540d5491e556ae32ff 100644 --- a/game/modules/example/init.lua +++ b/game/modules/example/init.lua @@ -28,3 +28,4 @@ description = [[ This is *NOT* a game, just an example/template to make your own using the T-Engine4. ]] starter = "mod.load" +show_only_on_cheat = true -- Example modules are not shown to normal players diff --git a/game/modules/example_realtime/class/Game.lua b/game/modules/example_realtime/class/Game.lua index 49135867c7857f69a6aec932fa6101077588ca03..d9c281569696e9e2f6650df4c97ec0d319059696 100644 --- a/game/modules/example_realtime/class/Game.lua +++ b/game/modules/example_realtime/class/Game.lua @@ -202,7 +202,7 @@ function _M:onTurn() self.level.map:processEffects() end -function _M:display() +function _M:display(nb_keyframe) -- If switching resolution, blank everything but the dialog if self.change_res_dialog then engine.GameEnergyBased.display(self, nb_keyframe) return end diff --git a/game/modules/example_realtime/init.lua b/game/modules/example_realtime/init.lua index c63b77eb9316a602a7ec29a7a34c72f45c85a25b..df254ce55136d1aad485f45a76d3415d0e0abc76 100644 --- a/game/modules/example_realtime/init.lua +++ b/game/modules/example_realtime/init.lua @@ -28,3 +28,4 @@ description = [[ This is *NOT* a game, just an example/template to make your own using the T-Engine4. ]] starter = "mod.load" +show_only_on_cheat = true -- Example modules are not shown to normal players