Commit 8d6bc60f0be1f592020dbbaff11b63abadb9cced

Authored by DarkGod
1 parent adcbd294

New Game option will show the module list if there are incompatible modules found

@@ -62,7 +62,7 @@ function _M:init() @@ -62,7 +62,7 @@ function _M:init()
62 end 62 end
63 63
64 function _M:on_register() 64 function _M:on_register()
65 - if #self.list == 1 then 65 + if #self.list == 1 and not self.has_incompatible then
66 game:unregisterDialog(self) 66 game:unregisterDialog(self)
67 self.list[1]:fct() 67 self.list[1]:fct()
68 end 68 end
@@ -75,8 +75,9 @@ function _M:select(item) @@ -75,8 +75,9 @@ function _M:select(item)
75 end 75 end
76 76
77 function _M:generateList() 77 function _M:generateList()
78 - local list = Module:listModules(self.c_compat.checked) 78 + local list = Module:listModules(true)
79 self.list = {} 79 self.list = {}
  80 + self.has_incompatible = false
80 for i = 1, #list do 81 for i = 1, #list do
81 for j, mod in ipairs(list[i].versions) do 82 for j, mod in ipairs(list[i].versions) do
82 if not self.c_switch.checked and j > 1 then break end 83 if not self.c_switch.checked and j > 1 then break end
@@ -105,7 +106,10 @@ function _M:generateList() @@ -105,7 +106,10 @@ function _M:generateList()
105 tstr:merge(mod.description:toTString()) 106 tstr:merge(mod.description:toTString())
106 mod.zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=tstr} 107 mod.zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=tstr}
107 108
108 - table.insert(self.list, mod) 109 + if self.c_compat.checked or not mod.incompatible then
  110 + table.insert(self.list, mod)
  111 + end
  112 + if mod.incompatible then self.has_incompatible = true end
109 end 113 end
110 end 114 end
111 end 115 end
@@ -22,8 +22,8 @@ long_name = "Example Module for T-Engine4" @@ -22,8 +22,8 @@ long_name = "Example Module for T-Engine4"
22 short_name = "example" 22 short_name = "example"
23 author = { "DarkGod", "darkgod@te4.org" } 23 author = { "DarkGod", "darkgod@te4.org" }
24 homepage = "http://te4.org/modules:example" 24 homepage = "http://te4.org/modules:example"
25 -version = {1,1,0}  
26 -engine = {1,1,0,"te4"} 25 +version = {1,1,2}
  26 +engine = {1,1,2,"te4"}
27 description = [[ 27 description = [[
28 This is *NOT* a game, just an example/template to make your own using the T-Engine4. 28 This is *NOT* a game, just an example/template to make your own using the T-Engine4.
29 ]] 29 ]]
@@ -22,8 +22,8 @@ long_name = "Realtime Example Module for T-Engine4" @@ -22,8 +22,8 @@ long_name = "Realtime Example Module for T-Engine4"
22 short_name = "example_realtime" 22 short_name = "example_realtime"
23 author = { "DarkGod", "darkgod@te4.org" } 23 author = { "DarkGod", "darkgod@te4.org" }
24 homepage = "http://te4.org/modules:example" 24 homepage = "http://te4.org/modules:example"
25 -version = {1,0,6}  
26 -engine = {1,0,6,"te4"} 25 +version = {1,1,2}
  26 +engine = {1,1,2,"te4"}
27 description = [[ 27 description = [[
28 This is *NOT* a game, just an example/template to make your own using the T-Engine4. 28 This is *NOT* a game, just an example/template to make your own using the T-Engine4.
29 ]] 29 ]]