diff --git a/Assets/scenes/minimal.scene b/Assets/scenes/minimal.scene
index 56c1b24..478bea9 100644
--- a/Assets/scenes/minimal.scene
+++ b/Assets/scenes/minimal.scene
@@ -1283,6 +1283,16 @@
"Scale": 1,
"ScaleStrategy": "ConsistentHeight",
"ZIndex": 100
+ },
+ {
+ "__type": "Sandbox.HarvestControllerHUD",
+ "__guid": "647b376a-2067-40a3-9a2c-e7c013792590",
+ "HarvestPlayer": {
+ "_type": "component",
+ "component_id": "c8657ccc-cb8f-4ebb-8304-1bf3653d5f9a",
+ "go": "7027777f-eaab-46c0-a135-ed9c580259ce",
+ "component_type": "HarvestPlayer"
+ }
}
]
},
diff --git a/Code/Player/HarvestPlayer.cs b/Code/Player/HarvestPlayer.cs
index b304e1d..95d109e 100644
--- a/Code/Player/HarvestPlayer.cs
+++ b/Code/Player/HarvestPlayer.cs
@@ -93,6 +93,8 @@ protected override void OnFixedUpdate()
{
Popup = PopupType.None;
}
+
+ ControllerChoices();
if ( _playerController.Velocity.Length > 0f && lastStep >= 70 / _playerController.Velocity.Length && _playerController.IsOnGround )
{
@@ -137,6 +139,14 @@ public static void Rescue()
}
}
+ public void ControllerChoices()
+ {
+ if ( !Input.UsingController ) return;
+ if ( !HasCat ) return;
+
+ if (Input.Pressed("Harvest")) Harvest();
+ if (Input.Pressed("Rescue")) Rescue();
+ }
public void OnKilled()
{
diff --git a/Code/Player/ShrimpleController.cs b/Code/Player/ShrimpleController.cs
index 408a16a..d1626ff 100644
--- a/Code/Player/ShrimpleController.cs
+++ b/Code/Player/ShrimpleController.cs
@@ -19,10 +19,6 @@ public class ShrimpleWalker : Component
[Range(100f, 500f, 20f)]
public float RunSpeed { get; set; } = 300f;
- [Property]
- [Range(25f, 100f, 5f)]
- public float DuckSpeed { get; set; } = 50f;
-
[Property]
[Range(200f, 500f, 20f)]
public float JumpStrength { get; set; } = 350f;
@@ -44,10 +40,8 @@ protected override void OnFixedUpdate()
base.OnFixedUpdate();
var wishDirection = Input.AnalogMove.Normal * Rotation.FromYaw(EyeAngles.yaw);
- var isDucking = Input.Down("Duck");
var isRunning = Input.Down("Run");
- var wishSpeed = isDucking ? DuckSpeed :
- isRunning ? RunSpeed : WalkSpeed;
+ var wishSpeed = isRunning ? RunSpeed : WalkSpeed;
Controller.WishVelocity = wishDirection * wishSpeed;
Controller.Move();
@@ -62,7 +56,6 @@ protected override void OnFixedUpdate()
AnimationHelper.WithWishVelocity(Controller.WishVelocity);
AnimationHelper.WithVelocity(Controller.Velocity);
- AnimationHelper.DuckLevel = isDucking ? 1f : 0f;
AnimationHelper.IsGrounded = Controller.IsOnGround;
}
diff --git a/Code/UI/HarvestControllerHUD.razor b/Code/UI/HarvestControllerHUD.razor
new file mode 100644
index 0000000..de8c8f5
--- /dev/null
+++ b/Code/UI/HarvestControllerHUD.razor
@@ -0,0 +1,38 @@
+@using Sandbox;
+@using Sandbox.UI;
+@inherits PanelComponent
+@namespace Sandbox
+
+@if ( HarvestPlayer.HasCat && Input.UsingController )
+{
+
+
+
+}
+
+
+@code
+{
+
+ [Property] public HarvestPlayer HarvestPlayer { get; set; }
+ private Texture HarvestButton { get; set; }
+ private Texture RescueButton { get; set; }
+
+ protected override void OnFixedUpdate()
+ {
+ HarvestButton = Input.GetGlyph( "Harvest", InputGlyphSize.Medium, false );
+ RescueButton = Input.GetGlyph( "Rescue", InputGlyphSize.Medium, false );
+
+ Mouse.Visible = !Input.UsingController && HarvestPlayer.HasCat;
+ //otherwise the cursor type will always default to pointer, for some reason?
+ Mouse.CursorType = null;
+ }
+
+ ///
+ /// the hash determines if the system should be rebuilt. If it changes, it will be rebuilt
+ ///
+ protected override int BuildHash() => System.HashCode.Combine( RescueButton, HarvestButton, HarvestPlayer.HasCat );
+}
diff --git a/Code/UI/HarvestControllerHUD.razor.scss b/Code/UI/HarvestControllerHUD.razor.scss
new file mode 100644
index 0000000..4763508
--- /dev/null
+++ b/Code/UI/HarvestControllerHUD.razor.scss
@@ -0,0 +1,20 @@
+HarvestControllerHUD
+{
+ position: absolute;
+ top: 480px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ justify-content: center;
+ align-items: center;
+ font-weight: bold;
+ border-radius: 20px;
+
+ .Choices-buttons{
+ flex-direction: row;
+ justify-content: center;
+ gap: 325px;
+ width: 40%;
+ height: 128px;
+ }
+}
\ No newline at end of file
diff --git a/Code/UI/HarvestHUD.scss b/Code/UI/HarvestHUD.scss
index 8333845..9ed34ca 100644
--- a/Code/UI/HarvestHUD.scss
+++ b/Code/UI/HarvestHUD.scss
@@ -219,8 +219,7 @@ HarvestHUD {
width: 50%;
position: absolute;
bottom: 150px;
- pointer-events: all;
-
+ cursor: none;
.button {
border-radius: 30px;
flex-shrink: 1;
@@ -235,6 +234,7 @@ HarvestHUD {
transition: all 0.1s ease-in;
align-items: center;
justify-content: center;
+ pointer-events: all;
.title {
font-family: "Chewy";
diff --git a/ProjectSettings/Input.config b/ProjectSettings/Input.config
index 6b0f44e..d76617a 100644
--- a/ProjectSettings/Input.config
+++ b/ProjectSettings/Input.config
@@ -33,7 +33,7 @@
{
"Name": "Pick",
"KeyboardCode": "e",
- "GamepadCode": "Y",
+ "GamepadCode": "A",
"GroupName": "Actions"
},
{
@@ -41,6 +41,18 @@
"KeyboardCode": "tab",
"GamepadCode": "SwitchLeftMenu",
"GroupName": "Other"
+ },
+ {
+ "Name": "Harvest",
+ "KeyboardCode": "ins",
+ "GamepadCode": "X",
+ "GroupName": "Other"
+ },
+ {
+ "Name": "Rescue",
+ "KeyboardCode": "del",
+ "GamepadCode": "Y",
+ "GroupName": "Other"
}
],
"__guid": "b45f516a-555b-4595-911a-31df09a8874e",