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

Example modules only show up in the list if cheat mode is enabled

If modules list only contains one entry it is auto selected


git-svn-id: http://svn.net-core.org/repos/t-engine4@3619 51575b47-30f0-44d4-a5cc-537603b46e54
parent fa9b6e71
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,13 @@ function _M:init() ...@@ -60,6 +60,13 @@ function _M:init()
} }
end end
function _M:on_register()
if #self.list == 1 then
game:unregisterDialog(self)
self.list[1]:fct()
end
end
function _M:select(item) function _M:select(item)
if item and self.uis[2] then if item and self.uis[2] then
self.uis[2].ui = item.zone self.uis[2].ui = item.zone
...@@ -72,7 +79,7 @@ function _M:generateList() ...@@ -72,7 +79,7 @@ function _M:generateList()
for i = 1, #list do for i = 1, #list do
for j, mod in ipairs(list[i].versions) do for j, mod in ipairs(list[i].versions) do
if not self.c_switch.checked and j > 1 then break end 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.name = tstring{{"font","bold"}, {"color","GOLD"}, mod.name, {"font","normal"}}
mod.fct = function(mod) mod.fct = function(mod)
if mod.no_get_name then if mod.no_get_name then
......
...@@ -28,3 +28,4 @@ description = [[ ...@@ -28,3 +28,4 @@ description = [[
This is *NOT* a game, just an example/template to make your own using the T-Engine4. This is *NOT* a game, just an example/template to make your own using the T-Engine4.
]] ]]
starter = "mod.load" starter = "mod.load"
show_only_on_cheat = true -- Example modules are not shown to normal players
...@@ -202,7 +202,7 @@ function _M:onTurn() ...@@ -202,7 +202,7 @@ function _M:onTurn()
self.level.map:processEffects() self.level.map:processEffects()
end end
function _M:display() function _M:display(nb_keyframe)
-- If switching resolution, blank everything but the dialog -- If switching resolution, blank everything but the dialog
if self.change_res_dialog then engine.GameEnergyBased.display(self, nb_keyframe) return end if self.change_res_dialog then engine.GameEnergyBased.display(self, nb_keyframe) return end
......
...@@ -28,3 +28,4 @@ description = [[ ...@@ -28,3 +28,4 @@ description = [[
This is *NOT* a game, just an example/template to make your own using the T-Engine4. This is *NOT* a game, just an example/template to make your own using the T-Engine4.
]] ]]
starter = "mod.load" starter = "mod.load"
show_only_on_cheat = true -- Example modules are not shown to normal players
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