chore: re-added have_a_coffee discussion, fixed text readability, fixed centering of texts, new system.ui functions for drawing in contour, fixed ddr types, fixed meter drawing
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
@@ -8,10 +8,11 @@ local COMBO_MAX_BONUS = 0.16
|
||||
local COMBO_TIMEOUT_FRAMES = 600
|
||||
|
||||
-- Internal meters for tracking game progress and player stats.
|
||||
Meter.COLOR_ISM = Config.colors.red
|
||||
Meter.COLOR_ISM = Config.colors.orange
|
||||
Meter.COLOR_WPM = Config.colors.blue
|
||||
Meter.COLOR_BM = Config.colors.black
|
||||
Meter.COLOR_BM = Config.colors.red
|
||||
Meter.COLOR_BG = Config.colors.meter_bg
|
||||
Meter.COLOR_CONTOUR = Config.colors.white
|
||||
|
||||
--- Gets initial meter values.
|
||||
--- @within Meter
|
||||
@@ -126,16 +127,16 @@ function Meter.draw()
|
||||
|
||||
local m = Context.meters
|
||||
local max = Meter.get_max()
|
||||
local bar_w = 44
|
||||
local screen_w = Config.screen.width
|
||||
local screen_h = Config.screen.height
|
||||
local bar_w = screen_w * 0.25
|
||||
local bar_h = 2
|
||||
local bar_x = 182
|
||||
local label_x = 228
|
||||
local line_h = 5
|
||||
local start_y = 1
|
||||
local edge = math.max(2, math.floor(screen_w * 0.03))
|
||||
local bar_x = screen_w - bar_w - edge
|
||||
local line_h = 3
|
||||
local start_y = screen_h * 0.05
|
||||
|
||||
|
||||
local bar_offset = math.floor((line_h - bar_h) / 2)
|
||||
|
||||
local meter_list = {
|
||||
{ key = "wpm", label = "WPM", color = Meter.COLOR_WPM, row = 0 },
|
||||
{ key = "ism", label = "ISM", color = Meter.COLOR_ISM, row = 1 },
|
||||
@@ -144,15 +145,16 @@ function Meter.draw()
|
||||
|
||||
for _, meter in ipairs(meter_list) do
|
||||
local label_y = start_y + meter.row * line_h
|
||||
local bar_y = label_y + bar_offset
|
||||
local bar_y = label_y
|
||||
local fill_w = math.max(0, math.floor((m[meter.key] / max) * bar_w))
|
||||
rect(bar_x - 1, bar_y - 1, bar_w + 2, bar_h + 2, Meter.COLOR_CONTOUR)
|
||||
rect(bar_x, bar_y, bar_w, bar_h, Meter.COLOR_BG)
|
||||
if fill_w > 0 then
|
||||
rect(bar_x, bar_y, fill_w, bar_h, meter.color)
|
||||
end
|
||||
print(meter.label, label_x, label_y, meter.color, false, 1, true)
|
||||
---print(meter.label, label_x, label_y, meter.color, false, 1, true)
|
||||
end
|
||||
|
||||
local ascension_y = start_y + 3 * line_h + 1
|
||||
Ascension.draw(bar_x, ascension_y, { spacing = 5 })
|
||||
Ascension.draw(bar_x, ascension_y, { spacing = 8 })
|
||||
end
|
||||
|
||||
@@ -12,8 +12,9 @@ function Minigame.draw_win_overlay(win_text)
|
||||
local box_h = th + padding * 2
|
||||
local box_x = (Config.screen.width - box_w) / 2
|
||||
local box_y = (Config.screen.height - box_h) / 2
|
||||
|
||||
local text_x = Config.screen.width / 2
|
||||
rect(box_x, box_y, box_w, box_h, Config.colors.dark_grey)
|
||||
rectb(box_x, box_y, box_w, box_h, Config.colors.white)
|
||||
Print.text_center(text, Config.screen.width / 2, box_y + padding, Config.colors.white)
|
||||
Print.text_center_contour(text, text_x, box_y + padding, Config.colors.black, false, 1, Config.colors.white)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user