From 72efc690c20aa9ed05c27a75a77cd90e9cc72d77 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 8 Oct 2015 03:05:20 -0400 Subject: leaderboard#RenderLeaderboard: 2 font choices (WIP) Start of render function, initialising a new buffer for the leaderboard and getting necessary data from our storage files. Two font options generated from Figlet, one in "cybermedium" and the other in "larry3d". Going to go with the "larry3d" one. --- autoload/space_vlaze/leaderboard.vim | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'autoload') diff --git a/autoload/space_vlaze/leaderboard.vim b/autoload/space_vlaze/leaderboard.vim index 5ad25dd..9136bc3 100644 --- a/autoload/space_vlaze/leaderboard.vim +++ b/autoload/space_vlaze/leaderboard.vim @@ -40,4 +40,45 @@ endfunction function! space_vlaze#leaderboard#RenderLeaderboard() + let buffer_name = 'Space Vlaze – Leaderboard' + + if !buflisted(buffer_name) + execute 'edit ' . escape(buffer_name, ' ') + else + execute 'b' . bufnr(buffer_name) + endif + + let scores = [] + let player_name = [] + + if filereadable(s:LEADERBOARD_PATH) + let scores = readfile(s:LEADERBOARD_PATH) + endif + + if filereadable(s:PLAYER_NAME_PATH) + let player_name = readfile(s:PLAYER_NAME_PATH) + endif + + +_ ____ ____ ___ ____ ____ ___ ____ ____ ____ ___ +| |___ |__| | \ |___ |__/ |__] | | |__| |__/ | \ +|___ |___ | | |__/ |___ | \ |__] |__| | | | \ |__/ + + + __ __ +/\ \ /\ \ +\ \ \ __ __ \_\ \ __ _ __ + \ \ \ __ /'__`\ /'__`\ /'_` \ /'__`\ /\`'__\ + \ \ \L\ \/\ __/ /\ \L\.\_ /\ \L\ \ /\ __/ \ \ \/ + \ \____/\ \____\\ \__/.\_\\ \___,_\\ \____\ \ \_\ + \/___/ \/____/ \/__/\/_/ \/__,_ / \/____/ \/_/ + + __ __ + /\ \ /\ \ + \ \ \____ ___ __ _ __ \_\ \ + \ \ '__`\ / __`\ /'__`\ /\`'__\ /'_` \ + \ \ \L\ \/\ \L\ \/\ \L\.\_ \ \ \/ /\ \L\ \ + \ \_,__/\ \____/\ \__/.\_\ \ \_\ \ \___,_\ + \/___/ \/___/ \/__/\/_/ \/_/ \/__,_ / + endfunction -- cgit v1.2.3