- Add log

This commit is contained in:
ParticleG
2024-11-01 08:48:25 +08:00
parent 017f874f38
commit 77fd519b43
3 changed files with 15 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
__requestQueue = {}
_requestCount = 0
_Request =
local __requestQueue = {}
local _requestCount = 0
local _Request =
{
command = "",
currentTime = 0,
@@ -11,10 +11,10 @@ local os = love.system.getOS()
local __defaultErrorFunction = nil
local isDebugActive = false
JS = {}
local JS = {}
function JS.callJS(funcToCall)
if(os == "Web") then
if os == "Web" then
print("callJavascriptFunction " .. funcToCall)
end
end
@@ -23,16 +23,10 @@ end
--If you pass arguments to the func beyond the string, it will perform automatically string.format
--Return statement is possible inside this structure
--This will return a string containing a function to be called by JS.callJS
local _unpack
if(_VERSION == "Lua 5.1" or _VERSION == "LuaJIT") then
_unpack = unpack
else
_unpack = table.unpack
end
function JS.stringFunc(str, ...)
str = "(function(){"..str.."})()"
if(#arg > 0) then
str = str:format(_unpack(arg))
str = str:format(unpack(arg))
end
str = str:gsub("[\n\t]", "")
return str