Dev 0.1.0
* Ajout des logs et de la radio
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cv6b8o1japsgx"
|
||||
path="res://.godot/imported/stw-radio-off.png-de46f9eb366f33b09c3f6d86d07af7d2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/radio/assets/stw-radio-off.png"
|
||||
dest_files=["res://.godot/imported/stw-radio-off.png-de46f9eb366f33b09c3f6d86d07af7d2.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
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ekv3inpghk8v"
|
||||
path="res://.godot/imported/stw-radio-on.png-c8c166dea31c365e338b7f53b1fb8ee1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/interactables/radio/assets/stw-radio-on.png"
|
||||
dest_files=["res://.godot/imported/stw-radio-on.png-c8c166dea31c365e338b7f53b1fb8ee1.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
|
||||
@@ -0,0 +1,35 @@
|
||||
[gd_scene format=3 uid="uid://bj2ydmpsenhw3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://il6l5xowbfex" path="res://entities/interactables/radio/scripts/radio.gd" id="1_al5wv"]
|
||||
[ext_resource type="Texture2D" uid="uid://cv6b8o1japsgx" path="res://entities/interactables/radio/assets/stw-radio-off.png" id="2_pt2bg"]
|
||||
[ext_resource type="Texture2D" uid="uid://ekv3inpghk8v" path="res://entities/interactables/radio/assets/stw-radio-on.png" id="3_nhf2c"]
|
||||
[ext_resource type="PackedScene" uid="uid://bf5viaiuq62f0" path="res://gui/game/log_screen/log_screen.tscn" id="4_pt2bg"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_02gnk"]
|
||||
radius = 39.115215
|
||||
|
||||
[node name="Radio" type="Area2D" unique_id=746863756]
|
||||
script = ExtResource("1_al5wv")
|
||||
default_interact_text = "LISTEN_MESSAGE"
|
||||
default_info_title = "RADIO"
|
||||
default_info_desc = "RADIO_DESC_TEXT"
|
||||
metadata/_custom_type_script = "uid://dyprcd68fjstf"
|
||||
|
||||
[node name="SpriteUnread" type="Sprite2D" parent="." unique_id=1138156739]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -11.999999)
|
||||
scale = Vector2(0.22388546, 0.22388546)
|
||||
texture = ExtResource("3_nhf2c")
|
||||
|
||||
[node name="SpriteRead" type="Sprite2D" parent="." unique_id=1717216726]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -11.999999)
|
||||
scale = Vector2(0.22388546, 0.22388546)
|
||||
texture = ExtResource("2_pt2bg")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=573068971]
|
||||
position = Vector2(0, -11.999998)
|
||||
shape = SubResource("CircleShape2D_02gnk")
|
||||
|
||||
[node name="LogScreen" parent="." unique_id=1955577551 instance=ExtResource("4_pt2bg")]
|
||||
unique_name_in_owner = true
|
||||
@@ -0,0 +1,58 @@
|
||||
extends Interactable
|
||||
class_name Radio
|
||||
|
||||
@onready var log_screen : LogScreen = %LogScreen
|
||||
|
||||
var radio_log : StoryStep.Log = null : set = set_radio_log
|
||||
var unread := true : set = set_unread
|
||||
|
||||
func _ready():
|
||||
var story_step := GameInfo.game_data.progression_data.get_story_step()
|
||||
|
||||
if len(story_step.get_logs()):
|
||||
radio_log = story_step.get_logs().pick_random()
|
||||
|
||||
if radio_log:
|
||||
unread = not radio_log.key in GameInfo.game_data.logs_read
|
||||
available = true
|
||||
else:
|
||||
hide()
|
||||
available = false
|
||||
|
||||
set_radio_log()
|
||||
set_unread()
|
||||
|
||||
func interact(_p : Player) -> bool:
|
||||
interacted.emit(_p)
|
||||
if radio_log :
|
||||
unread = false
|
||||
AudioManager.play_sfx("MessageEnter")
|
||||
|
||||
GameInfo.game_data.logs_read.append(radio_log.key)
|
||||
log_screen.appear()
|
||||
region.player.controlling_player = false
|
||||
Pointer.action_disabled = true
|
||||
log_screen.disappeared.connect(
|
||||
func():
|
||||
region.player.controlling_player = true
|
||||
get_tree().create_timer(0.2).timeout.connect( # Put a delay to not interfere with the ok button click
|
||||
func():
|
||||
Pointer.action_disabled = false
|
||||
)
|
||||
AudioManager.play_sfx("MessageExit")
|
||||
)
|
||||
return true
|
||||
return false
|
||||
|
||||
func set_radio_log(v := radio_log):
|
||||
radio_log = v
|
||||
if is_node_ready() and radio_log:
|
||||
log_screen.log_text = radio_log.text
|
||||
log_screen.log_title = radio_log.title
|
||||
|
||||
func set_unread(v := unread):
|
||||
unread = v
|
||||
if is_node_ready():
|
||||
%SpriteUnread.visible = unread
|
||||
%SpriteRead.visible = not unread
|
||||
default_info_title = "RADIO" if unread else "RADIO_READ"
|
||||
@@ -0,0 +1 @@
|
||||
uid://il6l5xowbfex
|
||||
@@ -15,7 +15,7 @@ const DOOR_ICON = preload("res://common/icons/logout.svg")
|
||||
const PLANT_ICON = preload("res://common/icons/seedling.svg")
|
||||
const SOUND_SOURCE : AudioStreamMP3 = preload("res://common/audio_manager/assets/sfx/signal/signal.mp3")
|
||||
const SOUND_BASE_PITCH = 1.
|
||||
const SOUND_NIVEL_LEVEL = 8
|
||||
const SOUND_NIVEL_LEVEL = 20
|
||||
|
||||
const CELL_DETECTION_MAX_DISTANCE = 3000.
|
||||
const CELL_DETECTION_COLOR : Color = Color("#ff006e")
|
||||
@@ -49,7 +49,8 @@ func _init(region : Region, pos : Vector2):
|
||||
)
|
||||
if (
|
||||
(e is EnergyCell
|
||||
or e is TalionCell)
|
||||
or e is TalionCell
|
||||
or (e is Radio and e.unread))
|
||||
and e.available
|
||||
and e.global_position.distance_to(pos) < nearest_cell_distance
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user