finally managed to pin down the in game UI and control issues for keyboard
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
[gd_scene load_steps=49 format=3 uid="uid://bei4nhkf8lwdo"]
|
||||
[gd_scene load_steps=47 format=3 uid="uid://bei4nhkf8lwdo"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
|
||||
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"]
|
||||
[ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://systems/inputs/base_mode/rotate_y.tres" id="4_rxwoh"]
|
||||
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"]
|
||||
[ext_resource type="Resource" uid="uid://f3vs6l4m623s" path="res://systems/inputs/base_mode/move_left.tres" id="5_q14ux"]
|
||||
[ext_resource type="Script" uid="uid://dv7v1ywmbvvcd" path="res://player_controller/Scripts/HealthSystem.cs" id="5_umw0l"]
|
||||
[ext_resource type="Script" uid="uid://vuq8rjq3vegn" path="res://player_controller/Scripts/Stamina.cs" id="6_lxtc4"]
|
||||
[ext_resource type="Resource" uid="uid://t612lts1wi1s" path="res://systems/inputs/base_mode/move_right.tres" id="6_q7bng"]
|
||||
[ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://player_controller/Scripts/StairsSystem.cs" id="7_bmt5a"]
|
||||
[ext_resource type="Resource" uid="uid://brswsknpgwal2" path="res://systems/inputs/base_mode/move_front.tres" id="7_m8gvy"]
|
||||
@@ -124,12 +122,6 @@ CapsuleDefaultHeight = 1.7
|
||||
[node name="HeadSystem" parent="." instance=ExtResource("11_rxwoh")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
|
||||
|
||||
[node name="HealthSystem" type="Node3D" parent="."]
|
||||
script = ExtResource("5_umw0l")
|
||||
|
||||
[node name="Stamina" type="Node3D" parent="."]
|
||||
script = ExtResource("6_lxtc4")
|
||||
|
||||
[node name="StairsSystem" type="Node3D" parent="."]
|
||||
script = ExtResource("7_bmt5a")
|
||||
|
||||
@@ -249,15 +241,24 @@ offset_bottom = 1.0
|
||||
enabled = false
|
||||
initial_node_to_watch = NodePath("../StateChart")
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource("30_2ghaa")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI"]
|
||||
[node name="UI" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
script = ExtResource("30_2ghaa")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme_override_constants/margin_left = 50
|
||||
theme_override_constants/margin_top = 50
|
||||
theme_override_constants/margin_right = 50
|
||||
@@ -296,12 +297,14 @@ expand_mode = 2
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="UI"]
|
||||
custom_minimum_size = Vector2(1920, 1080)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="CenterIcon" type="TextureRect" parent="UI/CenterContainer"]
|
||||
material = SubResource("CanvasItemMaterial_2q0ik")
|
||||
@@ -311,11 +314,13 @@ texture = ExtResource("32_lgpc8")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="CenterContainer2" type="CenterContainer" parent="UI"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UI/CenterContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class PlayerUi : CanvasLayer
|
||||
public partial class PlayerUi : Control
|
||||
{
|
||||
private TextureRect[] _dashIcons = new TextureRect[3];
|
||||
|
||||
|
||||
@@ -146,9 +146,6 @@ public partial class HealthSystem : Node3D
|
||||
public CharacterBody3D Parent;
|
||||
public Camera3D Camera;
|
||||
public Node3D Head;
|
||||
public ColorRect VignetteRect;
|
||||
public ColorRect DistortionRect;
|
||||
public ColorRect BlurRect;
|
||||
}
|
||||
|
||||
public void Init(HealthSystemInitParams initParams)
|
||||
@@ -162,10 +159,6 @@ public partial class HealthSystem : Node3D
|
||||
_camera = initParams.Camera;
|
||||
|
||||
_head = initParams.Head;
|
||||
|
||||
_vignetteMaterial = initParams.VignetteRect.Material as ShaderMaterial;
|
||||
_distortionMaterial = initParams.DistortionRect.Material as ShaderMaterial;
|
||||
_blurMaterial = initParams.BlurRect.Material as ShaderMaterial;
|
||||
|
||||
// Resetting shaders' parameters
|
||||
|
||||
|
||||
@@ -21,12 +21,10 @@ public partial class PlayerController : CharacterBody3D
|
||||
public HeadSystem HeadSystem;
|
||||
public Bobbing Bobbing;
|
||||
public FieldOfView FieldOfView;
|
||||
public Stamina Stamina;
|
||||
public StairsSystem StairsSystem;
|
||||
public MantleSystem MantleSystem;
|
||||
public DashSystem DashSystem;
|
||||
public CapsuleCollider CapsuleCollider;
|
||||
public HealthSystem HealthSystem;
|
||||
public TweenQueueSystem TweenQueueSystem;
|
||||
public Node3D WeaponRoot;
|
||||
public WeaponSystem WeaponSystem;
|
||||
@@ -239,11 +237,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
FieldOfView = GetNode<FieldOfView>("FieldOfView");
|
||||
Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D");
|
||||
Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth");
|
||||
ColorRect vignetteRect = GetNode<ColorRect>(
|
||||
"HeadSystem/CameraSmooth/Camera3D/CLVignette(Layer_1)/HealthVignetteRect");
|
||||
ColorRect distortionRect = GetNode<ColorRect>(
|
||||
"HeadSystem/CameraSmooth/Camera3D/CLDistortion(Layer_2)/HealthDistortionRect");
|
||||
ColorRect blurRect = GetNode<ColorRect>("HeadSystem/CameraSmooth/Camera3D/CLBlur(Layer_2)/BlurRect");
|
||||
|
||||
// Movement stuff
|
||||
WeaponRoot = GetNode<Node3D>("WeaponRoot");
|
||||
@@ -266,11 +259,7 @@ public partial class PlayerController : CharacterBody3D
|
||||
_playerHeight = playerShape!.Height;
|
||||
_playerRadius = playerShape.Radius;
|
||||
|
||||
// RPG Stuff
|
||||
Stamina = GetNode<Stamina>("Stamina");
|
||||
HealthSystem = GetNode<HealthSystem>("HealthSystem");
|
||||
|
||||
// State management
|
||||
// State managementb
|
||||
_playerState = StateChart.Of(GetNode("StateChart"));
|
||||
|
||||
_aiming = StateChartState.Of(GetNode("StateChart/Root/Aim/On"));
|
||||
@@ -322,18 +311,6 @@ public partial class PlayerController : CharacterBody3D
|
||||
WallHugSystem.Init();
|
||||
|
||||
// RPG Stuff
|
||||
HealthSystem.HealthSystemInitParams healthSystemParams = new HealthSystem.HealthSystemInitParams()
|
||||
{
|
||||
Parent = this,
|
||||
Camera = camera,
|
||||
Head = HeadSystem,
|
||||
VignetteRect = vignetteRect,
|
||||
DistortionRect = distortionRect,
|
||||
BlurRect = blurRect,
|
||||
};
|
||||
HealthSystem.Init(healthSystemParams);
|
||||
Stamina.SetSpeeds(WalkSpeed, WalkSpeed);
|
||||
|
||||
EmpoweredActionsLeft = MaxNumberOfEmpoweredActions;
|
||||
|
||||
if (!TutorialDone)
|
||||
|
||||
Reference in New Issue
Block a user