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