mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp
synced 2026-07-10 07:07:09 -04:00
show display refresh rate in description
This commit is contained in:
@@ -377,6 +377,17 @@ struct DebugContext {
|
||||
}
|
||||
};
|
||||
|
||||
void recomp::update_rml_display_refresh_rate() {
|
||||
static uint32_t lastRate = 0;
|
||||
if (!graphics_model_handle) return;
|
||||
|
||||
uint32_t curRate = ultramodern::get_display_refresh_rate();
|
||||
if (curRate != lastRate) {
|
||||
graphics_model_handle.DirtyVariable("display_refresh_rate");
|
||||
}
|
||||
lastRate = curRate;
|
||||
}
|
||||
|
||||
DebugContext debug_context;
|
||||
|
||||
class ConfigMenu : public recomp::MenuController {
|
||||
@@ -523,6 +534,11 @@ public:
|
||||
graphics_model_handle.DirtyVariable("ds_info");
|
||||
});
|
||||
|
||||
constructor.BindFunc("display_refresh_rate",
|
||||
[](Rml::Variant& out) {
|
||||
out = ultramodern::get_display_refresh_rate();
|
||||
});
|
||||
|
||||
constructor.BindFunc("options_changed",
|
||||
[](Rml::Variant& out) {
|
||||
out = (ultramodern::get_graphics_config() != new_options);
|
||||
|
||||
@@ -956,6 +956,7 @@ struct UIContext {
|
||||
void update_config_menu_loop(bool menu_changed) {
|
||||
static int prevTab = -1;
|
||||
if (menu_changed) prevTab = -1;
|
||||
recomp::update_rml_display_refresh_rate();
|
||||
|
||||
Rml::ElementTabSet *tabset = (Rml::ElementTabSet *)current_document->GetElementById("config_tabset");
|
||||
if (tabset == nullptr) return;
|
||||
|
||||
Reference in New Issue
Block a user