Make the item list a lot better looking, and add placeholders to

inputBox.
This commit is contained in:
Soph :3 2025-11-11 19:00:26 +02:00
parent e9cfedea55
commit 3c338f05dd
2 changed files with 24 additions and 15 deletions

View file

@ -3,6 +3,8 @@ local PrimeUI = require("lib.primeui").PrimeUI;
local function runUi()
local search = ""
local win = term.current();
local w , h= term.getSize()
local function getFiltered()
local filtered = {}
@ -16,16 +18,13 @@ local function runUi()
local refiltered = {}
for i, filter in ipairs(filtered) do
refiltered[i] = filter.name .. " -> " .. tostring(filter.count)
refiltered[i] = filter.name .. string.rep(" ", w-(2+#filter.name+#tostring(filter.count))) .. tostring(filter.count)
end
return refiltered
end
local com = getFiltered("")
local win = term.current();
local w , h= term.getSize()
PrimeUI.clear()
local updateEntries = PrimeUI.selectionBox(
win, 1, 4, w, h-7,
@ -45,10 +44,10 @@ local function runUi()
search = data
com = getFiltered()
updateEntries()
end)
end, "Input a item to search..")
PrimeUI.label(win, 2, h-1, "primeui ui refucked")
PrimeUI.label(win, 2, h-2, "rev. " .. fs.open("storage-solution/version", "r").readAll())
PrimeUI.label(win, 2, h-1, "primeui ui refucked", colors.lightGray)
PrimeUI.label(win, 2, h-2, "rev. " .. fs.open("storage-solution/version", "r").readAll(), colors.lightGray)
local timer = os.startTimer(1)
PrimeUI.addTask(function()