1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 17:19:31 +00:00

uqt.signal

This commit is contained in:
Étienne Fildadut 2019-12-27 18:54:30 +01:00
parent 82bc7268e6
commit f6fb8ad649
11 changed files with 331 additions and 80 deletions

View file

@ -2,18 +2,30 @@ local uqt = require((...):match("^(.-ubiquitousse)%."))
local ctr = require("ctr")
local gfx = require("ctr.gfx")
local function checkCompat(stuffName, expectedVersion, actualVersion)
if actualVersion ~= expectedVersion then
local txt = ("Ubiquitousse ctrµLua backend was made for %s %s but %s is used!\nThings may not work as expected.")
:format(stuffName, expectedVersion, actualVersion)
print(txt)
for _=0,300 do
gfx.start(gfx.TOP)
gfx.wrappedText(0, 0, txt, gfx.TOP_WIDTH)
gfx.stop()
gfx.render()
end
local madeForCtr = "v1.0"
local madeForUqt = "0.0.1"
-- Check versions
local txt = ""
if ctr.version ~= madeForCtr then
txt = txt .. ("Ubiquitousse ctrµLua backend was made for ctrµLua %s but %s is used!\n")
:format(madeForCtr, uqt.version)
end
if uqt.version ~= madeForUqt then
txt = txt .. ("Ubiquitousse ctrµLua backend was made for Ubiquitousse %s but %s is used!\n")
:format(madeForUqt, uqt.version)
end
-- Show warnings
if txt ~= "" then
txt = txt .. "Things may not work as expected.\n"
print(txt)
for _=0,300 do
gfx.start(gfx.TOP)
gfx.wrappedText(0, 0, txt, gfx.TOP_WIDTH)
gfx.stop()
gfx.render()
end
end
checkCompat("ctrµLua", "v1.0", ctr.version) -- not really a version, just get the latest build
checkCompat("Ubiquitousse", "0.0.1", uqt.version)

View file

@ -1,11 +1,30 @@
local uqt = require((...):match("^(.-ubiquitousse)%."))
local function checkCompat(stuffName, expectedVersion, actualVersion)
if actualVersion ~= expectedVersion then
local txt = ("Ubiquitousse Löve backend was made for %s %s but %s is used!\nThings may not work as expected.")
:format(stuffName, expectedVersion, actualVersion)
print(txt)
local madeForLove = { 11, "x", "x" }
local madeForUqt = "0.0.1"
-- Check versions
local txt = ""
local actualLove = { love.getVersion() }
for i, v in ipairs(madeForLove) do
if v ~= "x" then
if actualLove[i] ~= v then
txt = txt .. ("Ubiquitousse Löve backend was made for LÖVE %s.%s.%s but %s.%s.%s is used!\n")
:format(madeForLove[1], madeForLove[2], madeForLove[3], actualLove[1], actualLove[2], actualLove[3])
break
end
end
end
checkCompat("Löve", "11.3.0", ("%s.%s.%s"):format(love.getVersion()))
checkCompat("Ubiquitousse", "0.0.1", uqt.version)
if uqt.version ~= madeForUqt then
txt = txt .. ("Ubiquitousse Löve backend was made for Ubiquitousse %s but %s is used!\n")
:format(madeForUqt, uqt.version)
end
-- Show warnings
if txt ~= "" then
txt = txt .. "Things may not work as expected.\n"
print(txt)
love.window.showMessageBox("Compatibility warning", txt, "warning")
end