Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
28e745d
Feat: implementado cartel de nombre de zona en el mapa de Frays End
andree-git Aug 22, 2026
4577c68
fix: adjust text positioning and add animations
andree-git Aug 29, 2026
87c17bc
fix: adjust text positioning and add animations
andree-git Sep 1, 2026
d574e6c
Merge branch 'endlessm:main' into main
renato-sy Sep 1, 2026
299e3bf
fix: adjust text positioning and add animations
andree-git Sep 1, 2026
af863b7
feat: add area name and re-entry UI components with animations
andree-git Sep 1, 2026
3a08106
fix: correct variable names and ensure proper text handling in area n…
andree-git Sep 1, 2026
7362531
fix: remove redundant variable declarations and ensure proper formatt…
andree-git Sep 2, 2026
da98b3d
fix: reorder variable declarations for clarity in area name component
andree-git Sep 2, 2026
ee87210
feat: implement area unlock system with UI updates and animations
andree-git Sep 4, 2026
d2d0fde
Fix linting errors in re_entry.gd: remove comments before variables, …
renato-sy Sep 4, 2026
9035f05
Fix linting errors in area_name.gd: remove trailing whitespace and re…
renato-sy Sep 4, 2026
8f03895
feat: add area name and re-entry components with collision handling a…
andree-git Sep 6, 2026
fce350a
fix: normalize zone name for area unlock checks by removing whitespac…
andree-git Sep 6, 2026
e355dff
Merge branch 'endlessm:main' into main
renato-sy Sep 6, 2026
3bea70e
Merge branch 'endlessm:main' into main
renato-sy Sep 13, 2026
2845897
Refactor area name handling: rename scene files and update references
renato-sy Sep 14, 2026
b1c17ac
Enhance area unlock system: update signals and refactor area handling…
renato-sy Sep 15, 2026
6e73bdf
Merge branch 'endlessm:main' into main
renato-sy Sep 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions project.godot
Comment thread
renato-sy marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ SceneSwitcher="*res://scenes/globals/scene_switcher/scene_switcher.gd"
Transitions="*res://scenes/globals/scene_switcher/transitions/transitions.tscn"
Settings="*res://scenes/globals/settings/settings.gd"
MusicPlayer="*res://scenes/globals/music_player/music_player.tscn"
MenuUiPlayer="*uid://q3dc07xy31ty"
CameraShake="*res://scenes/globals/camera_shaker/camera_shake.tscn"
InputHelper="*res://addons/input_helper/input_helper.gd"
PauseOverlay="*res://scenes/globals/pause/pause_overlay.tscn"
InputHud="*res://scenes/ui_elements/input_hints/input_hud.tscn"
AspectRatioDebugger="*res://scenes/globals/aspect_ratio_debugger/aspect_ratio_debugger.tscn"
MouseManager="*res://scenes/globals/mouse_manager/mouse_manager.tscn"
PhantomCameraManager="*uid://duq6jhf6unyis"
MenuUiPlayer="*uid://q3dc07xy31ty"

[debug]

Expand Down Expand Up @@ -82,7 +82,8 @@ enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg", "res://add
folder_colors={
"res://scenes/quests/lore_quests/": "purple",
"res://scenes/quests/story_quests/": "green",
"res://scenes/quests/template_quests/NO_EDIT/": "yellow"
"res://scenes/quests/template_quests/NO_EDIT/": "yellow",
"res://temp/": "red"
}

