Basic table

This commit is contained in:
wjsjwr 2024-12-01 23:47:55 +08:00
parent 2848479c71
commit d02993b9f9
12 changed files with 8163 additions and 29 deletions

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://c1ohxlt6fy4rr"]
[gd_scene load_steps=4 format=3 uid="uid://c1ohxlt6fy4rr"]
[ext_resource type="Script" path="res://scripts/GameManager.cs" id="1_uwl7p"]
[ext_resource type="Script" path="res://scripts/Res.cs" id="2_3213b"]
[ext_resource type="Script" path="res://scripts/TileMapping.cs" id="3_m370e"]
[node name="GameManager" type="Node"]
script = ExtResource("1_uwl7p")
@ -12,3 +13,6 @@ autostart = true
[node name="Res" type="Node" parent="."]
script = ExtResource("2_3213b")
[node name="TileMapping" type="Node" parent="."]
script = ExtResource("3_m370e")

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=13 format=4 uid="uid://chkhsro6w06rg"]
[gd_scene load_steps=14 format=4 uid="uid://chkhsro6w06rg"]
[ext_resource type="Texture2D" uid="uid://chqegsqdgeq34" path="res://temp_res/kenney_tiny-town/Tilemap/tilemap_packed.png" id="1_qt51n"]
[ext_resource type="Script" path="res://scripts/Lab.cs" id="1_xcxd5"]
[ext_resource type="Texture2D" uid="uid://e1wpflj415hp" path="res://temp_res/kenney_tiny-dungeon/Tilemap/tilemap_packed.png" id="1_yu0wa"]
[ext_resource type="Texture2D" uid="uid://dujbelk1piktj" path="res://resources/lab/Room_Builder_Office_48x48.png" id="2_ls45n"]
[ext_resource type="Script" path="res://scripts/TestMap.cs" id="3_mca7j"]
[ext_resource type="PackedScene" uid="uid://t1xwaqtbyrx1" path="res://resources/table.tscn" id="8_4w4mb"]
[ext_resource type="PackedScene" uid="uid://c413oatj0eqhu" path="res://student.tscn" id="8_wqdny"]
[ext_resource type="PackedScene" uid="uid://b5hqh3exkapj" path="res://bottom_bar.tscn" id="10_1ep8g"]
@ -472,3 +473,6 @@ position = Vector2(24, 192)
[node name="BottomBar" parent="." instance=ExtResource("10_1ep8g")]
offset_top = 1028.0
offset_bottom = 1028.0
[node name="Table" parent="." instance=ExtResource("8_4w4mb")]
position = Vector2(855, 464)

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=5 format=3 uid="uid://c7twiu4wplofj"]
[gd_scene load_steps=6 format=3 uid="uid://c7twiu4wplofj"]
[ext_resource type="Script" path="res://scripts/Loader.cs" id="1_leg4d"]
[ext_resource type="Texture2D" uid="uid://cxr7her2pjn5o" path="res://resources/logo/LOGO.png" id="2_luvwy"]
[ext_resource type="Texture2D" uid="uid://boxrcxj1s500l" path="res://resources/logo/LOGO2.png" id="3_dq1f7"]
[ext_resource type="Texture2D" uid="uid://b1a2suh4bwdr1" path="res://resources/logo/welcome.png" id="4_0dir6"]
[ext_resource type="Texture2D" uid="uid://yh05c4bahwcs" path="res://resources/logo/LOGO3.png" id="4_ox2t6"]
[node name="Loader" type="Control"]
@ -22,6 +23,31 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Sprite2D" type="Sprite2D" parent="."]
visible = false
position = Vector2(914, 450)
scale = Vector2(0.3, 0.3)
texture = ExtResource("2_luvwy")
[node name="Sprite2D2" type="Sprite2D" parent="."]
visible = false
texture_filter = 6
position = Vector2(960, 544)
scale = Vector2(0.3, 0.3)
texture = ExtResource("3_dq1f7")
[node name="Sprite2D4" type="Sprite2D" parent="."]
texture_filter = 6
position = Vector2(960, 536)
scale = Vector2(0.933333, 0.933333)
texture = ExtResource("4_0dir6")
[node name="Sprite2D3" type="Sprite2D" parent="."]
visible = false
position = Vector2(960, 540)
scale = Vector2(0.3, 0.3)
texture = ExtResource("4_ox2t6")
[node name="ProgressBar" type="ProgressBar" parent="."]
layout_mode = 1
anchors_preset = 7
@ -36,21 +62,3 @@ offset_bottom = -61.0
grow_horizontal = 2
grow_vertical = 0
show_percentage = false
[node name="Sprite2D" type="Sprite2D" parent="."]
visible = false
position = Vector2(914, 450)
scale = Vector2(0.3, 0.3)
texture = ExtResource("2_luvwy")
[node name="Sprite2D2" type="Sprite2D" parent="."]
texture_filter = 6
position = Vector2(960, 544)
scale = Vector2(0.3, 0.3)
texture = ExtResource("3_dq1f7")
[node name="Sprite2D3" type="Sprite2D" parent="."]
visible = false
position = Vector2(960, 540)
scale = Vector2(0.3, 0.3)
texture = ExtResource("4_ox2t6")

