Updated to 4.4

This commit is contained in:
Sch1nken 2025-02-26 23:27:07 +01:00
parent eaa26d1361
commit 1aff15069a
151 changed files with 593 additions and 100 deletions

1
UI/ActionMoveMenu.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://1qbrnymtbat1

1
UI/BuildMenu.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://dyikyqxr4bflg

1
UI/CreditsPanel.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://bqpi63kgxiohj

1
UI/GameSettings.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://dv3e8l0ecyyke

1
UI/InputInfo.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://damrrrph3vfwm

1
UI/Lobby/LANHost.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://coqok7bd13s7

1
UI/Lobby/LANJoin.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://ly63r8i4elic

1
UI/Lobby/LANLobby.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://yof1j4gldmty

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://chu7mm2kn613g"]
[ext_resource type="Script" path="res://UI/Lobby/LANLobby.gd" id="1_cuhs7"]
[ext_resource type="Script" path="res://UI/Lobby/LANJoin.gd" id="2_dcv2l"]
[ext_resource type="Script" path="res://UI/Lobby/LANHost.gd" id="2_ioo6d"]
[ext_resource type="Script" uid="uid://yof1j4gldmty" path="res://UI/Lobby/LANLobby.gd" id="1_cuhs7"]
[ext_resource type="Script" uid="uid://ly63r8i4elic" path="res://UI/Lobby/LANJoin.gd" id="2_dcv2l"]
[ext_resource type="Script" uid="uid://coqok7bd13s7" path="res://UI/Lobby/LANHost.gd" id="2_ioo6d"]
[node name="LANLobby" type="Control"]
layout_mode = 3
@ -28,6 +28,7 @@ grow_horizontal = 2
grow_vertical = 2
[node name="SelectionMenu" type="MarginContainer" parent="PanelContainer"]
visible = false
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
@ -53,7 +54,6 @@ layout_mode = 2
text = "Back"
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
visible = false
layout_mode = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 50
@ -137,7 +137,6 @@ disabled = true
text = "Start Game"
[node name="LANJoin" type="VBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer2"]
visible = false
layout_mode = 2
script = ExtResource("2_dcv2l")

View file

@ -0,0 +1 @@
uid://vw51tar7gfb7

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://b6omw0ynhc15i"]
[ext_resource type="Script" path="res://UI/Lobby/LobbyEntry.gd" id="1_bjjj1"]
[ext_resource type="Script" uid="uid://vw51tar7gfb7" path="res://UI/Lobby/LobbyEntry.gd" id="1_bjjj1"]
[node name="LobbyEntry" type="HBoxContainer"]
size_flags_vertical = 3

View file

@ -0,0 +1 @@
uid://cw8hkl6v6sji5

View file

@ -0,0 +1 @@
uid://6q5xnqxeo3f7

View file

@ -0,0 +1 @@
uid://t5ue881kic2o

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://d1yxx75f8ad2e"]
[ext_resource type="Script" path="res://UI/Lobby/WebRTCLobby.gd" id="1_d0ifh"]
[ext_resource type="Script" path="res://UI/Lobby/WebRTCHost.gd" id="2_h54u8"]
[ext_resource type="Script" path="res://UI/Lobby/WebRTCJoin.gd" id="3_yero6"]
[ext_resource type="Script" uid="uid://t5ue881kic2o" path="res://UI/Lobby/WebRTCLobby.gd" id="1_d0ifh"]
[ext_resource type="Script" uid="uid://cw8hkl6v6sji5" path="res://UI/Lobby/WebRTCHost.gd" id="2_h54u8"]
[ext_resource type="Script" uid="uid://6q5xnqxeo3f7" path="res://UI/Lobby/WebRTCJoin.gd" id="3_yero6"]
[node name="WebRtcLobby" type="Control"]
layout_mode = 3

1
UI/Rules/Rules.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://55vnrxjmpong

View file

