👽 interstellar delivery

This commit is contained in:
anyreso 2024-10-16 21:43:01 +00:00
parent 547c97bfba
commit 97c8292858
257 changed files with 7309 additions and 4637 deletions

View file

@ -0,0 +1,22 @@
# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name HostPanel extends MarginContainer
@export var host_button : Button
@export var menu_button : Button
@export var quit_button : Button
@export var server_port : LineEdit
@export var map_selector : MapSelector
@export var mode_selector : ModeSelector

View file

@ -0,0 +1,97 @@
[gd_scene load_steps=4 format=3 uid="uid://dv0lqek8bqyv"]
[ext_resource type="Script" path="res://interfaces/menus/boot/multiplayer/host_panel/host_panel.gd" id="1_wnvng"]
[ext_resource type="Script" path="res://interfaces/menus/boot/multiplayer/host_panel/map_selector.gd" id="2_kwlr3"]
[ext_resource type="Script" path="res://interfaces/menus/boot/multiplayer/host_panel/mode_selector.gd" id="3_o6ecq"]
[node name="HostPanel" type="MarginContainer" node_paths=PackedStringArray("host_button", "menu_button", "quit_button", "server_port", "map_selector", "mode_selector")]
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
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
script = ExtResource("1_wnvng")
host_button = NodePath("HBoxContainer/LeftBox/Top/Host")
menu_button = NodePath("HBoxContainer/LeftBox/Bottom/Menu")
quit_button = NodePath("HBoxContainer/LeftBox/Bottom/Quit")
server_port = NodePath("HBoxContainer/RightBox/GridContainer/ServerPort")
map_selector = NodePath("HBoxContainer/RightBox/GridContainer/MapSelector")
mode_selector = NodePath("HBoxContainer/RightBox/GridContainer/ModeSelector")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 20
[node name="LeftBox" type="VBoxContainer" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.25
[node name="Top" type="VBoxContainer" parent="HBoxContainer/LeftBox"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.25
[node name="Host" type="Button" parent="HBoxContainer/LeftBox/Top"]
layout_mode = 2
text = "Host"
[node name="Bottom" type="VBoxContainer" parent="HBoxContainer/LeftBox"]
layout_mode = 2
size_flags_vertical = 10
[node name="Menu" type="Button" parent="HBoxContainer/LeftBox/Bottom"]
layout_mode = 2
size_flags_horizontal = 3
text = "Main Menu
"
[node name="Quit" type="Button" parent="HBoxContainer/LeftBox/Bottom"]
layout_mode = 2
size_flags_horizontal = 3
text = "Quit"
[node name="RightBox" type="VBoxContainer" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="MapPreview" type="ColorRect" parent="HBoxContainer/RightBox"]
layout_mode = 2
[node name="GridContainer" type="GridContainer" parent="HBoxContainer/RightBox"]
layout_mode = 2
theme_override_constants/h_separation = 120
columns = 2
[node name="PortLabel" type="Label" parent="HBoxContainer/RightBox/GridContainer"]
layout_mode = 2
text = "Port"
[node name="ServerPort" type="LineEdit" parent="HBoxContainer/RightBox/GridContainer"]
layout_mode = 2
placeholder_text = "9000"
alignment = 2
[node name="MapLabel" type="Label" parent="HBoxContainer/RightBox/GridContainer"]
layout_mode = 2
text = "Map"
[node name="MapSelector" type="OptionButton" parent="HBoxContainer/RightBox/GridContainer"]
layout_mode = 2
clip_text = true
allow_reselect = true
script = ExtResource("2_kwlr3")
[node name="ModeLabel" type="Label" parent="HBoxContainer/RightBox/GridContainer"]
layout_mode = 2
text = "Mode"
[node name="ModeSelector" type="OptionButton" parent="HBoxContainer/RightBox/GridContainer"]
layout_mode = 2
script = ExtResource("3_o6ecq")

View file

@ -0,0 +1,21 @@
# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name MapSelector extends OptionButton
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
for map : PackedScene in MapsManager.maps:
var map_name : String = map._bundled.names[0]
add_item(map_name)

View file

@ -0,0 +1,33 @@
# This file is part of open-fpsz.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
class_name ModeSelector extends OptionButton
func format(enum_key: String) -> String:
# split enum value by underscores
var words : PackedStringArray = enum_key.split("_")
# capitalize first letter of each word
for i in range(words.size()):
words[i] = words[i].capitalize()
# join words with spaces
return " ".join(words)
func _ready() -> void:
for mode:String in Multiplayer.Mode.keys():
add_item(format(mode))
# @NOTE: ctf, arena and ball are not implemented yet
set_item_disabled(2, true)
set_item_disabled(3, true)
set_item_disabled(4, true)