mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 12:08:38 +00:00
Merge pull request #175: Give each gamepad stick its own dead zone and show where the stick rests (applezra)
The stick reading moved from input_win.c to input.c in dev, so the per-stick dead zone and input_pad_stick_percent are applied there, under the platform mutex. The rows sit beside the stick camera speed and walk key rows; pt-BR and zh-Hans get the per-stick texts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
87ccb22f51
13 files changed
+109
-29
No files matched your search
@@ -294,12 +294,15 @@ bool opt_choice(const char *key, UiTextId label, const UiTextId *names, int n, U
|
||||
return opt_choice_list(key, label, values, shown, n, desc, -1, note);
|
||||
}
|
||||
|
||||
bool opt_slider(const char *key, UiTextId label, float lo, float hi, UiTextId desc, float step, const char *fmt) {
|
||||
const CfgMeta *m = cfg_meta(key);
|
||||
double v = cfg_double(key), def = m ? strtod(m->def, NULL) : lo;
|
||||
bool opt_slider(const char *key, UiTextId label, float lo, float hi, UiTextId desc, float step, const char *fmt,
|
||||
const char *note, const char *fallback) {
|
||||
const char *set = cfg_get(key);
|
||||
const char *src = fallback && !(set && *set) ? fallback : key; // unset: show the value in effect, the fallback's
|
||||
const CfgMeta *m = cfg_meta(src);
|
||||
double v = cfg_double(src), def = m ? strtod(m->def, NULL) : lo;
|
||||
char shown[48];
|
||||
snprintf(shown, sizeof shown, fmt, v);
|
||||
RowView rv = {shown, fabs(v - def) < step * 0.01, true, NULL};
|
||||
RowView rv = {shown, fabs(v - def) < step * 0.01, true, note};
|
||||
int s = row(key, label, desc, rv);
|
||||
if (!s) return false;
|
||||
int steps = g_held && (hi - lo) > 40 * step ? 10 : 1; // held: ten steps at a time over a long range
|
||||
|
||||
Reference in new issue
Block a user