@@ -14,7 +14,6 @@ use crate::game::actor::player::player;
14
14
use crate :: game:: spotlight:: spotlight_lamp_spawner;
15
15
use crate :: game:: GameRoot ;
16
16
use crate :: screen:: fade_in;
17
- use crate :: screen:: fade_out;
18
17
use crate :: screen:: playing:: hud:: playing_hud;
19
18
use crate :: screen:: Screen ;
20
19
use crate :: ui:: prelude:: * ;
@@ -71,7 +70,6 @@ impl Configure for PlayingAssets {
71
70
72
71
#[ derive( Actionlike , Reflect , Clone , Hash , PartialEq , Eq ) ]
73
72
pub enum PlayingAction {
74
- Restart ,
75
73
TogglePause ,
76
74
// TODO: These actions should be split out.
77
75
// TODO: Discard action.
@@ -88,8 +86,6 @@ impl Configure for PlayingAction {
88
86
app. init_resource :: < ActionState < Self > > ( ) ;
89
87
app. insert_resource (
90
88
InputMap :: default ( )
91
- . insert ( Self :: Restart , GamepadButtonType :: Select )
92
- . insert ( Self :: Restart , KeyCode :: KeyR )
93
89
. insert ( Self :: TogglePause , GamepadButtonType :: Start )
94
90
. insert ( Self :: TogglePause , KeyCode :: Escape )
95
91
. insert ( Self :: TogglePause , KeyCode :: Tab )
@@ -115,29 +111,18 @@ impl Configure for PlayingAction {
115
111
app. add_plugins ( InputManagerPlugin :: < Self > :: default ( ) ) ;
116
112
app. add_systems (
117
113
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 (
120
118
Screen :: Playing
121
119
. will_exit ( )
122
- . and_then ( action_just_pressed ( Self :: Restart ) ) ,
120
+ . and_then ( action_just_pressed ( Self :: TogglePause ) ) ,
123
121
) ,
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
- ) ,
133
122
) ;
134
123
}
135
124
}
136
125
137
- fn restart ( mut commands : Commands ) {
138
- commands. spawn_with ( fade_out ( Screen :: Playing ) ) ;
139
- }
140
-
141
126
// TODO: Deck actions in deck.rs, but disabled by default. Enable the actions within PlayingMenu::LevelUp (and disable PlayingAction maybe?).
142
127
143
128
// TODO: What happens if you try to pause while in the level-up menu?
0 commit comments