From d28368893948239481387034db7ac9ee9f25a244 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Mon, 15 Apr 2024 00:45:18 -0400 Subject: [PATCH] stats.lua: add option to control plot border width This adds a new configuration option plot_bg_border_width, which controls the border width of plots. --- DOCS/man/stats.rst | 5 +++++ player/lua/stats.lua | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DOCS/man/stats.rst b/DOCS/man/stats.rst index a5cd3b3d91..be8bb50e6b 100644 --- a/DOCS/man/stats.rst +++ b/DOCS/man/stats.rst @@ -183,6 +183,11 @@ Configurable Options Border color used for drawing graphs. +``plot_bg_border_width`` + Default: 0.5 + + Border width used for drawing graphs. + ``plot_bg_color`` Default: 262626 diff --git a/player/lua/stats.lua b/player/lua/stats.lua index 161e1fd739..76d50e0eff 100644 --- a/player/lua/stats.lua +++ b/player/lua/stats.lua @@ -47,6 +47,7 @@ local o = { plot_bg_border_color = "0000FF", plot_bg_color = "262626", plot_color = "FFFFFF", + plot_bg_border_width = 0.5, -- Text style font = "", @@ -235,8 +236,8 @@ local function generate_graph(values, i, len, v_max, v_avg, scale, x_tics) s[#s+1] = format("%f %f %f %f", x, y_max, 0, y_max) - local bg_box = format("{\\bord0.5}{\\3c&H%s&}{\\1c&H%s&}m 0 %f l %f %f %f 0 0 0", - o.plot_bg_border_color, o.plot_bg_color, y_max, x_max, y_max, x_max) + local bg_box = format("{\\bord%f}{\\3c&H%s&}{\\1c&H%s&}m 0 %f l %f %f %f 0 0 0", + o.plot_bg_border_width, o.plot_bg_border_color, o.plot_bg_color, y_max, x_max, y_max, x_max) return format("%s{\\rDefault}{\\pbo%f}{\\shad0}{\\alpha&H00}{\\p1}%s{\\p0}{\\bord0}{\\1c&H%s}{\\p1}%s{\\p0}%s", o.prefix_sep, y_offset, bg_box, o.plot_color, table.concat(s), text_style()) end