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
3
#include <
VoltMod/Menu/MenuModel.hpp
>
4
#include <functional>
5
6
namespace
VoltMod
7
{
8
9
/** Rows available to cursor navigation. */
10
struct
CursorRows
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
19
namespace
MenuCursor
20
{
21
/** The rows of @p menu as the cursor sees them for @p slot: how many, and which it may land on. */
22
CursorRows
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. */
25
int
Step
(
const
CursorRows
& rows,
int
index,
int
step);
26
27
/** First selectable row. */
28
int
First
(
const
CursorRows
& rows);
29
30
/** Moves @p index by @p delta pages while preserving its page offset. */
31
int
JumpPage
(
const
CursorRows
& rows,
int
index,
int
rowsPerPage,
int
delta);
32
}
// namespace MenuCursor
33
34
}
// namespace VoltMod
MenuModel.hpp
VoltMod::MenuCursor
Definition
MenuCursor.hpp:20
VoltMod::MenuCursor::Step
int Step(const CursorRows &rows, int index, int step)
Definition
MenuCursor.cpp:31
VoltMod::MenuCursor::First
int First(const CursorRows &rows)
Definition
MenuCursor.cpp:49
VoltMod::MenuCursor::Rows
CursorRows Rows(Menu *menu, int slot)
Definition
MenuCursor.cpp:19
VoltMod::MenuCursor::JumpPage
int JumpPage(const CursorRows &rows, int index, int rowsPerPage, int delta)
Definition
MenuCursor.cpp:59
VoltMod
Definition
Options.hpp:13
VoltMod::CursorRows
Definition
MenuCursor.hpp:11
VoltMod::CursorRows::Selectable
std::function< bool(int index)> Selectable
Definition
MenuCursor.hpp:16
VoltMod::CursorRows::Count
int Count
Definition
MenuCursor.hpp:13
VoltMod::Menu
Definition
MenuModel.hpp:141
src
Menu
MenuCursor.hpp
Generated by
1.15.0