little stuff

This commit is contained in:
Casey 2024-01-09 19:42:36 +03:00
parent d543f68947
commit 4930ea6645
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
5 changed files with 10 additions and 7 deletions

View File

@ -2,7 +2,11 @@
"repository": "https://git.salushnes.solutions/hkc/cc-stuff/raw/branch/master/augment", "repository": "https://git.salushnes.solutions/hkc/cc-stuff/raw/branch/master/augment",
"files": [ "files": [
{ {
"path": "startup", "path": "wsvpn.lua",
"src": "wsvpn.lua"
},
{
"path": "startup.lua",
"src": "startup.lua" "src": "startup.lua"
}, },
{ {

View File

@ -45,7 +45,7 @@ local function safeset(func, name, old)
if func then if func then
local s, res = pcall(func) local s, res = pcall(func)
if not s then if not s then
print("ERR: " .. name .. " failed: " .. res) printError("ERR: " .. name .. " failed: " .. res)
else else
return res return res
end end
@ -60,10 +60,7 @@ parallel.waitForAll(function()
local ev = { os.pullEvent("exit") } local ev = { os.pullEvent("exit") }
if ev[1] == "exit" then if ev[1] == "exit" then
_G._running = false _G._running = false
local oldc = term.getTextColor() printError("Caught exit event, shutting down...")
term.setTextColor(colors.red)
print("Caught exit event, shutting down...")
term.setTextColor(oldc)
break break
end end
end end

View File

@ -1,7 +1,7 @@
return function() return function()
while _G._running do while _G._running do
local ev = { os.pullEvent() } local ev = { os.pullEvent() }
if ev[1] == "key" and ev[2] == keys.q then if ev[1] == "key" and ev[2] == keys.f4 then
os.queueEvent("exit") os.queueEvent("exit")
break break
elseif ev[1] == "timer" or ev[1] == "plethora_task" then elseif ev[1] == "timer" or ev[1] == "plethora_task" then

View File

@ -21,6 +21,7 @@ return function()
cache[id].cube.setAlpha(0x20) cache[id].cube.setAlpha(0x20)
cache[id].cube.setDepthTested(false) cache[id].cube.setDepthTested(false)
cache[id].frame.setDepthTested(false) cache[id].frame.setDepthTested(false)
cache[id].cube.setPosition(entity.x - 0.25, entity.y - 0.25, entity.z - 0.25) cache[id].cube.setPosition(entity.x - 0.25, entity.y - 0.25, entity.z - 0.25)
cache[id].frame.setPosition(entity.x, entity.y, entity.z) cache[id].frame.setPosition(entity.x, entity.y, entity.z)
cache[id].text.setAlpha(0xFF) cache[id].text.setAlpha(0xFF)

1
augment/wsvpn.lua Symbolic link
View File

@ -0,0 +1 @@
../wsvpn.lua