Compare commits

..

No commits in common. "trunk" and "v0.0.0-rc.4" have entirely different histories.

7 changed files with 3 additions and 97 deletions

View file

@ -5,7 +5,7 @@ lint:
-gdlint . -gdlint .
-gdformat . -gdformat .
api_version := "v0.0.0-rc.8" api_version := "v0.0.0-rc.4"
api_location := "scripts/api-client" api_location := "scripts/api-client"
generate: generate:
#!/bin/sh #!/bin/sh

View file

@ -1,9 +1,7 @@
[gd_scene load_steps=7 format=4 uid="uid://co1x3hlc2efr6"] [gd_scene load_steps=5 format=4 uid="uid://co1x3hlc2efr6"]
[ext_resource type="Script" path="res://scripts/match/ui/opponent_name.gd" id="1_saby1"] [ext_resource type="Script" path="res://scripts/match/ui/opponent_name.gd" id="1_saby1"]
[ext_resource type="Script" path="res://scripts/match/ui/player_money.gd" id="2_3jcub"]
[ext_resource type="TileSet" uid="uid://cvp867israfjk" path="res://tile_set.tres" id="3_0etcd"] [ext_resource type="TileSet" uid="uid://cvp867israfjk" path="res://tile_set.tres" id="3_0etcd"]
[ext_resource type="Script" path="res://scripts/match/ui/player_hitpoints.gd" id="3_oc5vk"]
[ext_resource type="Script" path="res://scripts/match/map.gd" id="4_4c550"] [ext_resource type="Script" path="res://scripts/match/map.gd" id="4_4c550"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_86u83"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_86u83"]
@ -36,45 +34,6 @@ scroll_active = false
autowrap_mode = 0 autowrap_mode = 0
script = ExtResource("1_saby1") script = ExtResource("1_saby1")
[node name="Money" type="RichTextLabel" parent="UI/HUD"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -582.0
offset_top = -529.0
offset_right = -436.0
offset_bottom = -484.0
grow_horizontal = 2
grow_vertical = 2
text = "Test"
fit_content = true
scroll_active = false
autowrap_mode = 0
script = ExtResource("2_3jcub")
[node name="Hitpoints" type="RichTextLabel" parent="UI/HUD"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -946.0
offset_top = 479.0
offset_right = -800.0
offset_bottom = 524.0
grow_horizontal = 2
grow_vertical = 2
text = "HP
"
fit_content = true
scroll_active = false
autowrap_mode = 0
script = ExtResource("3_oc5vk")
[node name="Seperator" type="Panel" parent="UI/HUD"] [node name="Seperator" type="Panel" parent="UI/HUD"]
custom_minimum_size = Vector2(4, 0) custom_minimum_size = Vector2(4, 0)
layout_mode = 1 layout_mode = 1

View file

@ -2,8 +2,6 @@ extends Channel
signal on_match_update(msg: TowerPlacedMessage) signal on_match_update(msg: TowerPlacedMessage)
signal on_invalid_placing(msg: InvalidPlacementMessage) signal on_invalid_placing(msg: InvalidPlacementMessage)
signal on_money_update(msg: PlayerMoneyMessage)
signal on_hitpoints_update(msg: PlayerHitpointsMessage)
func get_channel_location() -> String: func get_channel_location() -> String:
@ -19,12 +17,7 @@ func _process(_delta: float) -> void:
Message Message
. deserialize( . deserialize(
self.socket.get_packet().get_string_from_utf8(), self.socket.get_packet().get_string_from_utf8(),
[ [TowerPlacedMessage, InvalidPlacementMessage],
TowerPlacedMessage,
InvalidPlacementMessage,
PlayerMoneyMessage,
PlayerHitpointsMessage,
],
) )
) )
match msg.get_message_id(): match msg.get_message_id():
@ -32,10 +25,6 @@ func _process(_delta: float) -> void:
on_match_update.emit(msg) on_match_update.emit(msg)
InvalidPlacementMessage.MESSAGE_ID: InvalidPlacementMessage.MESSAGE_ID:
on_invalid_placing.emit(msg) on_invalid_placing.emit(msg)
PlayerMoneyMessage.MESSAGE_ID:
on_money_update.emit(msg)
PlayerHitpointsMessage.MESSAGE_ID:
on_hitpoints_update.emit(msg)
_: _:
continue continue

View file

@ -1,11 +0,0 @@
class_name PlayerHitpointsMessage
extends Message
const MESSAGE_ID: String = "PlayerHitpoints"
# gdlint:ignore = class-variable-name
@export var playerHitpoints: int
func get_message_id() -> String:
return MESSAGE_ID

View file

@ -1,11 +0,0 @@
class_name PlayerMoneyMessage
extends Message
const MESSAGE_ID: String = "PlayerMoney"
# gdlint:ignore = class-variable-name
@export var playerMoney: int
func get_message_id() -> String:
return MESSAGE_ID

View file

@ -1,10 +0,0 @@
extends RichTextLabel
func _ready() -> void:
MatchChannel.connect("on_hitpoints_update", on_hitpoints_update)
func on_hitpoints_update(msg: PlayerHitpointsMessage) -> void:
print(msg.playerHitpoints, "test")
self.text = str(msg.playerHitpoints, "HP")

View file

@ -1,10 +0,0 @@
extends RichTextLabel
func _ready() -> void:
MatchChannel.connect("on_money_update", on_money_update)
func on_money_update(msg: PlayerMoneyMessage) -> void:
print(msg.playerMoney, "test")
self.text = str(msg.playerMoney)