VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
MenuCursor.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <functional>
5
6namespace VoltMod
7{
8
9/** Rows available to cursor navigation. */
11{
12 /** Number of rows. */
13 int Count = 0;
14
15 /** True when the cursor may stop on @p index. Unset means every row takes it. */
16 std::function<bool(int index)> Selectable;
17};
18
19namespace MenuCursor
20{
21/** The rows of @p menu as the cursor sees them for @p slot: how many, and which it may land on. */
22CursorRows Rows(Menu* menu, int slot);
23
24/** @p index moved by @p step, wrapping over @p rows and skipping what it may not land on. */
25int Step(const CursorRows& rows, int index, int step);
26
27/** First selectable row. */
28int First(const CursorRows& rows);
29
30/** Moves @p index by @p delta pages while preserving its page offset. */
31int JumpPage(const CursorRows& rows, int index, int rowsPerPage, int delta);
32} // namespace MenuCursor
33
34} // namespace VoltMod
int Step(const CursorRows &rows, int index, int step)
int First(const CursorRows &rows)
CursorRows Rows(Menu *menu, int slot)
int JumpPage(const CursorRows &rows, int index, int rowsPerPage, int delta)
std::function< bool(int index)> Selectable