Compare commits

...

6 Commits

Author SHA1 Message Date
356897045f Merge pull request 'chore: add flake check workflow' (#21) from workflow-init into master
All checks were successful
flake-check / build (push) Successful in 46s
Reviewed-on: #21
2025-08-27 21:08:53 +00:00
1e1f8cebe8 chore: add flake check workflow
All checks were successful
flake-check / build (pull_request) Successful in 48s
2025-08-27 23:05:32 +02:00
b21ad67cfc chore: add gdformat check to flake 2025-08-26 21:51:38 +02:00
4fffa8784a chore: remove version from image name 2025-08-26 20:23:43 +02:00
dc3f8c94f8 Merge pull request 'Add minimal main menu' (#19) from 15-main-menu into master
Reviewed-on: #19
2025-08-23 19:06:03 +00:00
f06bf17757 game: add minimal main menu 2025-08-23 21:04:26 +02:00
5 changed files with 130 additions and 2 deletions

16
.github/workflows/flake-check.yaml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: flake-check
on:
push:
branches: master
pull_request:
branches:
- master
jobs:
build:
runs-on: [ ubuntu-latest, homelab ]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- run: nix flake check

View File

@@ -46,6 +46,30 @@
} }
); );
checks = forAllSystems (
{ pkgs }:
{
gdformat = pkgs.stdenvNoCC.mkDerivation {
name = "gdformat-check";
src = pkgs.lib.sources.sourceFilesBySuffices (pkgs.lib.cleanSource ./.) [ ".gd" ];
nativeBuildInputs = with pkgs; [
gdtoolkit_4
];
dontBuild = true;
doCheck = true;
checkPhase = ''
export HOME=$(mktemp -d)
find . -name "*.gd" -print0 | xargs -0 gdformat --check
echo "All .gd files are properly formatted"
'';
installPhase = "mkdir $out";
};
}
);
packages = forAllSystems ( packages = forAllSystems (
{ pkgs }: { pkgs }:
let let
@@ -77,7 +101,6 @@
runHook postBuild runHook postBuild
''; '';
installPhase = '' installPhase = ''
find .
install -D -m 755 -t $out/libexec ./build/slopvivors install -D -m 755 -t $out/libexec ./build/slopvivors
install -D -m 644 -t $out/libexec ./build/slopvivors.pck install -D -m 644 -t $out/libexec ./build/slopvivors.pck
install -d -m 755 $out/bin install -d -m 755 $out/bin
@@ -158,7 +181,7 @@
''; '';
}; };
slopvivors_docker = pkgs.dockerTools.buildLayeredImage { slopvivors_docker = pkgs.dockerTools.buildLayeredImage {
name = "slopvivors-docker-${version}"; name = "slopvivors-docker";
tag = version; tag = version;
created = "now"; created = "now";
contents = [ contents = [

19
scenes/main_menu.gd Normal file
View File

@@ -0,0 +1,19 @@
extends Control
const MAIN = preload("res://scenes/main.tscn")
func _ready() -> void:
pass
func _on_new_game_button_pressed() -> void:
get_tree().change_scene_to_packed(MAIN)
func _on_options_button_pressed() -> void:
pass # Replace with function body.
func _on_exit_game_button_pressed() -> void:
get_tree().quit()

1
scenes/main_menu.gd.uid Normal file
View File

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

69
scenes/main_menu.tscn Normal file
View File

@@ -0,0 +1,69 @@
[gd_scene load_steps=4 format=3 uid="uid://cynet50emve6c"]
[ext_resource type="Script" uid="uid://sd158y3mdmkt" path="res://scenes/main_menu.gd" id="1_l6cm7"]
[sub_resource type="Gradient" id="Gradient_vue75"]
colors = PackedColorArray(0.252028, 0.252028, 0.252028, 1, 0.25098, 0.25098, 0.25098, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_l6cm7"]
gradient = SubResource("Gradient_vue75")
[node name="MainMenu" 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_l6cm7")
[node name="Background" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_l6cm7")
expand_mode = 2
[node name="PanelContainer" type="PanelContainer" parent="."]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
layout_mode = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 10
[node name="NewGameButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "New game"
[node name="OptionsButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Options"
[node name="ExitGameButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Exit game"
[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/NewGameButton" to="." method="_on_new_game_button_pressed"]
[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/OptionsButton" to="." method="_on_options_button_pressed"]
[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/ExitGameButton" to="." method="_on_exit_game_button_pressed"]