Skip to content

Commit 541b524

Browse files
committedJul 26, 2024·
Remove restart action in favor of pause menu button
1 parent f26902a commit 541b524

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed
 

‎src/screen/playing.rs

+5-20
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use crate::game::actor::player::player;
1414
use crate::game::spotlight::spotlight_lamp_spawner;
1515
use crate::game::GameRoot;
1616
use crate::screen::fade_in;
17-
use crate::screen::fade_out;
1817
use crate::screen::playing::hud::playing_hud;
1918
use crate::screen::Screen;
2019
use crate::ui::prelude::*;
@@ -71,7 +70,6 @@ impl Configure for PlayingAssets {
7170

7271
#[derive(Actionlike, Reflect, Clone, Hash, PartialEq, Eq)]
7372
pub enum PlayingAction {
74-
Restart,
7573
TogglePause,
7674
// TODO: These actions should be split out.
7775
// TODO: Discard action.
@@ -88,8 +86,6 @@ impl Configure for PlayingAction {
8886
app.init_resource::<ActionState<Self>>();
8987
app.insert_resource(
9088
InputMap::default()
91-
.insert(Self::Restart, GamepadButtonType::Select)
92-
.insert(Self::Restart, KeyCode::KeyR)
9389
.insert(Self::TogglePause, GamepadButtonType::Start)
9490
.insert(Self::TogglePause, KeyCode::Escape)
9591
.insert(Self::TogglePause, KeyCode::Tab)
@@ -115,29 +111,18 @@ impl Configure for PlayingAction {
115111
app.add_plugins(InputManagerPlugin::<Self>::default());
116112
app.add_systems(
117113
StateFlush,
118-
(
119-
restart.in_set(ResolveStateSet::<Screen>::Compute).run_if(
114+
PlayingMenu::Pause
115+
.toggle()
116+
.in_set(ResolveStateSet::<PlayingMenu>::Compute)
117+
.run_if(
120118
Screen::Playing
121119
.will_exit()
122-
.and_then(action_just_pressed(Self::Restart)),
120+
.and_then(action_just_pressed(Self::TogglePause)),
123121
),
124-
PlayingMenu::Pause
125-
.toggle()
126-
.in_set(ResolveStateSet::<PlayingMenu>::Compute)
127-
.run_if(
128-
Screen::Playing
129-
.will_exit()
130-
.and_then(action_just_pressed(Self::TogglePause)),
131-
),
132-
),
133122
);
134123
}
135124
}
136125

137-
fn restart(mut commands: Commands) {
138-
commands.spawn_with(fade_out(Screen::Playing));
139-
}
140-
141126
// TODO: Deck actions in deck.rs, but disabled by default. Enable the actions within PlayingMenu::LevelUp (and disable PlayingAction maybe?).
142127

143128
// TODO: What happens if you try to pause while in the level-up menu?

0 commit comments

Comments
 (0)
Please sign in to comment.