sure. since it's for a larger project if you don't want to have to change a couple things it's best if you just try out the whole project: https://github.com/CC-HydraOS/HydraOS
I also added tabs and made a launcher & calculator for it. The calculator is in pr #2 if you want it before my partner accepts it.
I will probably make a fork that doesn't require the whole project soon
Recommendation: Use CC's builtin window API to fix the flickering by buffering the screen contents:
-- HydraUI/init.lua:1
local win = window.create(term.current(), 1, 1, term.getSize())
term.redirect(win)
-- ...
-- HydraUI/init.lua:30: (function draw)
local function draw()
win.setVisible(false) -- Pause updates to the terminal
clearTerminal()
for k, v in pairs(windows) do
v:draw(term, palette)
end
win.setVisible(true) -- Resume updates to the terminal (and flush current buffer, causes instant redraw with no flickering)
end
3
u/TheBunnyMan123 Mar 15 '25
In this everything, including the windows, is a component. That is what makes this easily extensible, as well as the event pass through.