area labels

pull/6/head
John Montagu, the 4th Earl of Sandvich 2023-08-13 20:11:40 -07:00
parent 2e1e831195
commit 24f2c3b9fd
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
16 changed files with 374 additions and 29 deletions

View File

@ -0,0 +1,7 @@
[gd_resource type="FontVariation" load_steps=2 format=3 uid="uid://cnjpt3yy746ob"]
[ext_resource type="FontFile" uid="uid://6bvgjbmqovau" path="res://Assets/Fonts/calamity/calamity.ttf" id="1_m4w5i"]
[resource]
base_font = ExtResource("1_m4w5i")
spacing_glyph = 4

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cd8ak8gu0104t"
path="res://.godot/imported/border.png-c957ce067800ad93e4d5a5a409cc0f49.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Sprites/UI/border.png"
dest_files=["res://.godot/imported/border.png-c957ce067800ad93e4d5a5a409cc0f49.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://t467i5xou4ug"
path="res://.godot/imported/menu-center.png-fa37aff35ac70bec324c3aa847f905cd.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Sprites/UI/menu-center.png"
dest_files=["res://.godot/imported/menu-center.png-fa37aff35ac70bec324c3aa847f905cd.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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

@ -0,0 +1,6 @@
namespace SupaLidlGame.Events;
public partial class AreaChangedArgs : Args
{
public Scenes.Map Map { get; set; }
}

View File

@ -7,6 +7,9 @@ public partial class EventBus : Node
[Signal]
public delegate void RequestMoveToAreaEventHandler(RequestAreaArgs args);
[Signal]
public delegate void AreaChangedEventHandler(Scenes.Map map);
[Signal]
public delegate void PlayerDeathEventHandler(HurtArgs args);

View File

@ -11,7 +11,7 @@
[ext_resource type="PackedScene" uid="uid://dldnp8eunxj3q" path="res://BoundingBoxes/InteractionTrigger.tscn" id="9_3401j"]
[ext_resource type="Script" path="res://BoundingBoxes/ConnectorBox.cs" id="9_fg062"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pg4a6"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7dryp"]
resource_local_to_scene = true
shader = ExtResource("5_h8k5p")
shader_parameter/color = Vector4(1, 1, 1, 1)
@ -113,7 +113,7 @@ visible = false
position = Vector2(120, -112)
[node name="Doc" parent="Entities" index="0" instance=ExtResource("4_ej0f3")]
material = SubResource("ShaderMaterial_pg4a6")
material = SubResource("ShaderMaterial_7dryp")
[node name="PointLight2D" type="PointLight2D" parent="Entities" index="1"]
position = Vector2(168, -42)

View File

@ -161,70 +161,70 @@ size = Vector2(64, 97)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5pcme"]
size = Vector2(18, 6)
[sub_resource type="ShaderMaterial" id="ShaderMaterial_vw5b5"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1q1be"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_8p2xl"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_obny8"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ndk4b"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_exlka"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_yll4k"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ec2v5"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_yuyxc"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ohpa0"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ecd57"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_aiu1q"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ewmj1"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bf84d"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_k255s"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7skkn"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4sns8"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_soae1"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
shader_parameter/intensity = 0.0
shader_parameter/alpha_modulate = 1.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_w1raa"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_to8fm"]
resource_local_to_scene = true
shader = ExtResource("28_b3suq")
shader_parameter/color = Vector4(1, 1, 1, 1)
@ -241,8 +241,8 @@ layer_4/tile_data = PackedInt32Array(2097150, 655360, 2, 2359293, 655360, 1, 235
CameraLowerBound = Vector2(0, 0)
CameraUpperBound = Vector2(0, 0)
ClearColor = Color(0.105882, 0.0470588, 0.117647, 1)
AreaName = "Depths of the Arena"
MapName = "The Arena"
AreaName = "The Arena"
MapName = "Depths of the Arena"
[node name="CanvasModulate" parent="." index="0"]
color = Color(0.5, 0.5, 0.5, 1)
@ -677,43 +677,43 @@ position = Vector2(256, -9)
position = Vector2(80, 373)
[node name="Centurion" parent="Entities" index="7" instance=ExtResource("30_qfl2k")]
material = SubResource("ShaderMaterial_vw5b5")
material = SubResource("ShaderMaterial_1q1be")
position = Vector2(-360, 31)
[node name="Centurion2" parent="Entities" index="8" instance=ExtResource("30_qfl2k")]
material = SubResource("ShaderMaterial_8p2xl")
material = SubResource("ShaderMaterial_obny8")
position = Vector2(-224, 131)
[node name="Legionary" parent="Entities" index="9" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_ndk4b")
material = SubResource("ShaderMaterial_exlka")
position = Vector2(-214, 72)
[node name="Legionary2" parent="Entities" index="10" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_yll4k")
material = SubResource("ShaderMaterial_ec2v5")
position = Vector2(-496, 15)
[node name="Legionary3" parent="Entities" index="11" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_yuyxc")
material = SubResource("ShaderMaterial_ohpa0")
position = Vector2(-240, 152)
[node name="Legionary4" parent="Entities" index="12" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_ecd57")
material = SubResource("ShaderMaterial_aiu1q")
position = Vector2(-300, 384)
[node name="Legionary5" parent="Entities" index="13" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_ewmj1")
material = SubResource("ShaderMaterial_bf84d")
position = Vector2(-300, 401)
[node name="Legionary6" parent="Entities" index="14" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_k255s")
material = SubResource("ShaderMaterial_7skkn")
position = Vector2(-316, 425)
[node name="Legionary7" parent="Entities" index="15" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_4sns8")
material = SubResource("ShaderMaterial_soae1")
position = Vector2(-300, 449)
[node name="Legionary8" parent="Entities" index="16" instance=ExtResource("27_84gw4")]
material = SubResource("ShaderMaterial_w1raa")
material = SubResource("ShaderMaterial_to8fm")
position = Vector2(-404, 505)
[editable path="Props/StaticBookshelf"]

View File

@ -0,0 +1,11 @@
shader_type canvas_item;
uniform float amount : hint_range(0.5, 1.0, 0.01) = 1;
void fragment() {
// Place fragment code here.
//COLOR = texture(TEXTURE, UV);
if (UV.x > amount || UV.x < 1.0 - amount) {
COLOR.a = 0.0;
}
}

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://c271rdjhd1gfo"]
[gd_scene load_steps=6 format=3 uid="uid://c271rdjhd1gfo"]
[ext_resource type="PackedScene" uid="uid://73jm5qjy52vq" path="res://Dialogue/balloon.tscn" id="1_atjb1"]
[ext_resource type="Script" path="res://UI/UIController.cs" id="2_b4b6l"]
[ext_resource type="PackedScene" uid="uid://bxo553hblp6nf" path="res://UI/HealthBar.tscn" id="3_j1j6h"]
[ext_resource type="PackedScene" uid="uid://01d24ij5av1y" path="res://UI/BossBar.tscn" id="4_igi28"]
[ext_resource type="PackedScene" uid="uid://c77754nvmckn" path="res://UI/LocationDisplay.tscn" id="5_cr6vo"]
[node name="BaseUI" type="CanvasLayer"]
@ -71,7 +72,4 @@ alignment = 1
visible = false
layout_mode = 2
[node name="Location" type="Control" parent="SubViewportContainer/UIViewport/MainUILayer/Main"]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="LocationDisplay" parent="SubViewportContainer/UIViewport/MainUILayer" instance=ExtResource("5_cr6vo")]

View File

@ -0,0 +1,32 @@
using Godot;
using SupaLidlGame.Extensions;
namespace SupaLidlGame.UI;
public partial class LocationDisplay : CenterContainer
{
private Label _mapName;
private Label _subtitle;
private AnimationPlayer _animPlayer;
public override void _Ready()
{
_mapName = GetNode<Label>("%MapName");
_subtitle = GetNode<Label>("%Subtitle");
_animPlayer = GetNode<AnimationPlayer>("%AnimationPlayer");
var bus = this.GetEventBus();
bus.AreaChanged += OnAreaChanged;
}
public void OnAreaChanged(Scenes.Map map)
{
//var map = args.Map;
// if the area name is the same as the map name, do not show a subtitle
_subtitle.Visible = map.AreaName != map.MapName;
_mapName.Text = map.MapName;
_subtitle.Text = map.AreaName;
_animPlayer.Play("show");
}
}

View File

@ -0,0 +1,218 @@
[gd_scene load_steps=12 format=3 uid="uid://c77754nvmckn"]
[ext_resource type="Texture2D" uid="uid://cd8ak8gu0104t" path="res://Assets/Sprites/UI/border.png" id="1_bjspn"]
[ext_resource type="Script" path="res://UI/LocationDisplay.cs" id="1_g1mdf"]
[ext_resource type="Shader" path="res://Shaders/Wipe.gdshader" id="2_5k5hi"]
[ext_resource type="Texture2D" uid="uid://t467i5xou4ug" path="res://Assets/Sprites/UI/menu-center.png" id="2_by7yu"]
[ext_resource type="Theme" uid="uid://cksjbu3vrup5" path="res://UI/Themes/supalidl.tres" id="2_oifrp"]
[ext_resource type="FontFile" uid="uid://6bvgjbmqovau" path="res://Assets/Fonts/calamity/calamity.ttf" id="4_blqpy"]
[ext_resource type="FontFile" uid="uid://cgwa8bjiyv534" path="res://Assets/Fonts/alagard.ttf" id="4_gutht"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4mc54"]
shader = ExtResource("2_5k5hi")
shader_parameter/amount = 0.5
[sub_resource type="Animation" id="Animation_acam2"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("NinePatchRect:material:shader_parameter/amount")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.5]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("VBoxContainer:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("VBoxContainer/MapName:visible_ratio")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("%Subtitle:visible_ratio")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("..:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
}
[sub_resource type="Animation" id="Animation_3cm2m"]
resource_name = "show"
length = 8.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("NinePatchRect:material:shader_parameter/amount")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(2, 3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.5, 1.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("VBoxContainer:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(2, 3, 4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("VBoxContainer/MapName:visible_ratio")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(2, 3, 4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [0.0, 0.0, 1.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("%Subtitle:visible_ratio")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(2, 4.5, 5.5),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [0.0, 0.0, 1.0]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("..:modulate")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(2, 6, 8),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_qq8ub"]
_data = {
"RESET": SubResource("Animation_acam2"),
"show": SubResource("Animation_3cm2m")
}
[node name="LocationDisplay" type="CenterContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_g1mdf")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 0
[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer"]
material = SubResource("ShaderMaterial_4mc54")
custom_minimum_size = Vector2(96, 0)
layout_mode = 2
texture = ExtResource("1_bjspn")
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/NinePatchRect"]
use_parent_material = true
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -32.0
offset_top = -8.0
offset_right = 32.0
offset_bottom = 8.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_by7yu")
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/separation = 0
[node name="MapName" type="Label" parent="VBoxContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("2_oifrp")
theme_override_fonts/font = ExtResource("4_blqpy")
theme_override_font_sizes/font_size = 15
text = "Depths of the Arena"
horizontal_alignment = 1
visible_characters = 0
visible_ratio = 0.0
[node name="Subtitle" type="Label" parent="VBoxContainer/VBoxContainer"]
unique_name_in_owner = true
texture_filter = 1
layout_mode = 2
theme = ExtResource("2_oifrp")
theme_override_constants/line_spacing = -1
theme_override_fonts/font = ExtResource("4_gutht")
theme_override_font_sizes/font_size = 16
text = "The Arena"
horizontal_alignment = 1
visible_characters = 0
visible_ratio = 0.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="VBoxContainer"]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_qq8ub")
}

View File

@ -152,6 +152,8 @@ public partial class World : Node
CurrentMap.Active = true;
CurrentMap.Load();
EventBus.EmitSignal(Events.EventBus.SignalName.AreaChanged, map);
if (CurrentPlayer is not null)
{
CurrentMap.Entities.AddChild(CurrentPlayer);