From 4930ea6645c25b6446cf96c8d74cbeecbc85e761 Mon Sep 17 00:00:00 2001 From: hkc Date: Tue, 9 Jan 2024 19:42:36 +0300 Subject: [PATCH] little stuff --- augment/files.json | 6 +++++- augment/main.lua | 7 ++----- augment/modules/event.lua | 2 +- augment/modules/wh.lua | 1 + augment/wsvpn.lua | 1 + 5 files changed, 10 insertions(+), 7 deletions(-) create mode 120000 augment/wsvpn.lua diff --git a/augment/files.json b/augment/files.json index 0109546..082fa58 100644 --- a/augment/files.json +++ b/augment/files.json @@ -2,7 +2,11 @@ "repository": "https://git.salushnes.solutions/hkc/cc-stuff/raw/branch/master/augment", "files": [ { - "path": "startup", + "path": "wsvpn.lua", + "src": "wsvpn.lua" + }, + { + "path": "startup.lua", "src": "startup.lua" }, { diff --git a/augment/main.lua b/augment/main.lua index 896a661..712d0c1 100644 --- a/augment/main.lua +++ b/augment/main.lua @@ -45,7 +45,7 @@ local function safeset(func, name, old) if func then local s, res = pcall(func) if not s then - print("ERR: " .. name .. " failed: " .. res) + printError("ERR: " .. name .. " failed: " .. res) else return res end @@ -60,10 +60,7 @@ parallel.waitForAll(function() local ev = { os.pullEvent("exit") } if ev[1] == "exit" then _G._running = false - local oldc = term.getTextColor() - term.setTextColor(colors.red) - print("Caught exit event, shutting down...") - term.setTextColor(oldc) + printError("Caught exit event, shutting down...") break end end diff --git a/augment/modules/event.lua b/augment/modules/event.lua index c87b04a..769fa92 100644 --- a/augment/modules/event.lua +++ b/augment/modules/event.lua @@ -1,7 +1,7 @@ return function() while _G._running do 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") break elseif ev[1] == "timer" or ev[1] == "plethora_task" then diff --git a/augment/modules/wh.lua b/augment/modules/wh.lua index a070e33..9394103 100644 --- a/augment/modules/wh.lua +++ b/augment/modules/wh.lua @@ -21,6 +21,7 @@ return function() cache[id].cube.setAlpha(0x20) cache[id].cube.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].frame.setPosition(entity.x, entity.y, entity.z) cache[id].text.setAlpha(0xFF) diff --git a/augment/wsvpn.lua b/augment/wsvpn.lua new file mode 120000 index 0000000..60c2a7f --- /dev/null +++ b/augment/wsvpn.lua @@ -0,0 +1 @@ +../wsvpn.lua \ No newline at end of file