mirror of
https://gitlab.com/lunovox/computing.git
synced 2025-03-21 17:11:25 +00:00
This commit is contained in:
parent
39b03a41fa
commit
c5b1272dd5
3 changed files with 62 additions and 37 deletions
59
api.lua
59
api.lua
|
@ -95,18 +95,53 @@ modComputing.add_app = function(appname, def)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
modComputing.add_app_test = function(buttoname)
|
modComputing.add_test_apps = function()
|
||||||
modComputing.add_app(buttoname, {
|
if core.settings:get_bool(modComputing.modname..".debug") then
|
||||||
icon_name = buttoname,
|
modComputing.add_app("computing:btnMinetest", {
|
||||||
icon_type = "button_exit", --types: button/button_exit
|
icon_name = "btnMinetest",
|
||||||
icon_title = buttoname,
|
icon_type = "button", --types: button/button_exit
|
||||||
icon_descryption = "Exemplo de botão!",
|
icon_title = "MINETEST",
|
||||||
icon_image = "icon_smartphone_128x128.png",
|
icon_descryption = "Jogo de Voxel muito legal.",
|
||||||
--on_iconclick = modComputing.show_smartphone_config,
|
icon_image = "icon_smartphone_128x128.png",
|
||||||
on_iconclick = function()
|
--on_iconclick = modComputing.show_smartphone_config,
|
||||||
core.chat_send_all("Button '"..icon_title.."' pressed!")
|
on_iconclick = function()
|
||||||
end,
|
core.chat_send_all("Button 'btnMinetest' pressed!")
|
||||||
})
|
end,
|
||||||
|
})
|
||||||
|
modComputing.add_app("computing:btnDoom", {
|
||||||
|
icon_name = "btnDoom",
|
||||||
|
icon_type = "button", --types: button/button_exit
|
||||||
|
icon_title = "DOOM",
|
||||||
|
icon_descryption = "Jogo de tiro em primeira pessoa.",
|
||||||
|
icon_image = "icon_smartphone_128x128.png",
|
||||||
|
--on_iconclick = modComputing.show_smartphone_config,
|
||||||
|
on_iconclick = function()
|
||||||
|
core.chat_send_all("Button 'btnDoom' pressed!")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
modComputing.add_app("computing:btnMastodon", {
|
||||||
|
icon_name = "btnMastodon",
|
||||||
|
icon_type = "button", --types: button/button_exit
|
||||||
|
icon_title = "MASTODON",
|
||||||
|
icon_descryption = "Uma rede social muito legal.",
|
||||||
|
icon_image = "icon_smartphone_128x128.png",
|
||||||
|
--on_iconclick = modComputing.show_smartphone_config,
|
||||||
|
on_iconclick = function()
|
||||||
|
core.chat_send_all("Button 'btnMastodon' pressed!")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
modComputing.add_app("computing:btnLockPhone", {
|
||||||
|
icon_name = "btnLockPhone",
|
||||||
|
icon_type = "button_exit", --types: button/button_exit
|
||||||
|
icon_title = "LOCK",
|
||||||
|
icon_descryption = "Bloqueia tela do Smartphone.",
|
||||||
|
icon_image = "icon_smartphone_128x128.png",
|
||||||
|
--on_iconclick = modComputing.show_smartphone_config,
|
||||||
|
on_iconclick = function()
|
||||||
|
core.chat_send_all("Button 'btnMastodon' pressed!")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
modComputing.get_appnames = function()
|
modComputing.get_appnames = function()
|
||||||
|
|
18
init.lua
18
init.lua
|
@ -9,22 +9,6 @@ dofile(modComputing.modpath.."/functions.lua")
|
||||||
dofile(modComputing.modpath.."/item_smartphone.lua")
|
dofile(modComputing.modpath.."/item_smartphone.lua")
|
||||||
|
|
||||||
|
|
||||||
--[[
|
modComputing.add_test_apps()
|
||||||
local timeCount = 0
|
|
||||||
core.register_globalstep(function(dtime)
|
|
||||||
timeCount = timeCount + dtime
|
|
||||||
--modComputing.debug("[debug] core.register_globalstep() timeCount = "..timeCount)
|
|
||||||
if timeCount >= 5 then
|
|
||||||
timeCount = 0
|
|
||||||
--modComputing.debug("[debug] core.register_globalstep()")
|
|
||||||
modComputing.add_app_test()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
--]]
|
|
||||||
modComputing.add_app_test("CAFÉ")
|
|
||||||
modComputing.add_app_test("LEITE")
|
|
||||||
modComputing.add_app_test("SUCO")
|
|
||||||
modComputing.add_app_test("AÇUCAR")
|
|
||||||
|
|
||||||
|
|
||||||
core.log('action',"[MOD] "..modComputing.modname.." loaded!")
|
core.log('action',"[MOD] "..modComputing.modname.." loaded!")
|
||||||
|
|
|
@ -16,9 +16,9 @@ modComputing.getFormSmartphone = function(player)
|
||||||
.."size["..(10*271/484)..",10.0,true]"
|
.."size["..(10*271/484)..",10.0,true]"
|
||||||
.."no_prepend[]"
|
.."no_prepend[]"
|
||||||
.."bgcolor[#08080844;true]" --Padrão: #080808BB | true = 100% transparente
|
.."bgcolor[#08080844;true]" --Padrão: #080808BB | true = 100% transparente
|
||||||
.."style_type[label;font=mono;font_size=11;textcolor=#FFFFFF]"
|
.."style_type[label;font=mono;font_size=10;textcolor=#FFFFFF]"
|
||||||
.."style_type[image_button;font=normal;font_size=14;textcolor=#FFFFFF]"
|
.."style_type[image_button;font=normal;font_size=11;textcolor=#FFFFFF]"
|
||||||
.."style_type[image_button_exit;font=normal;font_size=14;textcolor=#FFFFFF]"
|
.."style_type[image_button_exit;font=normal;font_size=11;textcolor=#FFFFFF]"
|
||||||
--.."background[-0.75,-2.00;"..(10*271/484)..",10.0;text_smartphone_271x484.png;true]"
|
--.."background[-0.75,-2.00;"..(10*271/484)..",10.0;text_smartphone_271x484.png;true]"
|
||||||
.."image[0,0;"..(10*271/484)..",10.0;text_smartphone_271x484.png;true]"
|
.."image[0,0;"..(10*271/484)..",10.0;text_smartphone_271x484.png;true]"
|
||||||
.."label[0.75,1.975;"..core.formspec_escape(modComputing.getTextClockBar()).."]"
|
.."label[0.75,1.975;"..core.formspec_escape(modComputing.getTextClockBar()).."]"
|
||||||
|
@ -57,7 +57,13 @@ modComputing.getFormSmartphone = function(player)
|
||||||
|
|
||||||
--SAMPLE: image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>;<noclip>;<drawborder>;<pressed texture name>]
|
--SAMPLE: image_button[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>;<noclip>;<drawborder>;<pressed texture name>]
|
||||||
--SAMPLE: image_button_exit[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]
|
--SAMPLE: image_button_exit[<X>,<Y>;<W>,<H>;<texture name>;<name>;<label>]
|
||||||
local newToolTip = "tooltip["..core.formspec_escape("btn_"..icon_name)..";"..core.formspec_escape(icon_title.."\n * "..icon_descryption)..";#008800;#FFFFFF]"
|
local newToolTip = "tooltip["..core.formspec_escape("btn_"..icon_name)..";"
|
||||||
|
..core.formspec_escape(
|
||||||
|
core.colorize("#00FF00", icon_title).."\n"
|
||||||
|
.."* "..icon_descryption
|
||||||
|
)
|
||||||
|
..";#004400;#FFFFFF"
|
||||||
|
.."]"
|
||||||
|
|
||||||
local newButton = core.formspec_escape("image_"..icon_type).."["
|
local newButton = core.formspec_escape("image_"..icon_type).."["
|
||||||
..(offSetX + (iconCol * sizeButtonX))..","
|
..(offSetX + (iconCol * sizeButtonX))..","
|
||||||
|
@ -65,11 +71,11 @@ modComputing.getFormSmartphone = function(player)
|
||||||
..";1.5,1.5;"
|
..";1.5,1.5;"
|
||||||
..core.formspec_escape(icon_image)..";" --texture name
|
..core.formspec_escape(icon_image)..";" --texture name
|
||||||
..core.formspec_escape("btn_"..icon_name)..";" --button name
|
..core.formspec_escape("btn_"..icon_name)..";" --button name
|
||||||
|
--..";" --label empty
|
||||||
--..core.formspec_escape(appname).." "..iconRow.."/"..iconCol.."\n"..core.formspec_escape("page:"..page.."\ninpg:"..iconInPage)..";" --label
|
--..core.formspec_escape(appname).." "..iconRow.."/"..iconCol.."\n"..core.formspec_escape("page:"..page.."\ninpg:"..iconInPage)..";" --label
|
||||||
--..core.formspec_escape(icon_title)..";" --label
|
..core.formspec_escape(icon_title)..";" --label
|
||||||
..";" --label empty
|
.."true;" --NOCLIP
|
||||||
.."false;" --NOCLIP
|
.."false;" --drawborder
|
||||||
.."true;" --drawborder
|
|
||||||
..core.formspec_escape(icon_image.."^[invert:rgb") --pressed texture name
|
..core.formspec_escape(icon_image.."^[invert:rgb") --pressed texture name
|
||||||
.."]"
|
.."]"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue