mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-02 18:46:00 -04:00
feat: Make gamepad status lighting optional (#1705)
* feat: Status Lighting option * wip: rename to "Enable Controller LED" * wip: setting for all four ports individually * wip: fix detection + code cleanup * wip: increase led speed for dusk preset * wip: use aurora API * bump aurora to 2b07d55 * wip: remove isSupported + fix namespace comment * wip: add value override to BoolButton * Style nit & remove unused * Undo change --------- Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
@@ -12,7 +12,8 @@ BoolButton::BoolButton(Rml::Element* parent, Props props)
|
||||
.icon = std::move(props.icon),
|
||||
}),
|
||||
mGetValue(std::move(props.getValue)), mSetValue(std::move(props.setValue)),
|
||||
mIsDisabled(std::move(props.isDisabled)), mIsModified(std::move(props.isModified)) {}
|
||||
mIsDisabled(std::move(props.isDisabled)), mIsModified(std::move(props.isModified)),
|
||||
mValueOverride(std::move(props.valueOverride)) {}
|
||||
|
||||
bool BoolButton::modified() const {
|
||||
if (mIsModified) {
|
||||
@@ -29,6 +30,12 @@ bool BoolButton::disabled() const {
|
||||
}
|
||||
|
||||
Rml::String BoolButton::format_value() {
|
||||
if (mValueOverride) {
|
||||
if (std::string value = mValueOverride(); !value.empty()) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
return mGetValue() ? "On" : "Off";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user