wonky polygon ui rework

This commit is contained in:
Lilith Schier 2026-08-30 22:03:36 +02:00
parent 6bdc9617b2
commit 6c55d719ff
22 changed files with 165 additions and 117 deletions

View file

@ -260,13 +260,11 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
public void OnEnteredWater(Node2D body)
{
GD.Print("Entered water");
IsInWater = true;
}
public void OnLeftWater(Node2D body)
{
GD.Print("Left water");
if (!IsInWater || SubmersedSensor.HasOverlappingBodies()) return;
IsInWater = false;
WaterJumpAllowedTimer.Start();

View file

@ -1,35 +0,0 @@
namespace Dancer;
[Meta(typeof(IAutoNode))]
public partial class PlayerHud : Control
{
public override void _Notification(int what) => this.Notify(what);
[Export] private Player Player { get; set; } = null!;
[Node] private TextureProgressBar HpBar { get; set; } = null!;
[Node] private TextureProgressBar EnergyBar0 { get; set; } = null!;
[Node] private TextureProgressBar EnergyBar1 { get; set; } = null!;
[Node] private TextureProgressBar EnergyBar2 { get; set; } = null!;
public void OnReady() => SetProcess(true);
public void OnProcess(double delta)
{
HpBar.MinValue = 0f;
HpBar.MaxValue = Player.MaxHealth;
HpBar.Value = Player.Health;
EnergyBar0.MinValue = 0f;
EnergyBar0.MaxValue = 1f;
EnergyBar0.Value = Mathf.Clamp(Player.DashPoints - 0f, 0f, 1f);
EnergyBar1.MinValue = 0f;
EnergyBar1.MaxValue = 1f;
EnergyBar1.Value = Mathf.Clamp(Player.DashPoints - 1f, 0f, 1f);
EnergyBar2.MinValue = 0f;
EnergyBar2.MaxValue = 1f;
EnergyBar2.Value = Mathf.Clamp(Player.DashPoints - 2f, 0f, 1f);
}
}

View file

@ -1 +0,0 @@
uid://dsbiwhvdat5ul

BIN
src/player/ui/energy_bar.aseprite (Stored with Git LFS)

Binary file not shown.

BIN
src/player/ui/energy_bar.png (Stored with Git LFS)

Binary file not shown.

View file

@ -1,40 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dwiu5ej85fc3i"
path="res://.godot/imported/energy_bar.png-5d692337a8d4fc75932e5331744e6f31.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/ui/energy_bar.png"
dest_files=["res://.godot/imported/energy_bar.png-5d692337a8d4fc75932e5331744e6f31.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
src/player/ui/hp_bar.aseprite (Stored with Git LFS)

Binary file not shown.

BIN
src/player/ui/hp_bar.png (Stored with Git LFS)

Binary file not shown.

View file

@ -1,40 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c0kdbshy1ipbe"
path="res://.godot/imported/hp_bar.png-fce09f911d5101836dd4a642325ba1e7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/ui/hp_bar.png"
dest_files=["res://.godot/imported/hp_bar.png-fce09f911d5101836dd4a642325ba1e7.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
src/player/ui/player_hud.aseprite (Stored with Git LFS)

Binary file not shown.

BIN
src/player/ui/player_hud.png (Stored with Git LFS)

Binary file not shown.

View file

@ -1,40 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7xxxshusx3sm"
path="res://.godot/imported/player_hud.png-17c4147e4f4eb6f0681b63f601977a48.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/ui/player_hud.png"
dest_files=["res://.godot/imported/player_hud.png-17c4147e4f4eb6f0681b63f601977a48.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -1,68 +0,0 @@
[gd_scene format=3 uid="uid://llohfwmma2hv"]
[ext_resource type="Script" uid="uid://dsbiwhvdat5ul" path="res://src/player/ui/PlayerHud.cs" id="1_580w7"]
[ext_resource type="Texture2D" uid="uid://b7xxxshusx3sm" path="res://src/player/ui/player_hud.png" id="2_580w7"]
[ext_resource type="Texture2D" uid="uid://c0kdbshy1ipbe" path="res://src/player/ui/hp_bar.png" id="3_uku0i"]
[ext_resource type="Texture2D" uid="uid://dwiu5ej85fc3i" path="res://src/player/ui/energy_bar.png" id="4_uku0i"]
[node name="PlayerHud" type="Control" unique_id=763981532]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("1_580w7")
[node name="PlayerHudBase" type="TextureRect" parent="." unique_id=400555418]
layout_mode = 0
offset_right = 64.0
offset_bottom = 24.0
texture = ExtResource("2_580w7")
[node name="HpBar" type="TextureProgressBar" parent="." unique_id=1950685336]
unique_name_in_owner = true
layout_mode = 0
offset_left = 8.0
offset_top = 6.0
offset_right = 60.0
offset_bottom = 46.0
value = 100.0
texture_progress = ExtResource("3_uku0i")
[node name="Control" type="Control" parent="." unique_id=302593641]
anchors_preset = 0
offset_left = 8.0
offset_top = 20.0
offset_right = 48.0
offset_bottom = 60.0
[node name="EnergyBar0" type="TextureProgressBar" parent="Control" unique_id=2122373484]
unique_name_in_owner = true
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
max_value = 1.0
step = 0.1
value = 1.0
texture_progress = ExtResource("4_uku0i")
[node name="EnergyBar1" type="TextureProgressBar" parent="Control" unique_id=177919498]
unique_name_in_owner = true
layout_mode = 0
offset_left = 11.0
offset_right = 51.0
offset_bottom = 40.0
max_value = 1.0
step = 0.1
value = 1.0
texture_progress = ExtResource("4_uku0i")
[node name="EnergyBar2" type="TextureProgressBar" parent="Control" unique_id=1462542424]
unique_name_in_owner = true
layout_mode = 0
offset_left = 22.0
offset_right = 62.0
offset_bottom = 40.0
max_value = 1.0
step = 0.1
value = 0.5
texture_progress = ExtResource("4_uku0i")