Script.luaを簡潔に (#242)
* Script.luaを簡潔に * Keep documentation for function calls on Background Lua scripts Co-authored-by: 0auBSQ <58159635+0auBSQ@users.noreply.github.com>
This commit is contained in:
parent
f4adbf41b5
commit
1aca9a7a60
@ -86,8 +86,14 @@ namespace TJAPlayer3
|
||||
|
||||
|
||||
|
||||
|
||||
LuaScript.DoFile(filePath);
|
||||
using (var streamAPI = new StreamReader("BGScriptAPI.lua", Encoding.UTF8))
|
||||
{
|
||||
using (var stream = new StreamReader(filePath, Encoding.UTF8))
|
||||
{
|
||||
var text = $"{streamAPI.ReadToEnd()}\n{stream.ReadToEnd()}";
|
||||
LuaScript.DoString(text);
|
||||
}
|
||||
}
|
||||
|
||||
LuaUpdateValues = LuaScript.GetFunction("updateValues");
|
||||
LuaClearIn = LuaScript.GetFunction("clearIn");
|
||||
|
12
Test/BGScriptAPI.lua
Normal file
12
Test/BGScriptAPI.lua
Normal file
@ -0,0 +1,12 @@
|
||||
local fps = 0
|
||||
local deltaTime = 0
|
||||
local isClear = { false, false }
|
||||
local towerNightNum = 0
|
||||
|
||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||
deltaTime = _deltaTime
|
||||
fps = _fps
|
||||
isClear = _isClear
|
||||
towerNightNum = _towerNightNum
|
||||
deltaTime = _deltaTime
|
||||
end
|
@ -1,16 +1,3 @@
|
||||
local fps = 0
|
||||
local deltaTime = 0
|
||||
local isClear = { false, false }
|
||||
local towerNightNum = 0
|
||||
|
||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||
deltaTime = _deltaTime
|
||||
fps = _fps
|
||||
isClear = _isClear
|
||||
towerNightNum = _towerNightNum
|
||||
deltaTime = _deltaTime
|
||||
end
|
||||
|
||||
local bgWidth_1 = 1323
|
||||
local bgWidth_2 = 1280
|
||||
local bgWidth_3 = 1280
|
||||
|
@ -1,16 +1,3 @@
|
||||
local fps = 0
|
||||
local deltaTime = 0
|
||||
local isClear = { false, false }
|
||||
local towerNightNum = 0
|
||||
|
||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||
deltaTime = _deltaTime
|
||||
fps = _fps
|
||||
isClear = _isClear
|
||||
towerNightNum = _towerNightNum
|
||||
deltaTime = _deltaTime
|
||||
end
|
||||
|
||||
local loopWidth = 1255
|
||||
|
||||
local bgClearFade = 0
|
||||
|
@ -1,16 +1,3 @@
|
||||
local fps = 0
|
||||
local deltaTime = 0
|
||||
local isClear = { false, false }
|
||||
local towerNightNum = 0
|
||||
|
||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||
deltaTime = _deltaTime
|
||||
fps = _fps
|
||||
isClear = _isClear
|
||||
towerNightNum = towerNightNum
|
||||
deltaTime = _deltaTime
|
||||
end
|
||||
|
||||
local loopWidth = 328
|
||||
local loopHeight = 154
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
--func:DrawText(x, y, text);
|
||||
--func:DrawNum(x, y, num);
|
||||
--func:AddGraph("filename");
|
||||
@ -7,19 +6,6 @@
|
||||
--func:SetScale(xscale, yscale, "filename");
|
||||
--func:SetColor(r, g, b, "filename");
|
||||
|
||||
local fps = 0
|
||||
local deltaTime = 0
|
||||
local isClear = { false, false }
|
||||
local towerNightNum = 0
|
||||
|
||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||
deltaTime = _deltaTime
|
||||
fps = _fps
|
||||
isClear = _isClear
|
||||
towerNightNum = _towerNightNum
|
||||
deltaTime = _deltaTime
|
||||
end
|
||||
|
||||
function clearIn(player)
|
||||
end
|
||||
|
||||
|
@ -1,16 +1,3 @@
|
||||
local fps = 0
|
||||
local deltaTime = 0
|
||||
local isClear = { false, false }
|
||||
local towerNightNum = 0
|
||||
|
||||
function updateValues(_deltaTime, _fps, _isClear, _towerNightNum)
|
||||
deltaTime = _deltaTime
|
||||
fps = _fps
|
||||
isClear = _isClear
|
||||
towerNightNum = _towerNightNum
|
||||
deltaTime = _deltaTime
|
||||
end
|
||||
|
||||
local bgWidth_1 = 1323
|
||||
local bgWidth_2 = 1280
|
||||
local bgWidth_3 = 1280
|
||||
|
Loading…
Reference in New Issue
Block a user