Add base project

This commit is contained in:
Mathilde Grapin 2024-05-25 18:50:50 +02:00
parent 0cec0c70d5
commit 5abf7b3d81
19 changed files with 501 additions and 0 deletions

43
scene/calendar.tscn Normal file
View file

@ -0,0 +1,43 @@
[gd_scene load_steps=5 format=3 uid="uid://bkwvaljh0oj22"]
[ext_resource type="Theme" uid="uid://bu07nib41exqy" path="res://ui/theme.tres" id="1_jufjt"]
[ext_resource type="Script" path="res://script/calendar.gd" id="1_nbpow"]
[ext_resource type="PackedScene" uid="uid://x8u7mduga68y" path="res://scene/month.tscn" id="2_g4ut4"]
[ext_resource type="Script" path="res://scene/periodmanager.gd" id="3_3jsi6"]
[node name="Calendar" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_jufjt")
script = ExtResource("1_nbpow")
month_scene = ExtResource("2_g4ut4")
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -576.0
offset_right = 576.0
offset_bottom = 27.0
grow_horizontal = 2
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="YearLabel" type="Label" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
theme_override_font_sizes/font_size = 96
[node name="Year" type="GridContainer" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
columns = 4
[node name="PeriodManager" type="Node" parent="."]
script = ExtResource("3_3jsi6")

9
scene/day.tscn Normal file
View file

@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://dt5l2bunc1iru"]
[ext_resource type="Script" path="res://script/day.gd" id="1_jhrhj"]
[node name="Day" type="Button"]
offset_right = 46.0
offset_bottom = 40.0
text = "12"
script = ExtResource("1_jhrhj")

63
scene/month.tscn Normal file
View file

@ -0,0 +1,63 @@
[gd_scene load_steps=3 format=3 uid="uid://x8u7mduga68y"]
[ext_resource type="Script" path="res://script/month.gd" id="1_tiy7h"]
[ext_resource type="PackedScene" uid="uid://dt5l2bunc1iru" path="res://scene/day.tscn" id="2_5kdiw"]
[node name="Month" type="Control"]
custom_minimum_size = Vector2(250, 250)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_tiy7h")
day_scene = ExtResource("2_5kdiw")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="MonthLabel" type="Label" parent="HBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 20
[node name="DaysGridContainer" type="GridContainer" parent="HBoxContainer"]
layout_mode = 2
columns = 7
[node name="Dimanche" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "D"
[node name="Lundi" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "L"
[node name="Mardi" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "M"
[node name="Mercredi" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "M"
[node name="Jeudi" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "J"
[node name="Vendredi" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "V"
[node name="Samedi" type="Label" parent="HBoxContainer/DaysGridContainer"]
layout_mode = 2
size_flags_horizontal = 4
text = "S"

25
scene/periodmanager.gd Normal file
View file

@ -0,0 +1,25 @@
extends Node
var periods = []
var last_period = null
func add(date):
if last_period != null:
last_period.end = date
last_period = null
dump()
return
# If no new period has begun
var period = Period.new()
period.begin = date
periods.append(period)
last_period = period
dump()
func dump():
for period in periods:
print("%s - %s" % [period.begin, period.end])