Initial commit

This commit is contained in:
muskit
2023-07-30 00:22:03 -07:00
commit 8e6966bfcd
39 changed files with 1417 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
using Godot;
using System;
namespace WacK.Scenes
{
public partial class Startup : Node
{
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
GD.Print($"User directory: {OS.GetUserDataDir()}");
using var songDir = DirAccess.Open("user://songs");
if (songDir != null)
{
GD.Print("Successfully opened songs directory!");
// load songs
}
else
{
GD.Print("Could not find songs directory! Creating it...");
DirAccess.MakeDirAbsolute("user://songs");
using var newSongDir = DirAccess.Open("user://songs");
if (newSongDir != null)
{
GD.Print("Songs folder created successfully!");
// create note
var note = "Place song folders here. Nested folders supported for organization.\n";
using var f = FileAccess.Open($"{newSongDir.GetCurrentDir()}/note.txt", FileAccess.ModeFlags.Write);
f.StoreString(note);
// TODO: add in-game notice
}
else
{
GD.PrintErr($"Could not create the songs directory!\n{DirAccess.GetOpenError()}");
}
}
// Change scenes
GetTree().ChangeSceneToFile("res://Scenes/DebugChartLoader.tscn");
}
}
}