mirror of
https://gitlab.com/lunovox/computing.git
synced 2025-03-21 17:11:25 +00:00
This commit is contained in:
parent
4ed0f8dd4e
commit
86b3a3df21
2 changed files with 8 additions and 4 deletions
5
api.lua
5
api.lua
|
@ -56,6 +56,7 @@ modComputing.add_app = function(appname, def)
|
||||||
icon_descryption = def.icon_descryption,
|
icon_descryption = def.icon_descryption,
|
||||||
icon_type = def.icon_type,
|
icon_type = def.icon_type,
|
||||||
icon_image = def.icon_image,
|
icon_image = def.icon_image,
|
||||||
|
is_visible = def.is_visible or true,
|
||||||
on_iconclick = def.on_iconclick,
|
on_iconclick = def.on_iconclick,
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
@ -96,6 +97,7 @@ modComputing.add_app = function(appname, def)
|
||||||
end
|
end
|
||||||
|
|
||||||
modComputing.add_test_apps = function()
|
modComputing.add_test_apps = function()
|
||||||
|
--[[
|
||||||
if core.settings:get_bool(modComputing.modname..".debug") then
|
if core.settings:get_bool(modComputing.modname..".debug") then
|
||||||
modComputing.add_app("computing:btnMinetest", {
|
modComputing.add_app("computing:btnMinetest", {
|
||||||
icon_name = "btnMinetest",
|
icon_name = "btnMinetest",
|
||||||
|
@ -141,7 +143,8 @@ modComputing.add_test_apps = function()
|
||||||
core.chat_send_all("Button 'btnLockPhone' pressed!")
|
core.chat_send_all("Button 'btnLockPhone' pressed!")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
--[[ ]]
|
||||||
end
|
end
|
||||||
|
|
||||||
modComputing.get_appnames = function()
|
modComputing.get_appnames = function()
|
||||||
|
|
|
@ -40,6 +40,7 @@ modComputing.smartphone.getFormBackground = function()
|
||||||
.."label[0.75,1.975;"..core.formspec_escape(modComputing.getTextClockBar()).."]"
|
.."label[0.75,1.975;"..core.formspec_escape(modComputing.getTextClockBar()).."]"
|
||||||
return formspec
|
return formspec
|
||||||
end
|
end
|
||||||
|
|
||||||
modComputing.smartphone.getAppListConteiner = function(player)
|
modComputing.smartphone.getAppListConteiner = function(player)
|
||||||
local playername = player:get_player_name()
|
local playername = player:get_player_name()
|
||||||
local formspec = ""
|
local formspec = ""
|
||||||
|
@ -74,14 +75,14 @@ modComputing.smartphone.getAppListConteiner = function(player)
|
||||||
local icon_type = apps[v].icon_type
|
local icon_type = apps[v].icon_type
|
||||||
local icon_image = apps[v].icon_image
|
local icon_image = apps[v].icon_image
|
||||||
local on_iconclick = apps[v].on_iconclick
|
local on_iconclick = apps[v].on_iconclick
|
||||||
local is_visible = apps[v].is_visible or true
|
local is_visible = apps[v].is_visible
|
||||||
|
--modComputing.debug("apps = "..dump(apps) --[[, playername--]])
|
||||||
|
--modComputing.debug("is_visible = "..dump(is_visible) --[[, playername--]])
|
||||||
|
|
||||||
if (type(is_visible)=="boolean" and is_visible == true)
|
if (type(is_visible)=="boolean" and is_visible == true)
|
||||||
or (type(is_visible)=="function" and is_visible(player))
|
or (type(is_visible)=="function" and is_visible(player))
|
||||||
then
|
then
|
||||||
|
|
||||||
appsCount = appsCount + 1
|
appsCount = appsCount + 1
|
||||||
--modComputing.debug("apps = "..dump(apps) --[[, playername--]])
|
|
||||||
local page = math.floor((appsCount - 1) / (maxRow * maxCol)) --math.floor : arredonda sempre para menos
|
local page = math.floor((appsCount - 1) / (maxRow * maxCol)) --math.floor : arredonda sempre para menos
|
||||||
if page == modComputing.show_page[playername] then
|
if page == modComputing.show_page[playername] then
|
||||||
local iconInPage = appsCount - math.floor(page * maxRow * maxCol)
|
local iconInPage = appsCount - math.floor(page * maxRow * maxCol)
|
||||||
|
|
Loading…
Add table
Reference in a new issue