Skip to content
Snippets Groups Projects
Commit f2e7a7aa authored by DarkGod's avatar DarkGod
Browse files

The New Game menu shows a link to additional games

parent d93394ad
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,12 @@ function _M:generate()
return "PLAP"
end
self.custom_calls._nextDownloadName = function(name)
if name then self._next_download_name = {name=name, time=os.time()}
else self._next_download_name = nil
end
end
for name, fct in pairs(self.custom_calls) do
handlers[name] = fct
self.view:setMethod(name)
......@@ -170,7 +176,9 @@ function _M:onDownload(handlers)
if mime == "application/t-engine-addon" and self.allow_downloads.addons and url:find("^http://te4%.org/") then
local path = fs.getRealPath("/addons/")
if path then
Dialog:yesnoPopup("Confirm addon install/update", "Are you sure you want to install this addon? ("..file..")", function(ret)
local name = file
if self._next_download_name and os.time() - self._next_download_name.time <= 3 then name = self._next_download_name.name self._next_download_name = nil end
Dialog:yesnoPopup("Confirm addon install/update", "Are you sure you want to install this addon: #LIGHT_GREEN##{bold}#"..name.."#{normal}##LAST# ?", function(ret)
if ret then
print("Accepting addon download to:", path..file)
self.download_dialog = self:makeDownloadbox(downid, file)
......@@ -186,7 +194,9 @@ function _M:onDownload(handlers)
elseif mime == "application/t-engine-module" and self.allow_downloads.modules and url:find("^http://te4%.org/") then
local path = fs.getRealPath("/modules/")
if path then
Dialog:yesnoPopup("Confirm module install/update", "Are you sure you want to install this module? ("..file..")", function(ret)
local name = file
if self._next_download_name and os.time() - self._next_download_name.time <= 3 then name = self._next_download_name.name self._next_download_name = nil end
Dialog:yesnoPopup("Confirm module install/update", "Are you sure you want to install this module: #LIGHT_GREEN##{bold}#"..name.."#{normal}##LAST# ?", function(ret)
if ret then
print("Accepting module download to:", path..file)
self.download_dialog = self:makeDownloadbox(downid, file)
......
......@@ -36,9 +36,11 @@ function _M:init()
self.c_switch = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show all versions", on_change=function() self:switch() end}
self.c_compat = Checkbox.new{default=false, width=math.floor(self.iw / 3 - 40), title="Show incompatible", on_change=function() self:switch() end}
local url = Textzone.new{text="You can get new games at #LIGHT_BLUE##{underline}#http://te4.org/games#{normal}#", auto_height=true, auto_width=true, fct=function() util.browserOpenUrl("http://te4.org/games") end}
self:generateList()
self.c_list = ListColumns.new{width=math.floor(self.iw / 3 - 10), height=self.ih - 10 - self.c_switch.h - self.c_compat.h, scrollbar=true, columns={
self.c_list = ListColumns.new{width=math.floor(self.iw / 3 - 10), height=self.ih - 10 - self.c_switch.h - self.c_compat.h - url.h, scrollbar=true, columns={
{name="Game Module", width=80, display_prop="name"},
{name="Version", width=20, display_prop="version_txt"},
}, list=self.list, fct=function(item) end, select=function(item, sel) self:select(item) end}
......@@ -47,8 +49,9 @@ function _M:init()
self:loadUI{
{left=0, top=0, ui=self.c_list},
{left=self.c_list.w+sep.w, top=0, ui=self.c_desc},
{left=0, bottom=self.c_compat.h, ui=self.c_switch},
{left=0, bottom=0, ui=self.c_compat},
{left=0, bottom=url.h+self.c_compat.h, ui=self.c_switch},
{left=0, bottom=url.h, ui=self.c_compat},
{left=0, bottom=0, ui=url},
{left=self.c_list.w + 5, top=5, ui=sep},
}
self:setFocus(self.c_list)
......
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