Skip to content

Commit

Permalink
console.lua: preserve the counter style when searching history
Browse files Browse the repository at this point in the history
When searching the command history with outline-and-shadow, the counter
should preserve the border, shadow and blur. Only with background-box it
should disable the shadow to not overlap 2 rectangles. While disabling
border and blur is needed with the menu background+outline-and-shadow.
  • Loading branch information
guidocella committed Feb 18, 2025
1 parent d4b6eaa commit 7fa44e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion player/lua/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,10 @@ local function render()
ass:new_event()
ass:an(alignment + 2)
ass:pos(x + max_item_width, y)
ass:append('{\\bord0\\4a&Hff&\\blur0}' .. selected_match .. '/' .. #matches)
if not searching_history or border_style == 'background-box' then
ass:append('{\\bord0\\4a&Hff&\\blur0}')
end
ass:append(selected_match .. '/' .. #matches)

local start_percentage = (first_match_to_print - 1) / #matches
local end_percentage = (first_match_to_print - 1 + max_lines) / #matches
Expand Down

0 comments on commit 7fa44e6

Please sign in to comment.