Refactoring UI and Tile logic (to allow for Hotseat/LAN/Online multiplayer)

This commit is contained in:
Sch1nken 2024-03-19 23:16:29 +01:00
parent 1ed0ec226d
commit d688eaf9c6
17 changed files with 591 additions and 17 deletions

16
UI/Table/Table.gd Normal file
View file

@ -0,0 +1,16 @@
extends Control
func add_row(data: ) -> void:
pass
func clear() -> void:
pass
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

33
UI/Table/Table.tscn Normal file
View file

@ -0,0 +1,33 @@
[gd_scene load_steps=3 format=3 uid="uid://sj0wiqp14xy3"]
[ext_resource type="PackedScene" uid="uid://bxettgjh1rv56" path="res://UI/Table/TableRow.tscn" id="1_dfhso"]
[ext_resource type="Script" path="res://UI/Table/Table.gd" id="1_xdpje"]
[node name="Table" 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_xdpje")
[node name="Rows" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="TableRow" parent="Rows" instance=ExtResource("1_dfhso")]
layout_mode = 2
[node name="TableRow2" parent="Rows" instance=ExtResource("1_dfhso")]
layout_mode = 2
[node name="TableRow3" parent="Rows" instance=ExtResource("1_dfhso")]
layout_mode = 2
[node name="TableRow4" parent="Rows" instance=ExtResource("1_dfhso")]
layout_mode = 2

10
UI/Table/TableCell.tscn Normal file
View file

@ -0,0 +1,10 @@
[gd_scene format=3 uid="uid://q8sqr5lw2w1i"]
[node name="TableCell" type="Label"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3

24
UI/Table/TableRow.tscn Normal file
View file

@ -0,0 +1,24 @@
[gd_scene load_steps=2 format=3 uid="uid://bxettgjh1rv56"]
[ext_resource type="PackedScene" uid="uid://q8sqr5lw2w1i" path="res://UI/Table/TableCell.tscn" id="1_e1426"]
[node name="TableRow" type="HBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TableCell" parent="." instance=ExtResource("1_e1426")]
layout_mode = 2
text = "Playername"
[node name="TableCell2" parent="." instance=ExtResource("1_e1426")]
layout_mode = 2
text = "255.255.255.255"
[node name="TableCell3" parent="." instance=ExtResource("1_e1426")]
layout_mode = 2
text = "65535"