UI: Implement controller config

Resolves #622
This commit is contained in:
Luke Street
2026-05-03 17:16:15 -06:00
parent 742f4938f2
commit 924dbc7715
10 changed files with 737 additions and 17 deletions
+12 -1
View File
@@ -10,9 +10,20 @@ ScopedEventListener::ScopedEventListener(
mElement->AddEventListener(mEvent, this, mCapture);
}
ScopedEventListener::ScopedEventListener(
Rml::Element* element, Rml::String event, Callback callback, bool capture)
: mElement(element), mEventName(std::move(event)), mCapture(capture),
mCallback(std::move(callback)) {
mElement->AddEventListener(mEventName, this, mCapture);
}
ScopedEventListener::~ScopedEventListener() {
if (mElement != nullptr) {
mElement->RemoveEventListener(mEvent, this, mCapture);
if (!mEventName.empty()) {
mElement->RemoveEventListener(mEventName, this, mCapture);
} else {
mElement->RemoveEventListener(mEvent, this, mCapture);
}
mElement = nullptr;
}
}