diff options
author | ubq323 <ubq323@ubq323.website> | 2022-08-04 02:40:51 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-08-04 02:40:51 +0100 |
commit | c0b41a20dc73f70d0fd4f9b41a45015a17633908 (patch) | |
tree | ad466e6024ccb18408a1de32420e1ac5549c777b | |
parent | 1877604754293ddfd7b66311ae7628bac8ca8229 (diff) |
chat
-rw-r--r-- | chat.lua | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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 |