30
resources/Table.cs Normal file
View File

@ -0,0 +1,30 @@
using Godot;
using System;
public partial class Table : Node2D
{
private static readonly Rect2I tableRect = new(0, 0, 3, 2);
private static readonly TileMapping[] tableThemes = {
new(new Vector2I(1, 30), tableRect),
new(new Vector2I(4, 30), tableRect),
new(new Vector2I(7, 30), tableRect),
new(new Vector2I(7, 28), tableRect),
new(new Vector2I(10, 28), tableRect),
};
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
RandomChangeTheme();
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
public void RandomChangeTheme() {
tableThemes[GD.RandRange(0, tableThemes.Length)].Apply(GetNode<TileMapLayer>("Base"));
}
}

View File

@ -0,0 +1,815 @@
[gd_resource type="TileSet" load_steps=3 format=3 uid="uid://doadcdgjrsxxu"]
[ext_resource type="Texture2D" uid="uid://y460iqd3a56u" path="res://resources/lab/Modern_Office_Black_Shadow_48x48.png" id="1_6vi18"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_5u56x"]
texture = ExtResource("1_6vi18")
texture_region_size = Vector2i(48, 48)
0:1/0 = 0
1:1/0 = 0
2:1/0 = 0
3:1/0 = 0
4:1/0 = 0
5:1/0 = 0
6:1/0 = 0
7:1/0 = 0
8:1/0 = 0
9:1/0 = 0
10:1/0 = 0
11:1/0 = 0
12:1/0 = 0
13:1/0 = 0
14:1/0 = 0
15:1/0 = 0
0:2/0 = 0
1:2/0 = 0
2:2/0 = 0
3:2/0 = 0
4:2/0 = 0
5:2/0 = 0
6:2/0 = 0
7:2/0 = 0
8:2/0 = 0
9:2/0 = 0
10:2/0 = 0
11:2/0 = 0
12:2/0 = 0
13:2/0 = 0
14:2/0 = 0
15:2/0 = 0
0:3/0 = 0
1:3/0 = 0
2:3/0 = 0
3:3/0 = 0
4:3/0 = 0
5:3/0 = 0
6:3/0 = 0
7:3/0 = 0
8:3/0 = 0
9:3/0 = 0
10:3/0 = 0
11:3/0 = 0
12:3/0 = 0
13:3/0 = 0
14:3/0 = 0
15:3/0 = 0
0:4/0 = 0
1:4/0 = 0
2:4/0 = 0
3:4/0 = 0
4:4/0 = 0
5:4/0 = 0
6:4/0 = 0
7:4/0 = 0
8:4/0 = 0
9:4/0 = 0
10:4/0 = 0
11:4/0 = 0
12:4/0 = 0
13:4/0 = 0
14:4/0 = 0
15:4/0 = 0
0:5/0 = 0
1:5/0 = 0
2:5/0 = 0
3:5/0 = 0
4:5/0 = 0
5:5/0 = 0
6:5/0 = 0
7:5/0 = 0
8:5/0 = 0
9:5/0 = 0
10:5/0 = 0
11:5/0 = 0
12:5/0 = 0
13:5/0 = 0
14:5/0 = 0
15:5/0 = 0
0:6/0 = 0
1:6/0 = 0
2:6/0 = 0
3:6/0 = 0
4:6/0 = 0
5:6/0 = 0
6:6/0 = 0
7:6/0 = 0
8:6/0 = 0
9:6/0 = 0
10:6/0 = 0
11:6/0 = 0
12:6/0 = 0
13:6/0 = 0
14:6/0 = 0
15:6/0 = 0
0:7/0 = 0
1:7/0 = 0
2:7/0 = 0
3:7/0 = 0
4:7/0 = 0
5:7/0 = 0
6:7/0 = 0
7:7/0 = 0
8:7/0 = 0
9:7/0 = 0
10:7/0 = 0
11:7/0 = 0
12:7/0 = 0
13:7/0 = 0
14:7/0 = 0
15:7/0 = 0
0:8/0 = 0
1:8/0 = 0
2:8/0 = 0
3:8/0 = 0
4:8/0 = 0
5:8/0 = 0
6:8/0 = 0
7:8/0 = 0
8:8/0 = 0
9:8/0 = 0
10:8/0 = 0
11:8/0 = 0
12:8/0 = 0
13:8/0 = 0
14:8/0 = 0
15:8/0 = 0
0:9/0 = 0
1:9/0 = 0
2:9/0 = 0
12:9/0 = 0
13:9/0 = 0
14:9/0 = 0
15:9/0 = 0
0:10/0 = 0
1:10/0 = 0
2:10/0 = 0
12:10/0 = 0
13:10/0 = 0
14:10/0 = 0
15:10/0 = 0
0:11/0 = 0
1:11/0 = 0
2:11/0 = 0
12:11/0 = 0
13:11/0 = 0
14:11/0 = 0
15:11/0 = 0
0:13/0 = 0
1:13/0 = 0
2:13/0 = 0
3:13/0 = 0
4:13/0 = 0
5:13/0 = 0
6:13/0 = 0
7:13/0 = 0
8:13/0 = 0
9:13/0 = 0
10:13/0 = 0
11:13/0 = 0
12:13/0 = 0
13:13/0 = 0
14:13/0 = 0
15:13/0 = 0
0:14/0 = 0
1:14/0 = 0
2:14/0 = 0
3:14/0 = 0
4:14/0 = 0
5:14/0 = 0
6:14/0 = 0
7:14/0 = 0
8:14/0 = 0
9:14/0 = 0
10:14/0 = 0
11:14/0 = 0
12:14/0 = 0
13:14/0 = 0
14:14/0 = 0
15:14/0 = 0
0:15/0 = 0
1:15/0 = 0
2:15/0 = 0
3:15/0 = 0
4:15/0 = 0
5:15/0 = 0
6:15/0 = 0
7:15/0 = 0
8:15/0 = 0
9:15/0 = 0
10:15/0 = 0
11:15/0 = 0
12:15/0 = 0
13:15/0 = 0
14:15/0 = 0
15:15/0 = 0
0:16/0 = 0
1:16/0 = 0
2:16/0 = 0
3:16/0 = 0
4:16/0 = 0
5:16/0 = 0
6:16/0 = 0
7:16/0 = 0
8:16/0 = 0
9:16/0 = 0
10:16/0 = 0
11:16/0 = 0
12:16/0 = 0
13:16/0 = 0
14:16/0 = 0
15:16/0 = 0
0:17/0 = 0
1:17/0 = 0
2:17/0 = 0
3:17/0 = 0
4:17/0 = 0
5:17/0 = 0
6:17/0 = 0
7:17/0 = 0
8:17/0 = 0
9:17/0 = 0
10:17/0 = 0
11:17/0 = 0
12:17/0 = 0
13:17/0 = 0
14:17/0 = 0
15:17/0 = 0
0:18/0 = 0
1:18/0 = 0
2:18/0 = 0
3:18/0 = 0
4:18/0 = 0
5:18/0 = 0
6:18/0 = 0
7:18/0 = 0
8:18/0 = 0
9:18/0 = 0
10:18/0 = 0
11:18/0 = 0
12:18/0 = 0
13:18/0 = 0
14:18/0 = 0
15:18/0 = 0
0:19/0 = 0
1:19/0 = 0
2:19/0 = 0
3:19/0 = 0
4:19/0 = 0
5:19/0 = 0
6:19/0 = 0
7:19/0 = 0
8:19/0 = 0
9:19/0 = 0
10:19/0 = 0
11:19/0 = 0
12:19/0 = 0
13:19/0 = 0
14:19/0 = 0
15:19/0 = 0
0:20/0 = 0
1:20/0 = 0
2:20/0 = 0
3:20/0 = 0
4:20/0 = 0
5:20/0 = 0
6:20/0 = 0
7:20/0 = 0
8:20/0 = 0
9:20/0 = 0
10:20/0 = 0
11:20/0 = 0
12:20/0 = 0
13:20/0 = 0
14:20/0 = 0
15:20/0 = 0
0:21/0 = 0
1:21/0 = 0
2:21/0 = 0
12:21/0 = 0
13:21/0 = 0
14:21/0 = 0
15:21/0 = 0
0:22/0 = 0
1:22/0 = 0
2:22/0 = 0
12:22/0 = 0
13:22/0 = 0
14:22/0 = 0
15:22/0 = 0
0:23/0 = 0
1:23/0 = 0
2:23/0 = 0
12:23/0 = 0
13:23/0 = 0
14:23/0 = 0
15:23/0 = 0
14:24/0 = 0
15:24/0 = 0
0:25/0 = 0
1:25/0 = 0
2:25/0 = 0
3:25/0 = 0
4:25/0 = 0
5:25/0 = 0
6:25/0 = 0
7:25/0 = 0
8:25/0 = 0
9:25/0 = 0
10:25/0 = 0
11:25/0 = 0
13:25/0 = 0
14:25/0 = 0
15:25/0 = 0
0:26/0 = 0
1:26/0 = 0
2:26/0 = 0
3:26/0 = 0
4:26/0 = 0
5:26/0 = 0
6:26/0 = 0
7:26/0 = 0
8:26/0 = 0
9:26/0 = 0
10:26/0 = 0
11:26/0 = 0
12:26/0 = 0
13:26/0 = 0
14:26/0 = 0
15:26/0 = 0
0:27/0 = 0
1:27/0 = 0
2:27/0 = 0
3:27/0 = 0
4:27/0 = 0
5:27/0 = 0
6:27/0 = 0
7:27/0 = 0
8:27/0 = 0
9:27/0 = 0
10:27/0 = 0
11:27/0 = 0
12:27/0 = 0
13:27/0 = 0
14:27/0 = 0
15:27/0 = 0
0:28/0 = 0
1:28/0 = 0
2:28/0 = 0
3:28/0 = 0
4:28/0 = 0
5:28/0 = 0
6:28/0 = 0
7:28/0 = 0
8:28/0 = 0
9:28/0 = 0
10:28/0 = 0
11:28/0 = 0
12:28/0 = 0
13:28/0 = 0
14:28/0 = 0
15:28/0 = 0
0:29/0 = 0
1:29/0 = 0
2:29/0 = 0
3:29/0 = 0
4:29/0 = 0
5:29/0 = 0
6:29/0 = 0
7:29/0 = 0
8:29/0 = 0
9:29/0 = 0
10:29/0 = 0
11:29/0 = 0
12:29/0 = 0
13:29/0 = 0
14:29/0 = 0
15:29/0 = 0
14:30/0 = 0
15:30/0 = 0
0:31/0 = 0
1:31/0 = 0
2:31/0 = 0
3:31/0 = 0
4:31/0 = 0
5:31/0 = 0
6:31/0 = 0
7:31/0 = 0
8:31/0 = 0
9:31/0 = 0
10:31/0 = 0
11:31/0 = 0
13:31/0 = 0
14:31/0 = 0
15:31/0 = 0
0:32/0 = 0
1:32/0 = 0
2:32/0 = 0
3:32/0 = 0
4:32/0 = 0
5:32/0 = 0
6:32/0 = 0
7:32/0 = 0
8:32/0 = 0
9:32/0 = 0
10:32/0 = 0
11:32/0 = 0
12:32/0 = 0
13:32/0 = 0
14:32/0 = 0
15:32/0 = 0
0:33/0 = 0
1:33/0 = 0
2:33/0 = 0
3:33/0 = 0
4:33/0 = 0
5:33/0 = 0
6:33/0 = 0
7:33/0 = 0
8:33/0 = 0
9:33/0 = 0
10:33/0 = 0
11:33/0 = 0
12:33/0 = 0
13:33/0 = 0
14:33/0 = 0
15:33/0 = 0
0:34/0 = 0
1:34/0 = 0
2:34/0 = 0
3:34/0 = 0
4:34/0 = 0
5:34/0 = 0
6:34/0 = 0
7:34/0 = 0
8:34/0 = 0
9:34/0 = 0
10:34/0 = 0
11:34/0 = 0
12:34/0 = 0
13:34/0 = 0
14:34/0 = 0
15:34/0 = 0
0:35/0 = 0
1:35/0 = 0
2:35/0 = 0
3:35/0 = 0
4:35/0 = 0
5:35/0 = 0
6:35/0 = 0
7:35/0 = 0
8:35/0 = 0
9:35/0 = 0
10:35/0 = 0
11:35/0 = 0
12:35/0 = 0
13:35/0 = 0
14:35/0 = 0
15:35/0 = 0
9:36/0 = 0
10:36/0 = 0
13:36/0 = 0
14:36/0 = 0
0:37/0 = 0
1:37/0 = 0
2:37/0 = 0
3:37/0 = 0
4:37/0 = 0
5:37/0 = 0
6:37/0 = 0
7:37/0 = 0
8:37/0 = 0
9:37/0 = 0
10:37/0 = 0
11:37/0 = 0
12:37/0 = 0
13:37/0 = 0
14:37/0 = 0
15:37/0 = 0
0:38/0 = 0
1:38/0 = 0
2:38/0 = 0
3:38/0 = 0
4:38/0 = 0
5:38/0 = 0
6:38/0 = 0
7:38/0 = 0
8:38/0 = 0
9:38/0 = 0
10:38/0 = 0
11:38/0 = 0
12:38/0 = 0
13:38/0 = 0
14:38/0 = 0
15:38/0 = 0
0:39/0 = 0
1:39/0 = 0
2:39/0 = 0
3:39/0 = 0
4:39/0 = 0
5:39/0 = 0
6:39/0 = 0
7:39/0 = 0
8:39/0 = 0
9:39/0 = 0
10:39/0 = 0
13:39/0 = 0
14:39/0 = 0
0:40/0 = 0
1:40/0 = 0
2:40/0 = 0
3:40/0 = 0
4:40/0 = 0
5:40/0 = 0
9:40/0 = 0
10:40/0 = 0
11:40/0 = 0
12:40/0 = 0
13:40/0 = 0
14:40/0 = 0
15:40/0 = 0
0:41/0 = 0
1:41/0 = 0
2:41/0 = 0
3:41/0 = 0
4:41/0 = 0
5:41/0 = 0
9:41/0 = 0
10:41/0 = 0
11:41/0 = 0
12:41/0 = 0
13:41/0 = 0
14:41/0 = 0
15:41/0 = 0
4:42/0 = 0
5:42/0 = 0
3:43/0 = 0
4:43/0 = 0
5:43/0 = 0
0:44/0 = 0
1:44/0 = 0
2:44/0 = 0
3:44/0 = 0
4:44/0 = 0
5:44/0 = 0
6:44/0 = 0
7:44/0 = 0
8:44/0 = 0
0:45/0 = 0
1:45/0 = 0
2:45/0 = 0
3:45/0 = 0
4:45/0 = 0
5:45/0 = 0
6:45/0 = 0
7:45/0 = 0
8:45/0 = 0
0:46/0 = 0
1:46/0 = 0
2:46/0 = 0
3:46/0 = 0
4:46/0 = 0
5:46/0 = 0
6:46/0 = 0
7:46/0 = 0
8:46/0 = 0
9:46/0 = 0
10:46/0 = 0
11:46/0 = 0
12:46/0 = 0
13:46/0 = 0
14:46/0 = 0
15:46/0 = 0
0:47/0 = 0
1:47/0 = 0
2:47/0 = 0
3:47/0 = 0
4:47/0 = 0
5:47/0 = 0
6:47/0 = 0
7:47/0 = 0
8:47/0 = 0
9:47/0 = 0
10:47/0 = 0
11:47/0 = 0
12:47/0 = 0
13:47/0 = 0
14:47/0 = 0
15:47/0 = 0
9:48/0 = 0
10:48/0 = 0
11:48/0 = 0
12:48/0 = 0
13:48/0 = 0
14:48/0 = 0
15:48/0 = 0
9:49/0 = 0
10:49/0 = 0
11:49/0 = 0
12:49/0 = 0
13:49/0 = 0
14:49/0 = 0
15:49/0 = 0
0:51/0 = 0
1:51/0 = 0
2:51/0 = 0
3:51/0 = 0
4:51/0 = 0
5:51/0 = 0
6:51/0 = 0
7:51/0 = 0
8:51/0 = 0
9:51/0 = 0
10:51/0 = 0
11:51/0 = 0
12:51/0 = 0
13:51/0 = 0
14:51/0 = 0
0:52/0 = 0
1:52/0 = 0
2:52/0 = 0
3:52/0 = 0
4:52/0 = 0
5:52/0 = 0
6:52/0 = 0
7:52/0 = 0
8:52/0 = 0
9:52/0 = 0
10:52/0 = 0
11:52/0 = 0
12:52/0 = 0
13:52/0 = 0
14:52/0 = 0
0:0/0 = 0
1:0/0 = 0
2:0/0 = 0
3:0/0 = 0
4:0/0 = 0
5:0/0 = 0
6:0/0 = 0
7:0/0 = 0
8:0/0 = 0
9:0/0 = 0
10:0/0 = 0
11:0/0 = 0
12:0/0 = 0
13:0/0 = 0
14:0/0 = 0
15:0/0 = 0
3:9/0 = 0
4:9/0 = 0
5:9/0 = 0
6:9/0 = 0
7:9/0 = 0
8:9/0 = 0
9:9/0 = 0
10:9/0 = 0
11:9/0 = 0
3:10/0 = 0
4:10/0 = 0
5:10/0 = 0
6:10/0 = 0
7:10/0 = 0
8:10/0 = 0
9:10/0 = 0
10:10/0 = 0
3:11/0 = 0
4:11/0 = 0
5:11/0 = 0
6:11/0 = 0
7:11/0 = 0
8:11/0 = 0
9:11/0 = 0
10:11/0 = 0
11:11/0 = 0
0:12/0 = 0
1:12/0 = 0
2:12/0 = 0
3:12/0 = 0
4:12/0 = 0
5:12/0 = 0
6:12/0 = 0
7:12/0 = 0
8:12/0 = 0
9:12/0 = 0
10:12/0 = 0
11:12/0 = 0
12:12/0 = 0
13:12/0 = 0
14:12/0 = 0
15:12/0 = 0
3:21/0 = 0
4:21/0 = 0
5:21/0 = 0
6:21/0 = 0
7:21/0 = 0
8:21/0 = 0
9:21/0 = 0
11:21/0 = 0
3:22/0 = 0
5:22/0 = 0
6:22/0 = 0
7:22/0 = 0
8:22/0 = 0
9:22/0 = 0
10:22/0 = 0
11:22/0 = 0
3:23/0 = 0
5:23/0 = 0
6:23/0 = 0
7:23/0 = 0
8:23/0 = 0
9:23/0 = 0
10:23/0 = 0
11:23/0 = 0
0:24/0 = 0
1:24/0 = 0
2:24/0 = 0
3:24/0 = 0
4:24/0 = 0
5:24/0 = 0
8:24/0 = 0
9:24/0 = 0
10:24/0 = 0
11:24/0 = 0
12:24/0 = 0
13:24/0 = 0
1:30/0 = 0
2:30/0 = 0
3:30/0 = 0
4:30/0 = 0
5:30/0 = 0
6:30/0 = 0
7:30/0 = 0
8:30/0 = 0
9:30/0 = 0
10:30/0 = 0
11:30/0 = 0
12:30/0 = 0
13:30/0 = 0
12:31/0 = 0
1:36/0 = 0
2:36/0 = 0
3:36/0 = 0
5:36/0 = 0
6:36/0 = 0
7:36/0 = 0
8:36/0 = 0
11:36/0 = 0
12:36/0 = 0
11:39/0 = 0
12:39/0 = 0
15:39/0 = 0
8:40/0 = 0
1:42/0 = 0
2:42/0 = 0
3:42/0 = 0
8:42/0 = 0
9:42/0 = 0
10:42/0 = 0
11:42/0 = 0
12:42/0 = 0
13:42/0 = 0
15:42/0 = 0
0:43/0 = 0
2:43/0 = 0
6:43/0 = 0
7:43/0 = 0
12:43/0 = 0
13:43/0 = 0
14:43/0 = 0
15:43/0 = 0
9:44/0 = 0
10:44/0 = 0
11:44/0 = 0
12:44/0 = 0
13:44/0 = 0
9:45/0 = 0
10:45/0 = 0
11:45/0 = 0
12:45/0 = 0
13:45/0 = 0
0:48/0 = 0
1:48/0 = 0
2:48/0 = 0
4:48/0 = 0
5:48/0 = 0
6:48/0 = 0
8:48/0 = 0
0:49/0 = 0
2:49/0 = 0
3:49/0 = 0
8:49/0 = 0
0:50/0 = 0
1:50/0 = 0
2:50/0 = 0
3:50/0 = 0
8:50/0 = 0
9:50/0 = 0
10:50/0 = 0
11:50/0 = 0
12:50/0 = 0
13:50/0 = 0
[resource]
tile_size = Vector2i(48, 48)
sources/0 = SubResource("TileSetAtlasSource_5u56x")

BIN
resources/logo/welcome.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b1a2suh4bwdr1"
path="res://.godot/imported/welcome.png-fb6847e86d07055efcdf29f8d771b7b5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/logo/welcome.png"
dest_files=["res://.godot/imported/welcome.png-fb6847e86d07055efcdf29f8d771b7b5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

19
resources/table.tscn Normal file
View File

@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=4 uid="uid://t1xwaqtbyrx1"]
[ext_resource type="Script" path="res://resources/Table.cs" id="1_0qis0"]
[ext_resource type="TileSet" uid="uid://doadcdgjrsxxu" path="res://resources/TileSet/Office.tres" id="1_huwx3"]
[node name="Table" type="Node2D"]
script = ExtResource("1_0qis0")
[node name="Base2" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAD/////AAAAABoAAAD//wAAAAAAABsAAAD//wEAAAAAABwAAAAAAP//AAABABoAAAAAAAAAAAABABsAAAAAAAEAAAABABwAAAABAP//AAACABoAAAABAAAAAAACABsAAAABAAEAAAACABwAAAACAP//AAADABoAAAACAAAAAAADABsAAAACAAEAAAADABwAAAA=")
tile_set = ExtResource("1_huwx3")
[node name="Base" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAAAAAAAAAEAB4AAAAAAAEAAAAEAB8AAAABAAAAAAAFAB4AAAABAAEAAAAFAB8AAAACAAAAAAAGAB4AAAACAAEAAAAGAB8AAAA=")
tile_set = ExtResource("1_huwx3")
[node name="Equipment" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAAAAAAAAANABwAAAAAAAEAAAANAB0AAAABAAAAAAAOABwAAAABAAEAAAAOAB0AAAACAAAAAAAPABwAAAACAAEAAAAPAB0AAAA=")
tile_set = ExtResource("1_huwx3")

View File

@ -8,9 +8,17 @@ public partial class Lab : Node2D
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
var ticker = GetNode<Timer>("/root/GameManager/OneSecondTicker");
Player.Timeline.Attach(ticker);
Player.Timeline.Subscribe(DateOnly.Parse("2024/11/20"), Guid.NewGuid());
Player.Timeline.OnEventTriggered += (d, e) => GD.Print($"Timeline event triggered: {d}, {e}");
var label = GetNode<Label>("BottomBar/HBoxContainer/Date");
label.Text = Player.Timeline.InternalDate.ToLongDateString();
Player.Timeline.OnDayChanged += d => label.Text = d.ToLongDateString();
var table = GetNode<Table>("Table");
Player.Timeline.OnDayChanged += d => table.RandomChangeTheme();
MoneyLabel = GetNode<Label>("BottomBar/HBoxContainer/Money");

View File

@ -119,10 +119,7 @@ public partial class Player : Node
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
var ticker = GetNode<Timer>("/root/GameManager/OneSecondTicker");
Timeline.Attach(ticker);
Timeline.Subscribe(DateOnly.Parse("2024/11/20"), Guid.NewGuid());
Timeline.OnEventTriggered += (d, e) => GD.Print($"Timeline event triggered: {d}, {e}");
}
// Called every frame. 'delta' is the elapsed time since the previous frame.

48
scripts/TileMapping.cs Normal file
View File

@ -0,0 +1,48 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
public partial class TileMapping : Node
{
/// <summary>
/// From tile coordinates to pixel coordinates. If null, use the offset instead.
/// </summary>
private Dictionary<Vector2I, Vector2I> pixelMap;
/// <summary>
/// If pixelMap is null, use this offset to convert tile coordinates to pixel coordinates.
/// </summary>
private Vector2I pixelOffset;
private Rect2I tileRect;
public TileMapping(Dictionary<Vector2I, Vector2I> map) {
pixelMap = map;
pixelOffset = new Vector2I(-int.MaxValue, -int.MaxValue);
}
public TileMapping(Vector2I offset, Rect2I rect) {
pixelMap = null;
pixelOffset = offset;
tileRect = rect;
}
public void Apply(TileMapLayer layer) {
// if pixelMap is not null, use all the pairs in pixelMap to set the tiles.
if (pixelMap != null) {
var sourceId = layer.GetCellSourceId(pixelMap.Keys.First());
foreach (var pair in pixelMap) {
layer.SetCell(pair.Key, sourceId, pair.Value);
}
} else {
var sourceId = layer.GetCellSourceId(tileRect.Position);
GD.Print(tileRect);
for (int x = tileRect.Position.X; x < tileRect.End.X; x++) {
for (int y = tileRect.Position.Y; y < tileRect.End.Y; y++) {
var pos = new Vector2I(x, y);
GD.Print($"{pos} -> {pos + pixelOffset}");
layer.SetCell(pos, sourceId, pos + pixelOffset);
}
}
}
}
}

File diff suppressed because one or more lines are too long