summaryrefslogtreecommitdiff
path: root/chat.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-08-04 02:40:51 +0100
committerubq323 <ubq323@ubq323.website>2022-08-04 02:40:51 +0100
commitc0b41a20dc73f70d0fd4f9b41a45015a17633908 (patch)
treead466e6024ccb18408a1de32420e1ac5549c777b /chat.lua
parent1877604754293ddfd7b66311ae7628bac8ca8229 (diff)
chat
Diffstat (limited to 'chat.lua')
-rw-r--r--chat.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/chat.lua b/chat.lua
index 9e02b1e..b7ce9e3 100644
--- a/chat.lua
+++ b/chat.lua
@@ -28,6 +28,12 @@ local function pad_r(s,width)
return string.rep(" ",width-#tostring(s))..s
end
+local function pad_c(s,width)
+ local space = width-#tostring(s)
+ local hspace = math.floor(space/2)
+ return string.rep(" ",hspace)..s
+end
+
-- drawing
-- lb
@@ -36,6 +42,11 @@ local function draw_lb(W,scores)
W.setBackgroundColor(colors.gray)
W.clear()
+ -- header
+ W.setTextColor(colors.lime)
+ W.setCursorPos(1,1)
+ W.write(pad_c("==[[ LEADERBOARD ]]==",lbw))
+
-- line numbers
W.setTextColor(colors.yellow)
for line=1,10 do