[global_group]
Expand Down
14 changes: 14 additions & 0 deletions scenes/dev/dev_archipelago.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
[ext_resource type="Script" uid="uid://csev4hv57utxv" path="res://scenes/game_logic/walk_behaviors/character_speeds.gd" id="48_sqpij"]
[ext_resource type="AudioStream" uid="uid://c1pdyoycgyb7t" path="res://scenes/dev/components/oi.wav" id="52_rs1iu"]
[ext_resource type="Script" uid="uid://djeshbrs3vwnb" path="res://scenes/game_elements/characters/npcs/components/pet_interaction.gd" id="53_a3fwm"]
[ext_resource type="PackedScene" uid="uid://bjin4sdopq7rn" path="res://scenes/ui_elements/area_name/text_name_area.tscn" id="62_rl8sd"]
[ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="63_71pqi"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_pp1gq"]
size = Vector2(64, 64)
Expand Down Expand Up @@ -918,8 +920,20 @@ script = ExtResource("53_a3fwm")
interact_area = NodePath("../InteractArea")
sound_effect_player = NodePath("../AudioStreamPlayer2D")

[node name="TextNameArea" parent="." unique_id=1184526213 instance=ExtResource("62_rl8sd")]
zone_name = "Dev
Archipelago"

[node name="CollisionPolygon2D" parent="TextNameArea/detect" parent_id_path=PackedInt32Array(1184526213, 1821875710) index="0" unique_id=1009866314]
polygon = PackedVector2Array(-828, 1210, -558, 1204, -556, 1079, -826, 1094)

[node name="HUD" parent="." unique_id=1426591993 instance=ExtResource("63_71pqi")]
unique_name_in_owner = true

[connection signal="timeout" from="OnTheGround/Node2D/SheepVolleyball/Sheep/PlayerRepel/RepelTimer" to="OnTheGround/Node2D/SheepVolleyball/Sheep/PlayerRepel" method="repel_once"]
[connection signal="timeout" from="OnTheGround/Node2D/SheepVolleyball/Sheep2/PlayerRepel2/RepelTimer2" to="OnTheGround/Node2D/SheepVolleyball" method="_on_repel_timer_2_timeout"]
[connection signal="timeout" from="OnTheGround/Node2D/SheepVolleyball/Sheep2/PlayerRepel2/RepelTimer2" to="OnTheGround/Node2D/SheepVolleyball/Sheep2/PlayerRepel2" method="repel_once"]
[connection signal="timeout" from="OnTheGround/Node2D/SheepVolleyball/Timer" to="OnTheGround/Node2D/SheepVolleyball/Sheep/PlayerRepel/RepelTimer" method="start"]
[connection signal="timeout" from="OnTheGround/Node2D/SheepTugOfWar/TuggingSheep/Timer" to="OnTheGround/Node2D/SheepTugOfWar" method="_on_timer_timeout"]

[editable path="TextNameArea"]
24 changes: 24 additions & 0 deletions scenes/globals/game_state/global_state.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ signal completed_quests_changed
## Emitted when the [member helper] changes.
signal helper_changed

## Emitted when an area's unlock status changes.
signal area_changed(area_name: String, first_visit:bool)

## [Quest]s which the player has previously completed. Modify this with
## [method set_quest_completed_state].
@export var completed_quests: Array[Quest]
Expand Down Expand Up @@ -51,6 +54,11 @@ signal helper_changed
## can later pick up where they left off.
@export var suspended_quests: Dictionary[String, SuspendedQuestState]

## Areas unlock status
@export var unlocked_areas: Array[String]

## Current area where the player is located
@export var current_area_name: String = ""

func _validate_property(property: Dictionary) -> void:
match property.name:
Expand Down Expand Up @@ -88,3 +96,19 @@ func clear_help() -> void:
helper = null
helper_changed.emit()
emit_changed()


## Create or unlock an area.
func set_unlock_area(area_name: String) -> void:
var first_visit := area_name not in unlocked_areas

if first_visit:
unlocked_areas.append(area_name)

area_changed.emit(area_name, first_visit)
emit_changed()


## Checks if an area is currently unlocked.
func is_area_unlocked(area_name: String) -> bool:
return unlocked_areas.find(area_name)
20 changes: 20 additions & 0 deletions scenes/ui_elements/area_name/components/area_name.gd
Comment thread
renato-sy marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Node2D

@export_multiline var zone_name: String

@export_range(1, 3) var time: int = 2


func _on_detect_body_entered(body: Node2D) -> void:
if not body.is_in_group("player"):
return

if GameState.global.current_area_name == zone_name:
return

GameState.global.current_area_name = zone_name

GameState.global.set_unlock_area(zone_name)
GameState.save()
1 change: 1 addition & 0 deletions scenes/ui_elements/area_name/components/area_name.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://k6j0kcn8lb1d
64 changes: 64 additions & 0 deletions scenes/ui_elements/area_name/components/first_unlock.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends PanelContainer


func _is_player_at_bottom() -> bool:
var player := get_tree().get_first_node_in_group("player") as Node2D
if not player:
return false

var viewport := player.get_viewport()
var screen_pos: Vector2 = viewport.get_canvas_transform() * player.global_position
var viewport_size: Vector2 = viewport.get_visible_rect().size

return screen_pos.y > viewport_size.y * 3.0 / 4.0

func animate_first_unlock(zona_name: String, time: int) -> void:
var label = $Label
label.text = zona_name

# Ensure the panel is visible
show()
modulate.a = 0.0

# 1. Position based on the player
if _is_player_at_bottom():
# Stuck to the TOP, centered
set_anchors_and_offsets_preset(Control.PRESET_CENTER_TOP)
grow_vertical = Control.GROW_DIRECTION_END
position.y = 20.0
else:
# Stuck to the BOTTOM, centered (above the HUD)
set_anchors_and_offsets_preset(Control.PRESET_CENTER_BOTTOM)
grow_vertical = Control.GROW_DIRECTION_BEGIN
position.y = get_viewport_rect().size.y - size.y - 45.0

# Wait 1 frame for the UI to calculate its new size based on the text
await get_tree().process_frame

# 2. Set the pivot at the center so it scales nicely
pivot_offset = size / 2.0
scale = Vector2(0.6, 0.6) # Starts slightly smaller to scale up when appearing

# 3. FADE IN
var tween_in := create_tween().set_parallel(true)
tween_in.tween_property(self, "modulate:a", 1.0, 0.35)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_OUT)
tween_in.tween_property(self, "scale", Vector2(1.0, 1.0), 0.35)\
.set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)

