- Update sources

This commit is contained in:
ParticleG
2024-10-31 20:52:09 +08:00
parent 1905960b51
commit b19a83ac23

View File

@@ -201,21 +201,21 @@ if JS then
love.system.getClipboardText = function () love.system.getClipboardText = function ()
local res local res
JS.newPromiseRequest(JS.stringFunc( JS.newPromiseRequest(
JS.stringFunc(
[[ [[
window.navigator.clipboard window.navigator.clipboard
.readText() .readText()
.then((text) => {console.log('In Javascript: ' + text); _$_(text);}) .then((text) => _$_(text))
.catch((e) => { .catch((e) => {
console.warn(e); console.warn(e);
_$_(''); _$_('');
}); });
]] ]]
), function(data) print("In callback: " .. data); res=data end) ),
repeat function(data) res=data end,
love.timer.sleep(1) function(id, error) print(id, error) res="" end
JS.retrieveData(1) )
until res
return res return res
end end
end end
@@ -766,6 +766,7 @@ function love.run()
-- UPDATE -- UPDATE
STEP() STEP()
if JS then JS.retrieveData(dt) end
if mouseShow then mouse_update(dt) end if mouseShow then mouse_update(dt) end
if next(jsState) then gp_update(jsState[1],dt) end if next(jsState) then gp_update(jsState[1],dt) end
VOC.update() VOC.update()