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/** @p index moved by @p step, wrapping over @p rows and skipping what it may not land on. */
22int Step(const CursorRows& rows, int index, int step);
23
24/** First selectable row. */
25int First(const CursorRows& rows);
26
27/** Moves @p index by @p delta pages while preserving its page offset. */
28int JumpPage(const CursorRows& rows, int index, int rowsPerPage, int delta);
29} // namespace MenuCursor
30
31} // namespace VoltMod
int Step(const CursorRows &rows, int index, int step)
int First(const CursorRows &rows)
int JumpPage(const CursorRows &rows, int index, int rowsPerPage, int delta)
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
std::function< bool(int index)> Selectable