await tween_in.finished

# 4. Keep visible for the requested time
await get_tree().create_timer(time).timeout

# 5. FADE OUT
var tween_out := create_tween().set_parallel(true)
tween_out.tween_property(self, "modulate:a", 0.0, 0.3)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)
tween_out.tween_property(self, "scale", Vector2(0.8, 0.8), 0.3)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)

await tween_out.finished
hide()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://c1f8uqwm124qu
50 changes: 50 additions & 0 deletions scenes/ui_elements/area_name/components/re_entry.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends PanelContainer

@export var slide_offset_y: float = 150.0 # Amount of pixels for the slide offset[cite: 5]

@onready var label: Label = $Label

var _base_target_y: float = 0.0
var _is_target_saved: bool = false


func _ready() -> void:
modulate.a = 0.0


func animate_re_entry(zona_name: String, time: int) -> void:
show()
label.text = zona_name

# Save base position if it hasn't been saved yet
if not _is_target_saved:
_base_target_y = position.y
_is_target_saved = true

var target_y: float = _base_target_y
var start_y: float = target_y - abs(slide_offset_y)

position.y = start_y
modulate.a = 0.0

# ENTRY
var tween_in := create_tween().set_parallel(true)
tween_in.tween_property(self, "position:y", target_y, 0.35)\
.set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
tween_in.tween_property(self, "modulate:a", 1.0, 0.3)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_OUT)

await get_tree().create_timer(time).timeout

# EXIT
var tween_out := create_tween().set_parallel(true)
tween_out.tween_property(self, "position:y", start_y, 0.35)\
.set_trans(Tween.TRANS_CUBIC).set_ease(Tween.EASE_IN)
tween_out.tween_property(self, "modulate:a", 0.0, 0.3)\
.set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN)

await tween_out.finished
position.y = target_y
hide()
1 change: 1 addition & 0 deletions scenes/ui_elements/area_name/components/re_entry.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://qlfg2cvfb6ia
45 changes: 45 additions & 0 deletions scenes/ui_elements/area_name/first_unlock.tscn

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like how this looks with the heavy drop shadow. Personally I think we could use the same presentation as the dialogue balloons.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I've applied the "Balloons" one. Take a look—how does the color look? Should I change it?

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[gd_scene format=3 uid="uid://ipgq27vmhsmc"]

[ext_resource type="Script" uid="uid://c1f8uqwm124qu" path="res://scenes/ui_elements/area_name/components/first_unlock.gd" id="2_1xhrb"]

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_si2rt"]
content_margin_left = 64.0
content_margin_top = 48.0
content_margin_right = 64.0
content_margin_bottom = 64.0
texture_margin_left = 64.0
texture_margin_top = 64.0
texture_margin_right = 64.0
texture_margin_bottom = 64.0
expand_margin_left = 16.0
expand_margin_top = 16.0
expand_margin_right = 16.0
expand_margin_bottom = 16.0
axis_stretch_horizontal = 1
axis_stretch_vertical = 1

[node name="FirstUnlock" type="PanelContainer" unique_id=1838469583]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -126.0
offset_top = -268.0
offset_right = 110.0
offset_bottom = -129.0
grow_horizontal = 2
grow_vertical = 2
theme_type_variation = &"NPCRibbon"
theme_override_styles/panel = SubResource("StyleBoxTexture_si2rt")
script = ExtResource("2_1xhrb")

[node name="Label" type="Label" parent="." unique_id=1726876452]
layout_mode = 2
theme_override_colors/font_color = Color(0.8980392, 0.8784314, 0.8235294, 0.88235295)
theme_override_constants/shadow_offset_x = 12
theme_override_constants/shadow_offset_y = 5
theme_override_constants/shadow_outline_size = 10
theme_override_font_sizes/font_size = 100
text = "Name Zone"
horizontal_alignment = 1
33 changes: 33 additions & 0 deletions scenes/ui_elements/area_name/re_entry.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[gd_scene format=3 uid="uid://cps4im7j5unff"]

