- 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 [[
.readText() window.navigator.clipboard
.then((text) => {console.log('In Javascript: ' + text); _$_(text);}) .readText()
.catch((e) => { .then((text) => _$_(text))
console.warn(e); .catch((e) => {
_$_(''); console.warn(e);
}); _$_('');
]] });
), function(data) print("In callback: " .. data); res=data end) ]]
repeat ),
love.timer.sleep(1) function(data) res=data end,
JS.retrieveData(1) function(id, error) print(id, error) res="" end
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()