Skip to content

Commit

Permalink
update lua config
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Aug 22, 2024
1 parent 11a8cdb commit c6f314b
Show file tree
Hide file tree
Showing 46 changed files with 32,076 additions and 20,510 deletions.
27 changes: 25 additions & 2 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
{
"diagnostics.disable": ["redundant-return-value", "lowercase-global"],
"diagnostics.disable": ["redundant-return-value"],
"workspace.library": ["addons"],
"workspace.ignoreSubmodules": false
"workspace.ignoreDir": [
"tools/lua-bindings/olua/examples/lua",
"frameworks/3rd/"
],
"workspace.ignoreSubmodules": false,
"diagnostics.globals": [
"main",
"api_dir",
"autoconf",
"clang",
"codeblock",
"entry",
"exclude_type",
"headers",
"import",
"luacls",
"luaopen",
"macro",
"olua",
"output_dir",
"typeconf",
"typedef",
"typeonly"
]
}
15 changes: 14 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "lua",
"request": "launch",
"name": "build-binding",
"windows": {
"luaexe": "lua.exe"
},
"osx": {
"luaexe": "lua"
},
"stopOnEntry": false,
"cwd": "${workspaceFolder}/tools/lua-bindings",
"program": "build.lua"
},
{
"name": "LuaDebug",
"program": "",
Expand Down
2 changes: 1 addition & 1 deletion assets/src/cclua/ui/FGUINode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end

function FGUINode.Get:cobj()
local width, height = window.getVisibleSize()
local cobj = Scene.createWithSize(Size{width = width, height = height})
local cobj = Scene.createWithSize(Size.new(width, height))
rawset(self, 'cobj', cobj)
return cobj
end
Expand Down
2 changes: 1 addition & 1 deletion assets/src/cclua/ui/UIScene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end

function UIScene.Get:cobj()
local width, height = window.getVisibleSize()
local cobj = Scene.createWithSize(Size{width = width, height = height})
local cobj = Scene.createWithSize(Size.new(width, height))
rawset(self, 'cobj', cobj)
return cobj
end
Expand Down
3 changes: 2 additions & 1 deletion assets/src/cclua/ui/UITextField.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local font = require "cclua.font"
local Align = require "cclua.ui.Align"
local UIView = require "cclua.ui.UIView"
local Label = require "cc.Label"
local Size = require "cc.Size"
local TTFConfig = require "cc.TTFConfig"
local GlyphCollection = require "cc.GlyphCollection"

Expand Down Expand Up @@ -53,7 +54,7 @@ function UITextField:enableShadow(color, offsetX, offsetY, blurRadius)
offsetX = offsetX or 2
offsetY = offsetY or -2
blurRadius = blurRadius or 0
self.cobj:enableShadow(color, {width = offsetX, height = offsetY}, blurRadius)
self.cobj:enableShadow(color, Size.new(offsetX, offsetY), blurRadius)
end

function UITextField.Get:width(value)
Expand Down
4 changes: 2 additions & 2 deletions assets/src/cclua/ui/UITextInput.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local Layout = require "ccui.Layout"
local EditBox = require "ccui.EditBox"
local Scale9Sprite = require "ccui.Scale9Sprite"
local EditBoxDelegate = require "ccui.LuaEditBoxDelegate"
local Size = require "cc.Size"

local UITextInput = class("UITextInput", UIView)

Expand All @@ -30,8 +31,7 @@ function UITextInput.Get:cobj()
cobj.touchEnabled = false
rawset(self, "cobj", cobj)

local label = EditBox.create({width = 10, height = 10},
Scale9Sprite.create(), nil, nil)
local label = EditBox.create(Size.new(10, 10), Scale9Sprite.create(), nil, nil)
label.touchEnabled = false
label.ignoreAnchorPointForPosition = true
cobj:addChild(label, 0)
Expand Down
4 changes: 2 additions & 2 deletions assets/src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ function main()
local Console = require('system.console.Console')
cclua.stage:addChild(Console.new())

cclua.startScene('test.SpineTest')
-- cclua.startScene('test.FGUITest')
-- cclua.startScene('test.SpineTest')
cclua.startScene('test.FGUITest')
end
Loading

0 comments on commit c6f314b

Please sign in to comment.