[ext_resource type="Script" uid="uid://qlfg2cvfb6ia" path="res://scenes/ui_elements/area_name/components/re_entry.gd" id="2_7rwir"]
[ext_resource type="Theme" uid="uid://cvitou84ni7qe" path="res://scenes/ui_elements/components/theme.tres" id="2_g8ohe"]

[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_isa5i"]
content_margin_left = 64.0
content_margin_top = 25.0
content_margin_right = 64.0
content_margin_bottom = 50.0
texture_margin_left = 64.0
texture_margin_top = 64.0
texture_margin_right = 64.0
texture_margin_bottom = 64.0
expand_margin_left = 16.0
expand_margin_top = 45.0
expand_margin_right = 16.0
axis_stretch_horizontal = 1
axis_stretch_vertical = 1

[node name="ReEntry" type="PanelContainer" unique_id=775249051]
theme_override_styles/panel = SubResource("StyleBoxTexture_isa5i")
script = ExtResource("2_7rwir")

[node name="Label" type="Label" parent="." unique_id=653377466]
layout_mode = 2
theme = ExtResource("2_g8ohe")
theme_type_variation = &"HintLabel"
theme_override_colors/font_color = Color(0.8980392, 0.8784314, 0.8235294, 0.88235295)
theme_override_constants/shadow_offset_x = 4
theme_override_constants/shadow_outline_size = 2
text = "Name Zone"
horizontal_alignment = 1
16 changes: 16 additions & 0 deletions scenes/ui_elements/area_name/text_name_area.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[gd_scene format=3 uid="uid://bjin4sdopq7rn"]

[ext_resource type="Script" uid="uid://k6j0kcn8lb1d" path="res://scenes/ui_elements/area_name/components/area_name.gd" id="1_j0vm2"]

[node name="TextNameArea" type="Node2D" unique_id=1184526213]
script = ExtResource("1_j0vm2")

[node name="detect" type="Area2D" parent="." unique_id=1821875710]

[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="detect" unique_id=1009866314]

[node name="Timer" type="Timer" parent="." unique_id=53937746]
one_shot = true

[connection signal="body_entered" from="detect" to="." method="_on_detect_body_entered"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
24 changes: 24 additions & 0 deletions scenes/ui_elements/hud/components/hud.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,31 @@
extends CanvasLayer

@onready var story_quest_progress: PanelContainer = %StoryQuestProgress
@onready var re_entry: PanelContainer = %ReEntry

func _ready() -> void:
GameState.global.area_changed.connect(_on_area_changed)

func change_story_quest_progress_visibility(visibility: bool) -> void:
story_quest_progress.visible = visibility

func _on_area_changed(area_name: String, first_visit: bool) -> void:
if first_visit:
await _show_first_unlock(area_name)
else:
await show_re_entry_zone(area_name)

func _show_first_unlock(area_name: String) -> void:
var first_unlock: Control = preload(
"res://scenes/ui_elements/area_name/first_unlock.tscn"
).instantiate()

add_child(first_unlock)

await first_unlock.animate_first_unlock(area_name, 2)

first_unlock.queue_free()


func show_re_entry_zone(area_name: String) -> void:
await re_entry.animate_re_entry(area_name, 2)
16 changes: 12 additions & 4 deletions scenes/ui_elements/hud/hud.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@

[ext_resource type="PackedScene" uid="uid://cae10mh6roenk" path="res://scenes/ui_elements/story_quest_progress/story_quest_progress.tscn" id="1_7maed"]
[ext_resource type="Script" uid="uid://cqpatsiaxh1xp" path="res://scenes/ui_elements/hud/components/hud.gd" id="1_dwpju"]
[ext_resource type="PackedScene" uid="uid://cps4im7j5unff" path="res://scenes/ui_elements/area_name/re_entry.tscn" id="2_isa5i"]

[node name="HUD" type="CanvasLayer" unique_id=1426591993]
script = ExtResource("1_dwpju")

[node name="StoryQuestProgress" parent="." unique_id=373983898 instance=ExtResource("1_7maed")]
unique_name_in_owner = true
[node name="HBoxContainer" type="HBoxContainer" parent="." unique_id=1000774734]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -144.0
offset_right = 0.0
offset_left = -228.0
offset_bottom = 128.0
grow_horizontal = 0

[node name="ReEntry" parent="HBoxContainer" unique_id=775249051 instance=ExtResource("2_isa5i")]
unique_name_in_owner = true
layout_mode = 2

[node name="StoryQuestProgress" parent="HBoxContainer" unique_id=373983898 instance=ExtResource("1_7maed")]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 4
Loading