Skip to content

Commit

Permalink
Make method names clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
OctoCPPlus committed Dec 14, 2024
1 parent 6065f9e commit ccf4d01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions desktop/src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ impl RuffleGui {
player.set_volume(self.volume_controls.get_volume());
}

fn is_taking_screenshot(&mut self) -> bool {
let taking_screenshot = self.taking_screenshot;
self.taking_screenshot = false;
pub fn set_taking_screenshot(&mut self, bool state) {
self.taking_screenshot = state;
}

taking_screenshot
pub fn get_taking_screenshot(&mut self) -> bool {
self.taking_screenshot
}

/// Renders the main menu bar at the top of the window.
Expand Down Expand Up @@ -312,7 +313,7 @@ impl RuffleGui {
}
if Button::new(text(&self.locale, "debug-menu-take-screenshot")).ui(ui).clicked() {
ui.close_menu();
self.taking_screenshot = true;
self.set_taking_screenshot(true)
}
});
});
Expand Down
4 changes: 3 additions & 1 deletion desktop/src/gui/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ impl GuiController {
}

pub fn render(&mut self, mut player: Option<MutexGuard<Player>>) {
let taking_screenshot = self.gui.is_taking_screenshot();
let taking_screenshot = self.gui.get_taking_screenshot();
self.gui.set_taking_screenshot(false);

let surface_texture = self
.surface
.get_current_texture()
Expand Down

0 comments on commit ccf4d01

Please sign in to comment.