@ -0,0 +1 @@
uid://bdybn12x7qwk8

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://cua6l3r0yh82y"]
[ext_resource type="Script" path="res://UI/Settings/Settings.gd" id="1_bxt58"]
[ext_resource type="Shader" path="res://Testbed/UIBlur.gdshader" id="1_gnf7a"]
[ext_resource type="Script" uid="uid://bdybn12x7qwk8" path="res://UI/Settings/Settings.gd" id="1_bxt58"]
[ext_resource type="Shader" uid="uid://nkowetasi3ka" path="res://Testbed/UIBlur.gdshader" id="1_gnf7a"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2dtbe"]
shader = ExtResource("1_gnf7a")
@ -62,9 +62,11 @@ layout_mode = 2
[node name="TabContainer" type="TabContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
current_tab = 0
[node name="General" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"]
layout_mode = 2
metadata/_tab_index = 0
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General"]
layout_mode = 2
@ -104,6 +106,7 @@ fit_content = true
[node name="Graphics" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 1
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics"]
layout_mode = 2
@ -132,6 +135,7 @@ button_pressed = true
[node name="Controls" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 2
[node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls"]
layout_mode = 2

1
UI/Table/Table.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://c0euixwrxqct6

View file

@ -0,0 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://b5w6sbmjalthh"]
[ext_resource type="Script" uid="uid://d7wntyuu1fcl" path="res://UI/TestBG/insect_sprite.gd" id="1_k4jda"]
[node name="InsectSprite" type="Sprite2D"]
scale = Vector2(0.1, 0.1)
script = ExtResource("1_k4jda")

View file

@ -0,0 +1,13 @@
extends Node2D
var rotation_speed: float = 0.0
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
rotation_speed = randf_range(-PI/4.0, PI/4.0)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
rotation += rotation_speed * 0.01

View file

@ -0,0 +1 @@
uid://d7wntyuu1fcl

1
UI/join_menu.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://dvcw45nqsgskd

View file

@ -6,8 +6,21 @@ extends Control
const SETTINGS = preload("res://UI/Settings/Settings.tscn")
const RULES = preload("res://UI/Rules/Rules.tscn")
@onready var credits_panel = $CreditsPanel
const ANT = preload("res://InsectTiles/Assets/UI/ant.png")
const BEE = preload("res://InsectTiles/Assets/UI/bee.png")
const BEETLE = preload("res://InsectTiles/Assets/UI/beetle.png")
const GRASSHOPPER = preload("res://InsectTiles/Assets/UI/grasshopper.png")
const HEX_WHITE = preload("res://InsectTiles/Assets/UI/hex_white.svg")
const LADYBUG = preload("res://InsectTiles/Assets/UI/ladybug.png")
const MOSQUITO = preload("res://InsectTiles/Assets/UI/mosquito.png")
const PILLBUG = preload("res://InsectTiles/Assets/UI/pillbug.png")
const SPIDER = preload("res://InsectTiles/Assets/UI/spider.png")
const INSECTS_UI = [ANT, BEE, BEETLE, GRASSHOPPER, LADYBUG, MOSQUITO, PILLBUG, SPIDER]
@onready var insects: Node2D = $Insects
@onready var credits_panel = $CreditsPanel
const INSECT_SPRITE = preload("res://UI/TestBG/InsectSprite.tscn")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
if OS.has_feature("web"):
@ -17,6 +30,31 @@ func _ready() -> void:
#WSClient.lobby_joined.connect(_on_lobby_joined)
Networking.offline_mode()
GameData.reset()
get_viewport().size_changed.connect(resize)
resize()
func resize() -> void:
var _size = get_viewport().size
print(_size)
var center = _size / 2
_create_insects(center)
func _create_insects(center: Vector2i) -> void:
# For circle
var circle_position = Vector2i(center.x, center.y)
var circle_radius = max(center.x, center.y)
var points = PoissonDiscSampling.generate_points_for_circle(circle_position, circle_radius, 150, 30)
for insect in insects.get_children():
insect.queue_free()
for point in points:
var sprite = INSECT_SPRITE.instantiate()
insects.add_child(sprite)
sprite.texture = INSECTS_UI.pick_random()
sprite.position = point
func _on_lobby_joined(lobby: String) -> void:
GameData.lobby_code = lobby

1
UI/main_menu.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://dwo703usndog7

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=6 format=3 uid="uid://dogu37xma5vsp"]
[gd_scene load_steps=7 format=3 uid="uid://dogu37xma5vsp"]
[ext_resource type="Script" path="res://UI/main_menu.gd" id="1_q3q3u"]
[ext_resource type="Script" path="res://DisconnectInfo.gd" id="2_2fkdc"]
[ext_resource type="Script" path="res://UI/CreditsPanel.gd" id="3_16j20"]
[ext_resource type="Script" uid="uid://dwo703usndog7" path="res://UI/main_menu.gd" id="1_q3q3u"]
[ext_resource type="Script" uid="uid://ckbcjqlo333jm" path="res://DisconnectInfo.gd" id="2_2fkdc"]
[ext_resource type="Script" uid="uid://bqpi63kgxiohj" path="res://UI/CreditsPanel.gd" id="3_16j20"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_47fa1"]
bg_color = Color(0, 0, 0, 1)
@ -10,6 +10,9 @@ bg_color = Color(0, 0, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6jy8e"]
bg_color = Color(0.25098, 0.25098, 0.25098, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ah4bq"]
bg_color = Color(0.423529, 0.2, 0.184314, 1)
[node name="MainMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
@ -36,7 +39,7 @@ grow_vertical = 2
[node name="Label" type="Label" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "<Swarm>"
text = "Swarm"
horizontal_alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"]
@ -280,6 +283,21 @@ fit_content = true
layout_mode = 2
text = "Close"
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -1
[node name="Panel" type="Panel" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_ah4bq")
[node name="Insects" type="Node2D" parent="."]
z_index = -1
[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HostButton" to="." method="_on_host_button_pressed"]
[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/JoinButton" to="." method="_on_join_button_pressed"]
[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/SingleplayerButton" to="." method="_on_rules_button_pressed"]