builtin/client_lib_test, games/test: Test require("buildat/module/<name>")
This commit is contained in:
parent
fb51bc6cbe
commit
1e767a11f5
19
builtin/client_lib_test/client_lua/module.lua
Normal file
19
builtin/client_lib_test/client_lua/module.lua
Normal file
@ -0,0 +1,19 @@
|
||||
-- Buildat: builtin/client_lib_test/client_lua/module.lua
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
-- Copyright 2014 Perttu Ahola <celeron55@gmail.com>
|
||||
local log = buildat.Logger("client_lib_test")
|
||||
local magic = require("buildat/extension/urho3d")
|
||||
local M = {}
|
||||
|
||||
function M.f()
|
||||
log:info("client_lib_test.f() called")
|
||||
local text = magic.ui.root:CreateChild("Text")
|
||||
text:SetText("client_lib_test.f() called")
|
||||
text:SetFont(magic.cache:GetResource("Font", "Fonts/Anonymous Pro.ttf"), 15)
|
||||
text.horizontalAlignment = magic.HA_RIGHT
|
||||
text.verticalAlignment = magic.VA_CENTER
|
||||
text:SetPosition(-20, magic.ui.root.height/2-20)
|
||||
end
|
||||
|
||||
return M
|
||||
-- vim: set noet ts=4 sw=4:
|
7
builtin/client_lib_test/meta.json
Normal file
7
builtin/client_lib_test/meta.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"disable_cpp": true,
|
||||
"dependencies": [
|
||||
{"module": "client_lua"},
|
||||
{"module": "client_data"}
|
||||
]
|
||||
}
|
@ -5,7 +5,7 @@ local log = buildat.Logger("test1")
|
||||
local dump = buildat.dump
|
||||
local cereal = require("buildat/extension/cereal")
|
||||
local magic = require("buildat/extension/urho3d")
|
||||
log:info("test1/init.lua loaded")
|
||||
local client_lib_test = require("buildat/module/client_lib_test")
|
||||
|
||||
-- 3D things
|
||||
|
||||
@ -55,6 +55,10 @@ title_text.horizontalAlignment = magic.HA_CENTER
|
||||
title_text.verticalAlignment = magic.VA_CENTER
|
||||
title_text:SetPosition(0, magic.ui.root.height*(-0.33))
|
||||
|
||||
-- Call client_lib_test module
|
||||
-- This adds some text to the bottom right corner
|
||||
client_lib_test.f()
|
||||
|
||||
the_box = nil
|
||||
|
||||
buildat.sub_packet("test1:add_box", function(data)
|
||||
|
@ -3,6 +3,7 @@
|
||||
{"module": "network"},
|
||||
{"module": "client_lua"},
|
||||
{"module": "client_data"},
|
||||
{"module": "client_lib_test"},
|
||||
{"module": "foobar", "optional": true}
|
||||
],
|
||||
"reverse_dependencies": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user