mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Speeds up some Hud events when there is no change in value
Especially the three drop-downs related to graphics caused a little bit of lag when they were set, even if their newly set value was the same as the currently set one. This commit adds a check that breaks asap when there is no change necessary.
This commit is contained in:
parent
01ad81322d
commit
3d0e4f13fe
@ -920,6 +920,11 @@ impl PlayState for SessionState {
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ChangeAaMode(new_aa_mode) => {
|
||||
// No need to change when new == current.
|
||||
if new_aa_mode == global_state.settings.graphics.aa_mode {
|
||||
break
|
||||
}
|
||||
|
||||
// Do this first so if it crashes the setting isn't saved :)
|
||||
global_state
|
||||
.window
|
||||
@ -930,6 +935,11 @@ impl PlayState for SessionState {
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ChangeCloudMode(new_cloud_mode) => {
|
||||
// No need to change when new == current.
|
||||
if new_cloud_mode == global_state.settings.graphics.cloud_mode {
|
||||
break
|
||||
}
|
||||
|
||||
// Do this first so if it crashes the setting isn't saved :)
|
||||
global_state
|
||||
.window
|
||||
@ -940,6 +950,11 @@ impl PlayState for SessionState {
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ChangeFluidMode(new_fluid_mode) => {
|
||||
// No need to change when new == current.
|
||||
if new_fluid_mode == global_state.settings.graphics.fluid_mode {
|
||||
break
|
||||
}
|
||||
|
||||
// Do this first so if it crashes the setting isn't saved :)
|
||||
global_state
|
||||
.window
|
||||
|
Loading…
Reference in New Issue
Block a user