diff options
-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 |