10 std::size_t
rows, std::span<const std::string_view>
iconNames)
24 for (std::size_t index = 0; index <
tabs; ++index)
26 _tabs.push_back(TabIds{
27 .Id = std::format(
"{}_tab{}",
screen, index),
28 .Icon = std::format(
"{}_tab{}_icon",
screen, index),
29 .LabelVar = std::format(
"tab{}", index),
33 for (std::size_t index = 0; index <
rows; ++index)
35 _rows.push_back(RowIds{
36 .Id = std::format(
"{}_row{}",
screen, index),
37 .Button = std::format(
"{}_row{}_button",
screen, index),
38 .Decrease = std::format(
"{}_row{}_decrease",
screen, index),
39 .Increase = std::format(
"{}_row{}_increase",
screen, index),
40 .LabelVar = std::format(
"row{}_label", index),
41 .HintVar = std::format(
"row{}_hint", index),
42 .ValueVar = std::format(
"row{}_value", index),
83 for (
const ScreenText&
text : _texts)
101 const TabIds&
ids = _tabs[
static_cast<std::size_t
>(index)];
118 const RowIds&
ids = _rows[
static_cast<std::size_t
>(index)];
178 _texts.push_back(ScreenText{.Variable = std::string{
variable}, .Value = std::move(
text)});
195 if (
id == _pagePrevious)
204 for (
int index = 0; index <
TabCount(); ++index)
206 if (
id == _tabs[
static_cast<std::size_t
>(index)].Id)
212 for (
int index = 0; index <
RowCount(); ++index)
214 const RowIds&
row = _rows[
static_cast<std::size_t
>(index)];
215 if (
id ==
row.Button)
219 if (
id ==
row.Decrease)
223 if (
id ==
row.Increase)
Create Screen objects and report their button presses.
A spawned Panorama layout created by ScreenManager.
void ShowCursor(int slot, bool shown)
void SetHidden(int slot, std::string_view elementId, bool hidden)
void SetClass(int slot, std::string_view elementId, std::string_view className, bool on)
void SetText(int slot, std::string_view variable, std::string_view value)
@ Input
Carries a value the player types in chat.
@ Submenu
Opens another menu.
@ Toggle
Carries an on/off value.
static std::string ReadFile(const std::filesystem::path &path)