mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 11:19:58 -04:00
RmlUi improvements (#663)
* rmlui audio * fix menu select sound * Fixes #662 * fix reset logic and fix popup getting stuck closed * fix X button on menu popup * rmlui achievements, and fix open/close bug * presets, achievements css, and menu sounds toggle * forgor * fix b button causing audio when menu not visible
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include "number_button.hpp"
|
||||
|
||||
#include "Z2AudioLib/Z2SeMgr.h"
|
||||
#include "m_Do/m_Do_audio.h"
|
||||
|
||||
#include <charconv>
|
||||
#include <fmt/format.h>
|
||||
|
||||
@@ -51,11 +54,13 @@ void NumberButton::set_value(Rml::String value) {
|
||||
}
|
||||
|
||||
bool NumberButton::handle_nav_command(NavCommand cmd) {
|
||||
if (cmd == NavCommand::Left) {
|
||||
mSetValue(std::clamp(mGetValue() - mStep, mMin, mMax));
|
||||
return true;
|
||||
} else if (cmd == NavCommand::Right) {
|
||||
mSetValue(std::clamp(mGetValue() + mStep, mMin, mMax));
|
||||
if (cmd == NavCommand::Left || cmd == NavCommand::Right) {
|
||||
const int newValue = std::clamp(
|
||||
mGetValue() + (cmd == NavCommand::Right ? mStep : -mStep), mMin, mMax);
|
||||
if (newValue != mGetValue()) {
|
||||
mSetValue(newValue);
|
||||
mDoAud_seStartMenu(Z2SE_SY_NAME_CURSOR);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return BaseStringButton::handle_nav_command(cmd);
|
||||
|
||||
Reference in New Issue
Block a user