Compare commits
4 Commits
cb4dd41358
...
main
Author | SHA1 | Date | |
---|---|---|---|
e3330c7f42
|
|||
9e3b595f71
|
|||
69a918d4ec
|
|||
db3ee3a685
|
@ -24,6 +24,7 @@ func connect_events():
|
|||||||
%Client.upload_changed.connect(ui.network.set_upload)
|
%Client.upload_changed.connect(ui.network.set_upload)
|
||||||
|
|
||||||
%Chat.message_received.connect(ui.chat.add_message)
|
%Chat.message_received.connect(ui.chat.add_message)
|
||||||
|
%Chat.message_received.connect(show_chat_bubble)
|
||||||
ui.chat.message_submitted.connect( %Chat.send_message)
|
ui.chat.message_submitted.connect( %Chat.send_message)
|
||||||
|
|
||||||
func start():
|
func start():
|
||||||
@ -45,6 +46,9 @@ func start_offline():
|
|||||||
func start_online():
|
func start_online():
|
||||||
%Login.send_login()
|
%Login.send_login()
|
||||||
|
|
||||||
|
func show_chat_bubble(player: Player, message: String):
|
||||||
|
player.chat.show_message(message)
|
||||||
|
|
||||||
func pause(enabled: bool):
|
func pause(enabled: bool):
|
||||||
get_tree().paused = enabled
|
get_tree().paused = enabled
|
||||||
Audio.mute(enabled)
|
Audio.mute(enabled)
|
||||||
|
15
client/audio/Audio.gd
Normal file
15
client/audio/Audio.gd
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
var ui: AudioStreamPlayer
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
ui = $UI
|
||||||
|
assert(ui)
|
||||||
|
|
||||||
|
func play_ui(stream: AudioStream):
|
||||||
|
ui.stream = stream
|
||||||
|
ui.play()
|
||||||
|
|
||||||
|
func mute(enabled: bool):
|
||||||
|
var master_sound = AudioServer.get_bus_index("Master")
|
||||||
|
AudioServer.set_bus_mute(master_sound, enabled)
|
19
client/audio/Audio.tscn
Normal file
19
client/audio/Audio.tscn
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://ev7uecbluell"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://audio/Audio.gd" id="1_nv42i"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://b36mntcqlt553" path="res://assets/audio/ambience/Wind-Vegetation-Leaves-Gusts.wav" id="2_fkia1"]
|
||||||
|
|
||||||
|
[node name="Audio" type="Node"]
|
||||||
|
process_thread_group = 2
|
||||||
|
process_thread_group_order = 0
|
||||||
|
process_thread_messages = 0
|
||||||
|
script = ExtResource("1_nv42i")
|
||||||
|
|
||||||
|
[node name="Ambience" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource("2_fkia1")
|
||||||
|
autoplay = true
|
||||||
|
bus = &"Ambience"
|
||||||
|
|
||||||
|
[node name="UI" type="AudioStreamPlayer" parent="."]
|
||||||
|
max_polyphony = 3
|
||||||
|
bus = &"UI"
|
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=14 format=3 uid="uid://cb2t7bvvf3gwh"]
|
[gd_scene load_steps=14 format=3 uid="uid://cb2t7bvvf3gwh"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b358op5h1y83m" path="res://assets/slime/Slime.blend" id="1_1h1hj"]
|
[ext_resource type="PackedScene" uid="uid://b358op5h1y83m" path="res://assets/enemies/slime/Slime.blend" id="1_1h1hj"]
|
||||||
[ext_resource type="Script" path="res://enemy/Enemy.gd" id="1_r5888"]
|
[ext_resource type="Script" path="res://enemy/Enemy.gd" id="1_r5888"]
|
||||||
[ext_resource type="PackedScene" uid="uid://2bbycjulf00g" path="res://player/health/HealthComponent.tscn" id="2_fsqxc"]
|
[ext_resource type="PackedScene" uid="uid://2bbycjulf00g" path="res://player/health/HealthComponent.tscn" id="2_fsqxc"]
|
||||||
[ext_resource type="PackedScene" uid="uid://x102pryt2s5a" path="res://player/movement/MovementComponent.tscn" id="3_2phqx"]
|
[ext_resource type="PackedScene" uid="uid://x102pryt2s5a" path="res://player/movement/MovementComponent.tscn" id="3_2phqx"]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=14 format=3 uid="uid://dl4vcp04t8iyr"]
|
[gd_scene load_steps=14 format=3 uid="uid://dl4vcp04t8iyr"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://cdoxs0s8xh1b3" path="res://particle/FadeOut.tres" id="1_dd0n2"]
|
[ext_resource type="Texture2D" uid="uid://cdoxs0s8xh1b3" path="res://particle/FadeOut.tres" id="1_dd0n2"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c3wx3cgn8x62m" path="res://assets/particles/particles-single.png" id="1_hhudy"]
|
[ext_resource type="Texture2D" uid="uid://c3wx3cgn8x62m" path="res://assets/effects/particles/particles-single.png" id="1_hhudy"]
|
||||||
[ext_resource type="Script" path="res://item/soul/Soul.gd" id="1_mm7cb"]
|
[ext_resource type="Script" path="res://item/soul/Soul.gd" id="1_mm7cb"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cfkwtmj6tc3wa" path="res://item/soul/color_ramp.tres" id="3_ibw0j"]
|
[ext_resource type="Texture2D" uid="uid://cfkwtmj6tc3wa" path="res://item/soul/color_ramp.tres" id="3_ibw0j"]
|
||||||
[ext_resource type="AudioStream" uid="uid://l6d76tn8ys5n" path="res://assets/audio/effects/Games-Video-Event-Collect-Item.wav" id="5_cxtbb"]
|
[ext_resource type="AudioStream" uid="uid://l6d76tn8ys5n" path="res://assets/audio/effects/Games-Video-Event-Collect-Item.wav" id="5_cxtbb"]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
extends PacketHandler
|
extends PacketHandler
|
||||||
|
|
||||||
signal message_received(message: String)
|
signal message_received(player: Player, message: String)
|
||||||
|
|
||||||
func send_message(message: String):
|
func send_message(message: String):
|
||||||
var buffer := StreamPeerBuffer.new()
|
var buffer := StreamPeerBuffer.new()
|
||||||
@ -14,10 +14,18 @@ func handle_packet(data: PackedByteArray):
|
|||||||
|
|
||||||
var player_id := buffer.get_string()
|
var player_id := buffer.get_string()
|
||||||
var player := Global.players.get_player(player_id)
|
var player := Global.players.get_player(player_id)
|
||||||
|
|
||||||
|
if !player:
|
||||||
|
return
|
||||||
|
|
||||||
var message := buffer.get_utf8_string()
|
var message := buffer.get_utf8_string()
|
||||||
|
message = escape_bbcode(message)
|
||||||
|
|
||||||
Log.info("%s: %s" % [player.name, message])
|
Log.info("%s: %s" % [player.name, message])
|
||||||
message_received.emit("[color=#e0e0e0]%s:[/color] %s" % [player.name, escape_bbcode(message)])
|
emit.call_deferred(player, message)
|
||||||
|
|
||||||
|
func emit(player: Player, message: String):
|
||||||
|
message_received.emit(player, message)
|
||||||
|
|
||||||
func escape_bbcode(text: String) -> String:
|
func escape_bbcode(text: String) -> String:
|
||||||
return text.replace("[", "[lb]")
|
return text.replace("[", "[lb]")
|
||||||
|
@ -10,12 +10,18 @@ func handle_packet(data: PackedByteArray):
|
|||||||
var error := buffer.get_8()
|
var error := buffer.get_8()
|
||||||
if error != 0:
|
if error != 0:
|
||||||
Log.info("[%s] Login failed." % Global.account.name)
|
Log.info("[%s] Login failed." % Global.account.name)
|
||||||
failure.emit()
|
emit_failure.call_deferred()
|
||||||
return
|
return
|
||||||
|
|
||||||
Global.account.id = buffer.get_string()
|
Global.account.id = buffer.get_string()
|
||||||
Global.account.auth_token = buffer.get_string()
|
Global.account.auth_token = buffer.get_string()
|
||||||
|
|
||||||
|
emit_success.call_deferred()
|
||||||
|
|
||||||
|
func emit_failure():
|
||||||
|
failure.emit()
|
||||||
|
|
||||||
|
func emit_success():
|
||||||
success.emit()
|
success.emit()
|
||||||
|
|
||||||
func send_login():
|
func send_login():
|
||||||
|
@ -4,6 +4,9 @@ signal success
|
|||||||
|
|
||||||
func handle_packet(_data: PackedByteArray):
|
func handle_packet(_data: PackedByteArray):
|
||||||
logout()
|
logout()
|
||||||
|
emit.call_deferred()
|
||||||
|
|
||||||
|
func emit():
|
||||||
success.emit()
|
success.emit()
|
||||||
|
|
||||||
func logout():
|
func logout():
|
||||||
|
@ -9,7 +9,6 @@ var history: Array[float] = []
|
|||||||
|
|
||||||
func _init():
|
func _init():
|
||||||
history.resize(HISTORY_SIZE)
|
history.resize(HISTORY_SIZE)
|
||||||
thread_safe = true
|
|
||||||
|
|
||||||
func handle_packet(data: PackedByteArray):
|
func handle_packet(data: PackedByteArray):
|
||||||
var id := data[0]
|
var id := data[0]
|
||||||
|
@ -21,7 +21,7 @@ func handle_packet(data: PackedByteArray):
|
|||||||
|
|
||||||
Log.info("Add player: %s %s @ %v" % [player_id, player_name, server_position])
|
Log.info("Add player: %s %s @ %v" % [player_id, player_name, server_position])
|
||||||
|
|
||||||
spawn_player(player_id, player_name, server_position)
|
spawn_player.call_deferred(player_id, player_name, server_position)
|
||||||
|
|
||||||
func spawn_player(id: String, nick: String, position: Vector3) -> Player:
|
func spawn_player(id: String, nick: String, position: Vector3) -> Player:
|
||||||
var player: Player
|
var player: Player
|
||||||
|
@ -18,7 +18,10 @@ func handle_packet(data: PackedByteArray):
|
|||||||
var player_id := data.get_string_from_ascii()
|
var player_id := data.get_string_from_ascii()
|
||||||
var player := Global.players.get_player(player_id)
|
var player := Global.players.get_player(player_id)
|
||||||
|
|
||||||
if !player:
|
if !player || !player.controller:
|
||||||
return
|
return
|
||||||
|
|
||||||
player.controller.jumped.emit()
|
emit.call_deferred(player.controller)
|
||||||
|
|
||||||
|
func emit(controller: Controller):
|
||||||
|
controller.jumped.emit()
|
||||||
|
@ -34,7 +34,10 @@ func handle_packet(data: PackedByteArray):
|
|||||||
|
|
||||||
controller.server_position.x = x
|
controller.server_position.x = x
|
||||||
controller.server_position.z = z
|
controller.server_position.z = z
|
||||||
controller.direction_changed.emit(Vector3(direction_x, 0, direction_z))
|
emit.call_deferred(controller, Vector3(direction_x, 0, direction_z))
|
||||||
|
|
||||||
|
func emit(controller: Controller, direction: Vector3):
|
||||||
|
controller.direction_changed.emit(direction)
|
||||||
|
|
||||||
func _process(_delta: float):
|
func _process(_delta: float):
|
||||||
if !Global.player:
|
if !Global.player:
|
||||||
|
@ -22,6 +22,12 @@ func handle_packet(data: PackedByteArray):
|
|||||||
var player_id_length := buffer.get_size() - 1
|
var player_id_length := buffer.get_size() - 1
|
||||||
var player_id := buffer.get_string(player_id_length)
|
var player_id := buffer.get_string(player_id_length)
|
||||||
var slot := buffer.get_u8()
|
var slot := buffer.get_u8()
|
||||||
|
|
||||||
var player := Global.players.get_player(player_id)
|
var player := Global.players.get_player(player_id)
|
||||||
player.controller.used_skill.emit(slot)
|
|
||||||
|
if !player || !player.controller:
|
||||||
|
return
|
||||||
|
|
||||||
|
emit.call_deferred(player.controller, slot)
|
||||||
|
|
||||||
|
func emit(controller: Controller, slot: int):
|
||||||
|
controller.used_skill.emit(slot)
|
||||||
|
@ -21,9 +21,5 @@ func handle_packet(packet: PackedByteArray):
|
|||||||
push_warning("Unknown packet type %d" % type)
|
push_warning("Unknown packet type %d" % type)
|
||||||
return
|
return
|
||||||
|
|
||||||
if handler.thread_safe:
|
handler.handle_packet(packet.slice(1))
|
||||||
handler.handle_packet(packet.slice(1))
|
|
||||||
else:
|
|
||||||
handler.handle_packet.call_deferred(packet.slice(1))
|
|
||||||
|
|
||||||
download += packet.size()
|
download += packet.size()
|
||||||
|
@ -16,7 +16,5 @@ enum Packet {
|
|||||||
|
|
||||||
@export var packet_type: Packet
|
@export var packet_type: Packet
|
||||||
|
|
||||||
var thread_safe: bool
|
|
||||||
|
|
||||||
func handle_packet(_data: PackedByteArray):
|
func handle_packet(_data: PackedByteArray):
|
||||||
pass
|
pass
|
@ -10,6 +10,7 @@ var state: StateComponent
|
|||||||
var performance: PerformanceComponent
|
var performance: PerformanceComponent
|
||||||
var animation: AnimationComponent
|
var animation: AnimationComponent
|
||||||
var physics: CharacterBody3D
|
var physics: CharacterBody3D
|
||||||
|
var chat: ChatComponent
|
||||||
|
|
||||||
func _enter_tree():
|
func _enter_tree():
|
||||||
movement = $Movement
|
movement = $Movement
|
||||||
@ -17,6 +18,7 @@ func _enter_tree():
|
|||||||
performance = $Performance
|
performance = $Performance
|
||||||
animation = $Animation
|
animation = $Animation
|
||||||
physics = $Physics
|
physics = $Physics
|
||||||
|
chat = $Chat
|
||||||
|
|
||||||
## Name
|
## Name
|
||||||
signal name_changed(new_name: String)
|
signal name_changed(new_name: String)
|
||||||
|
@ -1,21 +1,22 @@
|
|||||||
[gd_scene load_steps=32 format=3 uid="uid://2lcnu3dy54lx"]
|
[gd_scene load_steps=33 format=3 uid="uid://2lcnu3dy54lx"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://player/Player.gd" id="1_8gebs"]
|
[ext_resource type="Script" path="res://player/Player.gd" id="1_8gebs"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c8j7t4yg7anb0" path="res://assets/female/Female.blend" id="2_8nah6"]
|
[ext_resource type="PackedScene" uid="uid://c8j7t4yg7anb0" path="res://assets/character/female/Female.blend" id="2_8nah6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://2bbycjulf00g" path="res://player/health/HealthComponent.tscn" id="2_np5ag"]
|
[ext_resource type="PackedScene" uid="uid://2bbycjulf00g" path="res://player/health/HealthComponent.tscn" id="2_np5ag"]
|
||||||
[ext_resource type="Resource" uid="uid://yaq8ui3f6fwa" path="res://skill/slash/slash.tres" id="2_x58e1"]
|
[ext_resource type="Resource" uid="uid://yaq8ui3f6fwa" path="res://skill/slash/slash.tres" id="2_x58e1"]
|
||||||
[ext_resource type="Resource" uid="uid://ba1filjaldakv" path="res://skill/spin/spin.tres" id="3_l76ly"]
|
[ext_resource type="Resource" uid="uid://ba1filjaldakv" path="res://skill/spin/spin.tres" id="3_l76ly"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cgqbkj8wbcatv" path="res://assets/hair/PonyTail.blend" id="3_umw6q"]
|
[ext_resource type="PackedScene" uid="uid://cgqbkj8wbcatv" path="res://assets/character/hairstyles/ponytail/PonyTail.blend" id="3_umw6q"]
|
||||||
[ext_resource type="Skin" uid="uid://bbqyiue1vj37f" path="res://assets/hoodie/Hoodie_Skin.tres" id="4_b1tg1"]
|
[ext_resource type="Skin" uid="uid://bbqyiue1vj37f" path="res://assets/character/clothes/hoodie/Hoodie_Skin.tres" id="4_b1tg1"]
|
||||||
[ext_resource type="ArrayMesh" uid="uid://dbmluwi2atit" path="res://assets/hoodie/Hoodie_Mesh.res" id="5_mkrgn"]
|
[ext_resource type="ArrayMesh" uid="uid://dbmluwi2atit" path="res://assets/character/clothes/hoodie/Hoodie_Mesh.res" id="5_mkrgn"]
|
||||||
[ext_resource type="Resource" uid="uid://cnusbw23jf672" path="res://skill/dash/dash.tres" id="5_pnues"]
|
[ext_resource type="Resource" uid="uid://cnusbw23jf672" path="res://skill/dash/dash.tres" id="5_pnues"]
|
||||||
[ext_resource type="PackedScene" uid="uid://6jpnl6c4fdvo" path="res://player/hud/HUDComponent.tscn" id="7_fwgtd"]
|
[ext_resource type="PackedScene" uid="uid://6jpnl6c4fdvo" path="res://player/hud/HUDComponent.tscn" id="7_fwgtd"]
|
||||||
[ext_resource type="PackedScene" uid="uid://qecdmrg6mbws" path="res://assets/swords/heirloom/Heirloom.blend" id="7_u8433"]
|
[ext_resource type="PackedScene" uid="uid://qecdmrg6mbws" path="res://assets/weapons/swords/heirloom/Heirloom.blend" id="7_u8433"]
|
||||||
[ext_resource type="PackedScene" uid="uid://x102pryt2s5a" path="res://player/movement/MovementComponent.tscn" id="8_25qd0"]
|
[ext_resource type="PackedScene" uid="uid://x102pryt2s5a" path="res://player/movement/MovementComponent.tscn" id="8_25qd0"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://urt8b7grv0qq" path="res://player/chat/ChatComponent.tscn" id="8_pmnom"]
|
||||||
[ext_resource type="PackedScene" uid="uid://clnfp813k7lep" path="res://player/footsteps/FootstepsComponent.tscn" id="8_xklbo"]
|
[ext_resource type="PackedScene" uid="uid://clnfp813k7lep" path="res://player/footsteps/FootstepsComponent.tscn" id="8_xklbo"]
|
||||||
[ext_resource type="PackedScene" uid="uid://d0onbq0ad1ap4" path="res://player/rotation/RotationComponent.tscn" id="9_agxqu"]
|
[ext_resource type="PackedScene" uid="uid://d0onbq0ad1ap4" path="res://player/rotation/RotationComponent.tscn" id="9_agxqu"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bivxnxwi863o0" path="res://player/animation/AnimationComponent.tscn" id="10_bcaeg"]
|
[ext_resource type="PackedScene" uid="uid://bivxnxwi863o0" path="res://player/animation/AnimationComponent.tscn" id="10_bcaeg"]
|
||||||
[ext_resource type="AnimationLibrary" uid="uid://d4n0puibh4hyt" path="res://assets/animations/human.blend" id="11_d0e6r"]
|
[ext_resource type="AnimationLibrary" uid="uid://d4n0puibh4hyt" path="res://assets/character/animations/human.blend" id="11_d0e6r"]
|
||||||
[ext_resource type="AudioStream" uid="uid://dlqcgg8v3lvhm" path="res://assets/audio/footsteps/Footsteps-Human-Dirt-00.wav" id="12_h5nrh"]
|
[ext_resource type="AudioStream" uid="uid://dlqcgg8v3lvhm" path="res://assets/audio/footsteps/Footsteps-Human-Dirt-00.wav" id="12_h5nrh"]
|
||||||
[ext_resource type="AudioStream" uid="uid://bcn7rvvayhnib" path="res://assets/audio/footsteps/Footsteps-Human-Dirt-02.wav" id="14_6dv65"]
|
[ext_resource type="AudioStream" uid="uid://bcn7rvvayhnib" path="res://assets/audio/footsteps/Footsteps-Human-Dirt-02.wav" id="14_6dv65"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b8xf4ltqyorjv" path="res://player/skills/SkillsComponent.tscn" id="14_6idcf"]
|
[ext_resource type="PackedScene" uid="uid://b8xf4ltqyorjv" path="res://player/skills/SkillsComponent.tscn" id="14_6idcf"]
|
||||||
@ -105,12 +106,23 @@ bone_idx = 44
|
|||||||
transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0.197644, 0, 0)
|
transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0.197644, 0, 0)
|
||||||
|
|
||||||
[node name="HUD" parent="." node_paths=PackedStringArray("health") instance=ExtResource("7_fwgtd")]
|
[node name="HUD" parent="." node_paths=PackedStringArray("health") instance=ExtResource("7_fwgtd")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.8, 0)
|
||||||
|
visible = false
|
||||||
layers = 512
|
layers = 512
|
||||||
visibility_range_end = 50.0
|
visibility_range_end = 50.0
|
||||||
visibility_range_end_margin = 10.0
|
visibility_range_end_margin = 10.0
|
||||||
visibility_range_fade_mode = 1
|
visibility_range_fade_mode = 1
|
||||||
health = NodePath("../Health")
|
health = NodePath("../Health")
|
||||||
|
|
||||||
|
[node name="Chat" parent="." instance=ExtResource("8_pmnom")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.37, 0)
|
||||||
|
visible = false
|
||||||
|
layers = 512
|
||||||
|
visibility_range_end = 50.0
|
||||||
|
visibility_range_end_margin = 10.0
|
||||||
|
visibility_range_fade_mode = 1
|
||||||
|
offset = Vector2(200, -44)
|
||||||
|
|
||||||
[node name="Attractor" type="GPUParticlesAttractorSphere3D" parent="."]
|
[node name="Attractor" type="GPUParticlesAttractorSphere3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
strength = 15.0
|
strength = 15.0
|
||||||
|
10
client/player/chat/ChatBubble.gd
Normal file
10
client/player/chat/ChatBubble.gd
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class_name ChatBubble
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
var label: Label
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
label = %Label
|
||||||
|
|
||||||
|
func show_message(message: String):
|
||||||
|
label.text = message
|
46
client/player/chat/ChatBubble.tscn
Normal file
46
client/player/chat/ChatBubble.tscn
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://epb22atgo7af"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://player/chat/ChatBubble.gd" id="1_dscmj"]
|
||||||
|
[ext_resource type="LabelSettings" uid="uid://cvqtha83d263j" path="res://player/chat/LabelSettings.tres" id="1_u5tc1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d22tgtevi4ukp" path="res://assets/ui/chat/speech-bubble-blur.png" id="2_e5alo"]
|
||||||
|
|
||||||
|
[node name="ChatBubble" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_dscmj")
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 2
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = -512.0
|
||||||
|
offset_right = 512.0
|
||||||
|
grow_vertical = 0
|
||||||
|
texture = ExtResource("2_e5alo")
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = -1
|
||||||
|
anchor_left = -0.00520833
|
||||||
|
anchor_top = 1.00556
|
||||||
|
anchor_right = 0.00885417
|
||||||
|
anchor_bottom = 0.991667
|
||||||
|
offset_left = 82.0
|
||||||
|
offset_top = -374.0
|
||||||
|
offset_right = 427.0
|
||||||
|
offset_bottom = -139.0
|
||||||
|
grow_vertical = 0
|
||||||
|
text = "I think we gotta do this in hard mode."
|
||||||
|
label_settings = ExtResource("1_u5tc1")
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
autowrap_mode = 3
|
||||||
|
clip_text = true
|
||||||
|
text_overrun_behavior = 3
|
||||||
|
metadata/_edit_use_anchors_ = true
|
46
client/player/chat/ChatComponent.gd
Normal file
46
client/player/chat/ChatComponent.gd
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
class_name ChatComponent
|
||||||
|
extends Sprite3D
|
||||||
|
|
||||||
|
@export var duration: float
|
||||||
|
@export var alpha_curve: Curve
|
||||||
|
|
||||||
|
var sub_viewport: SubViewport
|
||||||
|
var bubble: ChatBubble
|
||||||
|
var time := 0.0
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
sub_viewport = %SubViewport
|
||||||
|
bubble = %ChatBubble
|
||||||
|
|
||||||
|
assert(alpha_curve)
|
||||||
|
assert(duration > 0)
|
||||||
|
assert(sub_viewport)
|
||||||
|
assert(bubble)
|
||||||
|
|
||||||
|
texture = sub_viewport.get_texture()
|
||||||
|
|
||||||
|
func show_message(message: String):
|
||||||
|
bubble.show_message(message)
|
||||||
|
time = 0
|
||||||
|
set_enabled(true)
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
time += delta
|
||||||
|
|
||||||
|
if time > duration:
|
||||||
|
time = duration
|
||||||
|
set_enabled(false)
|
||||||
|
|
||||||
|
modulate.a = alpha_curve.sample(time / duration)
|
||||||
|
|
||||||
|
func set_enabled(enabled: bool):
|
||||||
|
visible = enabled
|
||||||
|
set_process(enabled)
|
||||||
|
|
||||||
|
match enabled:
|
||||||
|
true:
|
||||||
|
sub_viewport.render_target_clear_mode = SubViewport.CLEAR_MODE_ALWAYS
|
||||||
|
sub_viewport.render_target_update_mode = SubViewport.UPDATE_WHEN_VISIBLE
|
||||||
|
false:
|
||||||
|
sub_viewport.render_target_clear_mode = SubViewport.CLEAR_MODE_NEVER
|
||||||
|
sub_viewport.render_target_update_mode = SubViewport.UPDATE_DISABLED
|
28
client/player/chat/ChatComponent.tscn
Normal file
28
client/player/chat/ChatComponent.tscn
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://urt8b7grv0qq"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://player/chat/ChatComponent.gd" id="1_3o8hk"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://epb22atgo7af" path="res://player/chat/ChatBubble.tscn" id="2_yfr7m"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_426w0"]
|
||||||
|
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.05, 1), 0.0, 0.0, 0, 0, Vector2(0.8, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 4
|
||||||
|
|
||||||
|
[node name="Chat" type="Sprite3D"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83994, 0)
|
||||||
|
centered = false
|
||||||
|
offset = Vector2(400, -30)
|
||||||
|
pixel_size = 0.001
|
||||||
|
billboard = 1
|
||||||
|
render_priority = 1
|
||||||
|
region_rect = Rect2(0, 0, 84, 26)
|
||||||
|
script = ExtResource("1_3o8hk")
|
||||||
|
duration = 3.5
|
||||||
|
alpha_curve = SubResource("Curve_426w0")
|
||||||
|
|
||||||
|
[node name="SubViewport" type="SubViewport" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
disable_3d = true
|
||||||
|
transparent_bg = true
|
||||||
|
|
||||||
|
[node name="ChatBubble" parent="SubViewport" instance=ExtResource("2_yfr7m")]
|
||||||
|
unique_name_in_owner = true
|
6
client/player/chat/LabelSettings.tres
Normal file
6
client/player/chat/LabelSettings.tres
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[gd_resource type="LabelSettings" format=3 uid="uid://cvqtha83d263j"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
font_size = 54
|
||||||
|
font_color = Color(0.12549, 0.12549, 0.12549, 1)
|
||||||
|
shadow_color = Color(0, 0, 0, 0.12549)
|
@ -22,6 +22,7 @@ buses/default_bus_layout="res://world/AudioBusLayout.tres"
|
|||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
Global="*res://Global.tscn"
|
Global="*res://Global.tscn"
|
||||||
|
Audio="*res://audio/Audio.tscn"
|
||||||
|
|
||||||
[debug]
|
[debug]
|
||||||
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
class_name Audio
|
|
||||||
|
|
||||||
static func mute(enabled: bool):
|
|
||||||
var master_sound = AudioServer.get_bus_index("Master")
|
|
||||||
AudioServer.set_bus_mute(master_sound, enabled)
|
|
10
client/ui/button/Button.gd
Normal file
10
client/ui/button/Button.gd
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
extends Button
|
||||||
|
|
||||||
|
@export var hover: AudioStream
|
||||||
|
@export var click: AudioStream
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
assert(hover)
|
||||||
|
assert(click)
|
||||||
|
mouse_entered.connect(Audio.play_ui.bind(hover))
|
||||||
|
button_down.connect(Audio.play_ui.bind(click))
|
15
client/ui/button/Button.tscn
Normal file
15
client/ui/button/Button.tscn
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://bul4bacam6s78"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://ui/button/Button.gd" id="1_75erh"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://bxg5jpc7glw8s" path="res://assets/audio/ui/hover.wav" id="2_7ak8k"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://bfa480mk0nwj" path="res://assets/audio/ui/click.wav" id="3_o67x3"]
|
||||||
|
|
||||||
|
[node name="Button" type="Button"]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_75erh")
|
||||||
|
hover = ExtResource("2_7ak8k")
|
||||||
|
click = ExtResource("3_o67x3")
|
@ -3,5 +3,5 @@ extends VBoxContainer
|
|||||||
|
|
||||||
signal message_submitted(message: String)
|
signal message_submitted(message: String)
|
||||||
|
|
||||||
func add_message(message: String):
|
func add_message(player: Player, message: String):
|
||||||
%Messages.append_text("%s\n" % message)
|
%Messages.append_text("[color=#e0e0e0]%s:[/color] %s\n" % [player.name, message])
|
@ -26,5 +26,8 @@ func on_text_submitted(message: String):
|
|||||||
text = ""
|
text = ""
|
||||||
release_focus()
|
release_focus()
|
||||||
|
|
||||||
|
if !message:
|
||||||
|
return
|
||||||
|
|
||||||
var chat := owner as Chat
|
var chat := owner as Chat
|
||||||
chat.message_submitted.emit(message)
|
chat.message_submitted.emit(message)
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
[gd_scene load_steps=16 format=3 uid="uid://bqpbrju7mc7d5"]
|
[gd_scene load_steps=17 format=3 uid="uid://bqpbrju7mc7d5"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://ui/settings/Settings.gd" id="1_gx3lf"]
|
[ext_resource type="Script" path="res://ui/settings/Settings.gd" id="1_gx3lf"]
|
||||||
[ext_resource type="Script" path="res://ui/label/ParentNameLabel.gd" id="2_72a3s"]
|
[ext_resource type="Script" path="res://ui/label/ParentNameLabel.gd" id="2_72a3s"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bul4bacam6s78" path="res://ui/button/Button.tscn" id="3_42una"]
|
||||||
[ext_resource type="Script" path="res://ui/settings/video/Preset.gd" id="3_il1yi"]
|
[ext_resource type="Script" path="res://ui/settings/video/Preset.gd" id="3_il1yi"]
|
||||||
[ext_resource type="Script" path="res://ui/settings/video/RenderScale.gd" id="4_owrjf"]
|
[ext_resource type="Script" path="res://ui/settings/video/RenderScale.gd" id="4_owrjf"]
|
||||||
[ext_resource type="Script" path="res://ui/settings/video/ScaleMode.gd" id="5_monk2"]
|
[ext_resource type="Script" path="res://ui/settings/video/ScaleMode.gd" id="5_monk2"]
|
||||||
@ -55,17 +56,17 @@ script = ExtResource("2_72a3s")
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
[node name="Low" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
|
[node name="Low" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer" instance=ExtResource("3_42una")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
text = "Low"
|
text = "Low"
|
||||||
|
|
||||||
[node name="Medium" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
|
[node name="Medium" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer" instance=ExtResource("3_42una")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
text = "Medium"
|
text = "Medium"
|
||||||
|
|
||||||
[node name="High" type="Button" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer"]
|
[node name="High" parent="TabContainer/Video/VBoxContainer/Preset/HBoxContainer" instance=ExtResource("3_42una")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
text = "High"
|
text = "High"
|
||||||
@ -272,6 +273,9 @@ layout_mode = 2
|
|||||||
[node name="Ambience" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
[node name="Ambience" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="UI" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="Skills" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
[node name="Skills" parent="TabContainer/Audio/VBoxContainer" instance=ExtResource("14_pvo80")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
|
@ -12,4 +12,4 @@ texture_margin_left = 24.0
|
|||||||
texture_margin_top = 24.0
|
texture_margin_top = 24.0
|
||||||
texture_margin_right = 24.0
|
texture_margin_right = 24.0
|
||||||
texture_margin_bottom = 24.0
|
texture_margin_bottom = 24.0
|
||||||
modulate_color = Color(1, 1, 1, 0.752941)
|
modulate_color = Color(1, 1, 1, 0.878431)
|
||||||
|
@ -30,15 +30,21 @@ bus/4/volume_db = -12.9785
|
|||||||
bus/4/send = &"Master"
|
bus/4/send = &"Master"
|
||||||
bus/4/effect/0/effect = SubResource("AudioEffectReverb_hjj00")
|
bus/4/effect/0/effect = SubResource("AudioEffectReverb_hjj00")
|
||||||
bus/4/effect/0/enabled = true
|
bus/4/effect/0/enabled = true
|
||||||
bus/5/name = &"Footsteps"
|
bus/5/name = &"UI"
|
||||||
bus/5/solo = false
|
bus/5/solo = false
|
||||||
bus/5/mute = false
|
bus/5/mute = false
|
||||||
bus/5/bypass_fx = false
|
bus/5/bypass_fx = false
|
||||||
bus/5/volume_db = -4.5
|
bus/5/volume_db = 0.0
|
||||||
bus/5/send = &"Effects"
|
bus/5/send = &"Master"
|
||||||
bus/6/name = &"Skills"
|
bus/6/name = &"Footsteps"
|
||||||
bus/6/solo = false
|
bus/6/solo = false
|
||||||
bus/6/mute = false
|
bus/6/mute = false
|
||||||
bus/6/bypass_fx = false
|
bus/6/bypass_fx = false
|
||||||
bus/6/volume_db = 0.0
|
bus/6/volume_db = -4.5
|
||||||
bus/6/send = &"Effects"
|
bus/6/send = &"Effects"
|
||||||
|
bus/7/name = &"Skills"
|
||||||
|
bus/7/solo = false
|
||||||
|
bus/7/mute = false
|
||||||
|
bus/7/bypass_fx = false
|
||||||
|
bus/7/volume_db = 0.0
|
||||||
|
bus/7/send = &"Effects"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=19 format=3 uid="uid://be6mcpdaobs5u"]
|
[gd_scene load_steps=18 format=3 uid="uid://be6mcpdaobs5u"]
|
||||||
|
|
||||||
[ext_resource type="Terrain3DStorage" uid="uid://c38e3dyrl8lao" path="res://assets/terrain/Storage.res" id="1_xsh2l"]
|
[ext_resource type="Terrain3DStorage" uid="uid://c38e3dyrl8lao" path="res://assets/terrain/Storage.res" id="1_xsh2l"]
|
||||||
[ext_resource type="Terrain3DMaterial" uid="uid://nhcs8ekjedbb" path="res://world/terrain/Material.tres" id="2_3ekjf"]
|
[ext_resource type="Terrain3DMaterial" uid="uid://nhcs8ekjedbb" path="res://world/terrain/Material.tres" id="2_3ekjf"]
|
||||||
@ -15,7 +15,6 @@
|
|||||||
[ext_resource type="FastNoiseLite" uid="uid://d3f4lk8q04haa" path="res://world/trees/TreeNoise.tres" id="14_6v5re"]
|
[ext_resource type="FastNoiseLite" uid="uid://d3f4lk8q04haa" path="res://world/trees/TreeNoise.tres" id="14_6v5re"]
|
||||||
[ext_resource type="Environment" uid="uid://dixa0yso2s1u3" path="res://world/Environment.tres" id="16_i8t0h"]
|
[ext_resource type="Environment" uid="uid://dixa0yso2s1u3" path="res://world/Environment.tres" id="16_i8t0h"]
|
||||||
[ext_resource type="Script" path="res://world/Sun.gd" id="17_nxk5c"]
|
[ext_resource type="Script" path="res://world/Sun.gd" id="17_nxk5c"]
|
||||||
[ext_resource type="AudioStream" uid="uid://b36mntcqlt553" path="res://assets/audio/ambience/Wind-Vegetation-Leaves-Gusts.wav" id="18_8j4nl"]
|
|
||||||
|
|
||||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_yp2fx"]
|
[sub_resource type="FastNoiseLite" id="FastNoiseLite_yp2fx"]
|
||||||
seed = 100
|
seed = 100
|
||||||
@ -80,8 +79,3 @@ transform = Transform3D(-0.350207, 0.827032, -0.439741, 0, 0.469472, 0.882948, 0
|
|||||||
light_energy = 1.8
|
light_energy = 1.8
|
||||||
shadow_enabled = true
|
shadow_enabled = true
|
||||||
script = ExtResource("17_nxk5c")
|
script = ExtResource("17_nxk5c")
|
||||||
|
|
||||||
[node name="Ambience" type="AudioStreamPlayer" parent="."]
|
|
||||||
stream = ExtResource("18_8j4nl")
|
|
||||||
autoplay = true
|
|
||||||
bus = &"Ambience"
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://hvc8oecqweko"]
|
[gd_scene load_steps=3 format=3 uid="uid://hvc8oecqweko"]
|
||||||
|
|
||||||
[ext_resource type="Material" uid="uid://bdsblfaxbipaa" path="res://world/grass/GrassMaterial.tres" id="1_xchh7"]
|
[ext_resource type="Material" uid="uid://bdsblfaxbipaa" path="res://world/grass/GrassMaterial.tres" id="1_xchh7"]
|
||||||
[ext_resource type="MultiMesh" uid="uid://dog5aq5n2q025" path="res://assets/grass/grass.multimesh" id="2_cpr6g"]
|
[ext_resource type="MultiMesh" uid="uid://dog5aq5n2q025" path="res://assets/world/grass/grass.multimesh" id="2_cpr6g"]
|
||||||
|
|
||||||
[node name="Grass" type="MultiMeshInstance3D"]
|
[node name="Grass" type="MultiMeshInstance3D"]
|
||||||
layers = 2
|
layers = 2
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://djilgnhedvmtm"]
|
[gd_scene load_steps=3 format=3 uid="uid://djilgnhedvmtm"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://b0w38xjifulq6" path="res://assets/house/House.blend" id="1_0ihm4"]
|
[ext_resource type="PackedScene" uid="uid://b0w38xjifulq6" path="res://assets/world/house/House.blend" id="1_0ihm4"]
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_egbsr"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_egbsr"]
|
||||||
size = Vector3(5, 3.5, 5)
|
size = Vector3(5, 3.5, 5)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://tr0tn0pkr1ea"]
|
[gd_scene load_steps=3 format=3 uid="uid://tr0tn0pkr1ea"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://8rgrrx6wbdvf" path="res://assets/tree/Callistemon.blend" id="1_ngx2x"]
|
[ext_resource type="PackedScene" uid="uid://8rgrrx6wbdvf" path="res://assets/world/tree/Callistemon.blend" id="1_ngx2x"]
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_6f3jh"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_6f3jh"]
|
||||||
height = 1.5
|
height = 1.5
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://cuuwwdce1u8n8"]
|
[gd_scene load_steps=3 format=3 uid="uid://cuuwwdce1u8n8"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ctsrv1aeqj0h" path="res://assets/tree/Sapling.blend" id="1_lb0yq"]
|
[ext_resource type="PackedScene" uid="uid://ctsrv1aeqj0h" path="res://assets/world/tree/Sapling.blend" id="1_lb0yq"]
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_qu7ax"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_qu7ax"]
|
||||||
height = 1.5
|
height = 1.5
|
||||||
|
Reference in New Issue
Block a user