Fix a few bugs, add esc to exit table
This commit is contained in:
		
							parent
							
								
									08dc84b343
								
							
						
					
					
						commit
						e20c07cf84
					
				| @ -91,7 +91,8 @@ material = SubResource("ShaderMaterial_u26td") | ||||
| [node name="HUD" parent="." node_paths=PackedStringArray("Player") instance=ExtResource("7_g7tfv")] | ||||
| Player = NodePath("../Player") | ||||
| 
 | ||||
| [node name="PauseMenu" parent="." instance=ExtResource("11_lav3p")] | ||||
| [node name="PauseMenu" parent="." node_paths=PackedStringArray("Table") instance=ExtResource("11_lav3p")] | ||||
| Table = NodePath("../table") | ||||
| 
 | ||||
| [node name="BlueprintRenderingViewport" type="SubViewport" parent="."] | ||||
| msaa_3d = 3 | ||||
|  | ||||
| @ -52,6 +52,11 @@ namespace Gmtk24 { | ||||
|             if (!IsEnabled) | ||||
|                 return; | ||||
| 
 | ||||
|             if (@event.IsAction("toggle_pause_menu")) { | ||||
|                 SetEnabled(false); | ||||
|                 GetViewport().SetInputAsHandled(); | ||||
|             } | ||||
| 
 | ||||
|             if (@event.IsActionPressed("drag_orbit")) | ||||
|                 Input.MouseMode = Input.MouseModeEnum.Captured; | ||||
|             if (@event.IsActionReleased("drag_orbit")) | ||||
| @ -75,13 +80,13 @@ namespace Gmtk24 { | ||||
|                     EmitSignal(SignalName.BlockRelease, HeldBlock, (uint)BlockReleaseType.Place); | ||||
|                     HeldBlock = null; | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             if (@event.IsActionPressed("rotate_block_right")) { | ||||
|                 HeldBlock.RotateY(RotateAmt); | ||||
|             } | ||||
|             if (@event.IsActionPressed("rotate_block_left")) { | ||||
|                 HeldBlock.RotateY(-RotateAmt); | ||||
|                 if (@event.IsActionPressed("rotate_block_right")) { | ||||
|                     HeldBlock.RotateY(RotateAmt); | ||||
|                 } | ||||
|                 if (@event.IsActionPressed("rotate_block_left")) { | ||||
|                     HeldBlock.RotateY(-RotateAmt); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  | ||||
| @ -16,6 +16,9 @@ namespace Gmtk24 { | ||||
|         [Export] | ||||
|         public BaseButton CameraInvertY; | ||||
| 
 | ||||
|         [Export] | ||||
|         public Table Table; | ||||
| 
 | ||||
|         private bool Opened = false; | ||||
| 
 | ||||
|         public override void _Ready() { | ||||
| @ -34,7 +37,7 @@ namespace Gmtk24 { | ||||
|         } | ||||
| 
 | ||||
|         public override void _Input(InputEvent @event) { | ||||
|             if (@event.IsActionPressed("toggle_pause_menu")) { | ||||
|             if (@event.IsActionPressed("toggle_pause_menu") && (!Table.Orbit?.IsEnabled ?? true)) { | ||||
|                 if (Opened) { | ||||
|                     Close(); | ||||
|                 } else { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user