1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
// SPDX-License-Identifier: BSD-2-Clause
// Copyright (c) 2025 Kirill Dmitrievich
// File: settings.hh
// Description: Visual config value editing
#ifndef CLIENT_GUI_SETTINGS_HH
#define CLIENT_GUI_SETTINGS_HH
#pragma once
namespace config
{
class Boolean;
class String;
} // namespace config
namespace config
{
class Int;
class Float;
class Unsigned;
} // namespace config
namespace config
{
class KeyBind;
class GamepadAxis;
class GamepadButton;
} // namespace config
enum class settings_location : unsigned int {
GENERAL = 0x0000U,
KEYBOARD_MOVEMENT = 0x0001U,
KEYBOARD_GAMEPLAY = 0x0002U,
KEYBOARD_MISC = 0x0003U,
GAMEPAD = 0x0004U,
GAMEPAD_MOVEMENT = 0x0005U,
GAMEPAD_GAMEPLAY = 0x0006U,
GAMEPAD_MISC = 0x0007U,
MOUSE = 0x0008U,
VIDEO = 0x0009U,
VIDEO_GUI = 0x000AU,
SOUND = 0x000BU,
SOUND_LEVELS = 0x000CU,
COUNT = 0x000DU,
};
namespace settings
{
void init(void);
void init_late(void);
void shutdown(void);
void layout(void);
} // namespace settings
namespace settings
{
void add_checkbox(int priority, config::Boolean& value, settings_location location, std::string_view name, bool tooltip);
} // namespace settings
namespace settings
{
void add_input(int priority, config::Int& value, settings_location location, std::string_view name, bool tooltip);
void add_input(int priority, config::Float& value, settings_location location, std::string_view name, bool tooltip,
std::string_view fmt = "%.3f");
void add_input(int priority, config::Unsigned& value, settings_location location, std::string_view name, bool tooltip);
void add_input(int priority, config::String& value, settings_location location, std::string_view name, bool tooltip, bool allow_whitespace);
} // namespace settings
namespace settings
{
void add_slider(int priority, config::Int& value, settings_location location, std::string_view name, bool tooltip);
void add_slider(int priority, config::Float& value, settings_location location, std::string_view name, bool tooltip,
std::string_view format = "%.3f");
void add_slider(int priority, config::Unsigned& value, settings_location location, std::string_view name, bool tooltip);
} // namespace settings
namespace settings
{
void add_stepper(int priority, config::Int& value, settings_location location, std::string_view name, bool tooltip);
void add_stepper(int priority, config::Unsigned& value, settings_location location, std::string_view name, bool tooltip);
} // namespace settings
namespace settings
{
void add_keybind(int priority, config::KeyBind& value, settings_location location, std::string_view name);
} // namespace settings
namespace settings
{
void add_gamepad_axis(int priority, config::GamepadAxis& value, settings_location location, std::string_view name);
void add_gamepad_button(int priority, config::GamepadButton& value, settings_location location, std::string_view name);
} // namespace settings
namespace settings
{
void add_language_select(int priority, settings_location location, std::string_view name);
void add_video_mode_select(int priority, settings_location location, std::string_view name);
} // namespace settings
#endif
|