Commit 4cf86eb5 authored by Rahix's avatar Rahix 🦀
Browse files

gamestate: Completely rework state machine

Don't ever leak the handlers, keep track of them and drop them when they
are no longer needed.
parent 8d9456f5
This diff is collapsed.
......@@ -79,7 +79,7 @@ impl HeavenState {
}
impl gamestate::State for HeavenState {
fn init(&mut self, init: gamestate::StateInitializer) -> gamestate::Transition {
fn init(&mut self, mut init: gamestate::StateInitializer) -> gamestate::Transition {
init.register_onclick("heaven-start-shift");
self.gui_svg
.style()
......
......@@ -49,7 +49,7 @@ impl InGameState {
}
impl gamestate::State for InGameState {
fn init(&mut self, init: gamestate::StateInitializer) -> gamestate::Transition {
fn init(&mut self, mut init: gamestate::StateInitializer) -> gamestate::Transition {
self.gui_svg
.style()
.set_property("display", "block")
......
......@@ -15,7 +15,7 @@ impl MainMenuState {
}
impl gamestate::State for MainMenuState {
fn init(&mut self, init: gamestate::StateInitializer) -> gamestate::Transition {
fn init(&mut self, mut init: gamestate::StateInitializer) -> gamestate::Transition {
init.register_onclick("main-menu-play");
self.gui_svg
.style()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment