mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 12:08:38 +00:00
The left stick now moves the menu cursor as the D-pad does (ImGui only scrolled with it). The page's rows are a direct NavFlattened child of the menu window: behind a second child level ImGui did not clip them, so up from Continue went to the tabs and down from the tabs to Continue. The full overlay reads temperature, board power, clock and GPU load from ADL's PM log on AMD GPUs (matched by PCI bus), and shows the window, game image and 3D scene sizes, the scaling to the window (FSR and its sharpness), the frame limit and the presentation mode in use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
3.5 KiB
C
58 lines
3.5 KiB
C
// Settings pages in two panes (ui/option_rows.cpp): option rows on the left, the selected (controller) or hovered (mouse)
|
|
// row's description on the right. Each row shows a setting of the cfg table (cfg.h) and changes it through cfg_set: A or
|
|
// a click steps it (toggle, next value), left and right step it. A row marks the default value, says "after restart" when
|
|
// the setting is read at start, and is greyed out with a note when an environment variable fixes it.
|
|
//
|
|
// opt_begin("##screen", scale);
|
|
// opt_toggle("TOTK_FULLSCREEN", UI_MENU_FULLSCREEN, UI_MENU_FULLSCREEN_DESC);
|
|
// opt_end();
|
|
//
|
|
// key: the setting's TOTK_ name, which must have a cfg_meta row. Present path only (ImGui).
|
|
#pragma once
|
|
#include "imgui.h"
|
|
|
|
extern "C" {
|
|
#include "ui_text.h"
|
|
}
|
|
|
|
void opt_begin(const char *id, float scale);
|
|
void opt_end(void);
|
|
// The height the next pages leave free under their panes (the menu's bottom row).
|
|
void opt_reserve_bottom(float h);
|
|
// The next page's first row takes the controller's cursor (opening the menu, switching tabs).
|
|
void opt_focus_first(void);
|
|
// The row of key (or button id) takes the cursor, scrolled into view, when it is next drawn.
|
|
void opt_focus_key(const char *key);
|
|
// The next row is greyed out like one the environment fixes, with note under its label and in its description.
|
|
void opt_disable_next(UiTextId note);
|
|
|
|
// Page text that is not a row: a group heading in the accent colour, a wrapped paragraph (warn: the warning colour).
|
|
void opt_group(UiTextId title);
|
|
void opt_text(UiTextId text, bool warn = false);
|
|
|
|
// The return value of every row: true when it changed the setting this frame.
|
|
// inverted: the row shows "on" while the key is 0 (a setting whose key names the opposite).
|
|
bool opt_toggle(const char *key, UiTextId label, UiTextId desc, bool inverted = false);
|
|
// One name per value of the key's cfg_meta values list, in its order. When the key has no fixed default (an empty
|
|
// def), names[0] is the automatic choice (the key unset) and names[1..] follow the values. note: a short line under
|
|
// the value in place of the "default" mark (NULL: none).
|
|
bool opt_choice(const char *key, UiTextId label, const UiTextId *names, int n, UiTextId desc,
|
|
const char *note = nullptr);
|
|
// A choice over a list the caller builds (devices, window sizes): values[i] is written, names[i] shown; "" means the key
|
|
// unset. cur: the index in effect, -1 to find cfg_value(key) in values (no match: the value shown as it is).
|
|
bool opt_choice_list(const char *key, UiTextId label, const char *const *values, const char *const *names, int n,
|
|
UiTextId desc, int cur = -1, const char *note = nullptr);
|
|
// A row that runs an action: true on A or a click. id: unique on the page and not a setting ("##copy_info"); value:
|
|
// shown on the right ("" none).
|
|
bool opt_button(const char *id, UiTextId label, UiTextId desc, const char *value = "");
|
|
// lo..hi in steps of step (left and right held for a second go ten times as fast); fmt formats the value ("%.0f %%").
|
|
bool opt_slider(const char *key, UiTextId label, float lo, float hi, UiTextId desc, float step = 1,
|
|
const char *fmt = "%g");
|
|
|
|
// totk.ini is written a moment after the last change (a held slider would rewrite it every frame) and when the menu
|
|
// closes. opt_save_tick: on every frame the menu lays out; force: write now if anything is pending. 1 while a write is
|
|
// pending.
|
|
int opt_save_tick(int force);
|
|
// A change made outside a row (Reset, F10): totk.ini is written as after a row's change.
|
|
void opt_save_soon(void);
|