Preserve current state before big refactor
This commit is contained in:
53
addons/deploy_to_steamos/GodotExportManager.cs
Normal file
53
addons/deploy_to_steamos/GodotExportManager.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
public class GodotExportManager
|
||||
{
|
||||
public static void ExportProject(
|
||||
string projectPath,
|
||||
string outputPath,
|
||||
bool isReleaseBuild,
|
||||
Callable logCallable,
|
||||
Action OnProcessExited = null)
|
||||
{
|
||||
logCallable.CallDeferred("Starting project export, this may take a while.");
|
||||
logCallable.CallDeferred($"Output path: {outputPath}");
|
||||
logCallable.CallDeferred($"Is Release Build: {(isReleaseBuild ? "Yes" : "No")}");
|
||||
|
||||
Process exportProcess = new Process();
|
||||
|
||||
exportProcess.StartInfo.FileName = OS.GetExecutablePath();
|
||||
|
||||
var arguments = $"--headless --path \"{projectPath}\" ";
|
||||
arguments += isReleaseBuild ? "--export-release " : "--export-debug ";
|
||||
arguments += "\"Steamdeck\" ";
|
||||
arguments += $"\"{outputPath}\"";
|
||||
|
||||
exportProcess.StartInfo.Arguments = arguments;
|
||||
exportProcess.StartInfo.UseShellExecute = false;
|
||||
exportProcess.StartInfo.RedirectStandardOutput = true;
|
||||
exportProcess.EnableRaisingEvents = true;
|
||||
|
||||
exportProcess.ErrorDataReceived += (sender, args) =>
|
||||
{
|
||||
throw new Exception("Error while building project: " + args.Data);
|
||||
};
|
||||
|
||||
exportProcess.OutputDataReceived += (sender, args) =>
|
||||
{
|
||||
logCallable.CallDeferred(args.Data);
|
||||
};
|
||||
|
||||
exportProcess.Exited += (sender, args) =>
|
||||
{
|
||||
OnProcessExited?.Invoke();
|
||||
exportProcess.WaitForExit();
|
||||
};
|
||||
|
||||
exportProcess.Start();
|
||||
exportProcess.BeginOutputReadLine();
|
||||
}
|
||||
}
|
||||
1
addons/deploy_to_steamos/GodotExportManager.cs.uid
Normal file
1
addons/deploy_to_steamos/GodotExportManager.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bilfhy4daj1r7
|
||||
33
addons/deploy_to_steamos/Plugin.cs
Normal file
33
addons/deploy_to_steamos/Plugin.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
#if TOOLS
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class Plugin : EditorPlugin
|
||||
{
|
||||
private Control _dock;
|
||||
private Control _settingsPanel;
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
AddAutoloadSingleton("SettingsManager", "res://addons/deploy_to_steamos/SettingsManager.cs");
|
||||
|
||||
_dock = GD.Load<PackedScene>("res://addons/deploy_to_steamos/deploy_dock/deploy_dock.tscn").Instantiate<Control>();
|
||||
_settingsPanel = GD.Load<PackedScene>("res://addons/deploy_to_steamos/settings_panel/settings_panel.tscn").Instantiate<Control>();
|
||||
|
||||
AddControlToContainer(CustomControlContainer.Toolbar, _dock);
|
||||
AddControlToContainer(CustomControlContainer.ProjectSettingTabRight, _settingsPanel);
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
RemoveControlFromContainer(CustomControlContainer.Toolbar, _dock);
|
||||
RemoveControlFromContainer(CustomControlContainer.ProjectSettingTabRight, _settingsPanel);
|
||||
|
||||
RemoveAutoloadSingleton("SettingsManager");
|
||||
|
||||
_dock.Free();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
1
addons/deploy_to_steamos/Plugin.cs.uid
Normal file
1
addons/deploy_to_steamos/Plugin.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b6d4565qxd5vp
|
||||
13
addons/deploy_to_steamos/SettingsFile.cs
Normal file
13
addons/deploy_to_steamos/SettingsFile.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
public class SettingsFile
|
||||
{
|
||||
public enum UploadMethods
|
||||
{
|
||||
Differential,
|
||||
Incremental,
|
||||
CleanReplace
|
||||
}
|
||||
|
||||
public string BuildPath { get; set; } = "";
|
||||
public string StartParameters { get; set; } = "";
|
||||
public UploadMethods UploadMethod { get; set; } = UploadMethods.Differential;
|
||||
}
|
||||
1
addons/deploy_to_steamos/SettingsFile.cs.uid
Normal file
1
addons/deploy_to_steamos/SettingsFile.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dqm7rp41yye7q
|
||||
101
addons/deploy_to_steamos/SettingsManager.cs
Normal file
101
addons/deploy_to_steamos/SettingsManager.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class SettingsManager : Node
|
||||
{
|
||||
public static SettingsManager Instance;
|
||||
|
||||
private const string FolderPath = "res://.deploy_to_steamos";
|
||||
private const string SettingsPath = FolderPath + "/settings.json";
|
||||
private const string DevicesPath = FolderPath + "/devices.json";
|
||||
|
||||
public bool IsDirty = false;
|
||||
public SettingsFile Settings = new();
|
||||
public List<SteamOSDevkitManager.Device> Devices = new();
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
Load();
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
if (!FileAccess.FileExists(SettingsPath))
|
||||
{
|
||||
Settings = new SettingsFile();
|
||||
IsDirty = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
using var settingsFile = FileAccess.Open(SettingsPath, FileAccess.ModeFlags.Read);
|
||||
var settingsFileContent = settingsFile.GetAsText();
|
||||
|
||||
Settings = JsonSerializer.Deserialize<SettingsFile>(settingsFileContent, DefaultSerializerOptions);
|
||||
|
||||
// Failsafe if settings file is corrupt
|
||||
if (Settings == null)
|
||||
{
|
||||
Settings = new SettingsFile();
|
||||
IsDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!FileAccess.FileExists(SettingsPath))
|
||||
{
|
||||
Devices = new List<SteamOSDevkitManager.Device>();
|
||||
IsDirty = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
using var devicesFile = FileAccess.Open(DevicesPath, FileAccess.ModeFlags.Read);
|
||||
var devicesFileContent = devicesFile.GetAsText();
|
||||
|
||||
Devices = JsonSerializer.Deserialize<List<SteamOSDevkitManager.Device>>(devicesFileContent, DefaultSerializerOptions);
|
||||
|
||||
// Failsafe if device file is corrupt
|
||||
if (Devices == null)
|
||||
{
|
||||
Devices = new List<SteamOSDevkitManager.Device>();
|
||||
IsDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsDirty)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
// Check if directory exists and create if it doesn't
|
||||
var dirAccess = DirAccess.Open(FolderPath);
|
||||
if (dirAccess == null)
|
||||
{
|
||||
DirAccess.MakeDirRecursiveAbsolute(FolderPath);
|
||||
}
|
||||
|
||||
// Save Settings
|
||||
var jsonSettings = JsonSerializer.Serialize(Settings);
|
||||
using var settingsFile = FileAccess.Open(SettingsPath, FileAccess.ModeFlags.Write);
|
||||
settingsFile.StoreString(jsonSettings);
|
||||
|
||||
// Save Devices
|
||||
var jsonDevices = JsonSerializer.Serialize(Devices);
|
||||
using var devicesFile = FileAccess.Open(DevicesPath, FileAccess.ModeFlags.Write);
|
||||
devicesFile.StoreString(jsonDevices);
|
||||
|
||||
IsDirty = false;
|
||||
}
|
||||
|
||||
public static readonly JsonSerializerOptions DefaultSerializerOptions = new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
};
|
||||
}
|
||||
1
addons/deploy_to_steamos/SettingsManager.cs.uid
Normal file
1
addons/deploy_to_steamos/SettingsManager.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://f4th1y34dy1y
|
||||
251
addons/deploy_to_steamos/SteamOSDevkitManager.cs
Normal file
251
addons/deploy_to_steamos/SteamOSDevkitManager.cs
Normal file
@@ -0,0 +1,251 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
using Renci.SshNet;
|
||||
using Zeroconf;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
/// <summary>
|
||||
/// Scans the network for SteamOS Devkit devices via the ZeroConf / Bonjour protocol
|
||||
/// </summary>
|
||||
public class SteamOSDevkitManager
|
||||
{
|
||||
public const string SteamOSProtocol = "_steamos-devkit._tcp.local.";
|
||||
public const string CompatibleTextVersion = "1";
|
||||
|
||||
/// <summary>
|
||||
/// Scans the network for valid SteamOS devkit devices
|
||||
/// </summary>
|
||||
/// <returns>A list of valid SteamOS devkit devices</returns>
|
||||
public static async Task<List<Device>> ScanDevices()
|
||||
{
|
||||
var networkDevices = await ZeroconfResolver.ResolveAsync(SteamOSProtocol);
|
||||
List<Device> devices = new();
|
||||
|
||||
// Iterate through all network devices and request further connection info from the service
|
||||
foreach (var networkDevice in networkDevices)
|
||||
{
|
||||
var device = new Device
|
||||
{
|
||||
DisplayName = networkDevice.DisplayName,
|
||||
IPAdress = networkDevice.IPAddress,
|
||||
ServiceName = networkDevice.DisplayName + "." + SteamOSProtocol,
|
||||
};
|
||||
|
||||
var hasServiceData = networkDevice.Services.TryGetValue(device.ServiceName, out var serviceData);
|
||||
|
||||
// This device is not a proper SteamOS device
|
||||
if(!hasServiceData) continue;
|
||||
|
||||
var properties = serviceData.Properties.FirstOrDefault();
|
||||
if (properties == null) continue;
|
||||
|
||||
// Device is not compatible (version mismatch)
|
||||
// String"1" is for some reason not equal to String"1"
|
||||
//if (properties["txtvers"] != CompatibleTextVersion) continue;
|
||||
|
||||
device.Settings = properties["settings"];
|
||||
device.Login = properties["login"];
|
||||
device.Devkit1 = properties["devkit1"];
|
||||
|
||||
devices.Add(device);
|
||||
}
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an SSH connection and runs a command
|
||||
/// </summary>
|
||||
/// <param name="device">A SteamOS devkit device</param>
|
||||
/// <param name="command">The SSH command to run</param>
|
||||
/// <param name="logCallable">A callable for logging</param>
|
||||
/// <returns>The SSH CLI output</returns>
|
||||
public static async Task<string> RunSSHCommand(Device device, string command, Callable logCallable)
|
||||
{
|
||||
logCallable.CallDeferred($"Connecting to {device.Login}@{device.IPAdress}");
|
||||
using var client = new SshClient(GetSSHConnectionInfo(device));
|
||||
await client.ConnectAsync(CancellationToken.None);
|
||||
|
||||
logCallable.CallDeferred($"Command: '{command}'");
|
||||
var sshCommand = client.CreateCommand(command);
|
||||
var result = await Task.Factory.FromAsync(sshCommand.BeginExecute(), sshCommand.EndExecute);
|
||||
|
||||
client.Disconnect();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new SCP connection and copies all local files to a remote path
|
||||
/// </summary>
|
||||
/// <param name="device">A SteamOS devkit device</param>
|
||||
/// <param name="localPath">The path on the host</param>
|
||||
/// <param name="remotePath">The path on the device</param>
|
||||
/// <param name="logCallable">A callable for logging</param>
|
||||
public static async Task CopyFiles(Device device, string localPath, string remotePath, Callable logCallable)
|
||||
{
|
||||
logCallable.CallDeferred($"Connecting to {device.Login}@{device.IPAdress}");
|
||||
using var client = new ScpClient(GetSSHConnectionInfo(device));
|
||||
await client.ConnectAsync(CancellationToken.None);
|
||||
|
||||
logCallable.CallDeferred($"Uploading files");
|
||||
|
||||
// Run async method until upload is done
|
||||
// TODO: Set Progress based on files
|
||||
var lastUploadedFilename = "";
|
||||
var uploadProgress = 0;
|
||||
var taskCompletion = new TaskCompletionSource<bool>();
|
||||
client.Uploading += (sender, e) =>
|
||||
{
|
||||
if (e.Filename != lastUploadedFilename)
|
||||
{
|
||||
lastUploadedFilename = e.Filename;
|
||||
uploadProgress = 0;
|
||||
}
|
||||
var progressPercentage = Mathf.CeilToInt((double)e.Uploaded / e.Size * 100);
|
||||
|
||||
if (progressPercentage != uploadProgress)
|
||||
{
|
||||
uploadProgress = progressPercentage;
|
||||
logCallable.CallDeferred($"Uploading {lastUploadedFilename} ({progressPercentage}%)");
|
||||
}
|
||||
|
||||
if (e.Uploaded == e.Size)
|
||||
{
|
||||
taskCompletion.TrySetResult(true);
|
||||
}
|
||||
};
|
||||
client.ErrorOccurred += (sender, args) => throw new Exception("Error while uploading build.");
|
||||
|
||||
await Task.Run(() => client.Upload(new DirectoryInfo(localPath), remotePath));
|
||||
await taskCompletion.Task;
|
||||
client.Disconnect();
|
||||
|
||||
logCallable.CallDeferred($"Fixing file permissions");
|
||||
await RunSSHCommand(device, $"chmod +x -R {remotePath}", logCallable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs an SSH command on the device that runs the steamos-prepare-upload script
|
||||
/// </summary>
|
||||
/// <param name="device">A SteamOS devkit device</param>
|
||||
/// <param name="gameId">An ID for the game</param>
|
||||
/// <param name="logCallable">A callable for logging</param>
|
||||
/// <returns>The CLI result</returns>
|
||||
public static async Task<PrepareUploadResult> PrepareUpload(Device device, string gameId, Callable logCallable)
|
||||
{
|
||||
logCallable.CallDeferred("Preparing upload");
|
||||
|
||||
var resultRaw = await RunSSHCommand(device, "python3 ~/devkit-utils/steamos-prepare-upload --gameid " + gameId, logCallable);
|
||||
var result = JsonSerializer.Deserialize<PrepareUploadResult>(resultRaw, DefaultSerializerOptions);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs an SSH command on the device that runs the steamos-create-shortcut script
|
||||
/// </summary>
|
||||
/// <param name="device">A SteamOS devkit device</param>
|
||||
/// <param name="parameters">Parameters for the shortcut</param>
|
||||
/// <param name="logCallable">A callable for logging</param>
|
||||
/// <returns>The CLI result</returns>
|
||||
public static async Task<CreateShortcutResult> CreateShortcut(Device device, CreateShortcutParameters parameters, Callable logCallable)
|
||||
{
|
||||
var parametersJson = JsonSerializer.Serialize(parameters);
|
||||
var command = $"python3 ~/devkit-utils/steam-client-create-shortcut --parms '{parametersJson}'";
|
||||
|
||||
var resultRaw = await RunSSHCommand(device, command, logCallable);
|
||||
var result = JsonSerializer.Deserialize<CreateShortcutResult>(resultRaw, DefaultSerializerOptions);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A SteamOS devkit device
|
||||
/// </summary>
|
||||
public class Device
|
||||
{
|
||||
public string DisplayName { get; set; }
|
||||
public string IPAdress { get; set; }
|
||||
public int Port { get; set; }
|
||||
public string ServiceName { get; set; }
|
||||
public string Settings { get; set; }
|
||||
public string Login { get; set; }
|
||||
public string Devkit1 { get; set; }
|
||||
}
|
||||
|
||||
public class PrepareUploadResult
|
||||
{
|
||||
public string User { get; set; }
|
||||
public string Directory { get; set; }
|
||||
}
|
||||
|
||||
public class CreateShortcutResult
|
||||
{
|
||||
public string Error { get; set; }
|
||||
public string Success { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parameters for the CreateShortcut method
|
||||
/// </summary>
|
||||
public struct CreateShortcutParameters
|
||||
{
|
||||
public string gameid { get; set; }
|
||||
public string directory { get; set; }
|
||||
public string[] argv { get; set; }
|
||||
public Dictionary<string, string> settings { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the path to the devkit_rsa key generated by the official SteamOS devkit client
|
||||
/// </summary>
|
||||
/// <returns>The path to the "devkit_rsa" key</returns>
|
||||
public static string GetPrivateKeyPath()
|
||||
{
|
||||
string applicationDataPath;
|
||||
switch (System.Environment.OSVersion.Platform)
|
||||
{
|
||||
// TODO: Linux Support
|
||||
case PlatformID.Win32NT:
|
||||
applicationDataPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "steamos-devkit");
|
||||
break;
|
||||
case PlatformID.Unix:
|
||||
applicationDataPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "Library", "Application Support");
|
||||
break;
|
||||
default:
|
||||
applicationDataPath = "";
|
||||
break;
|
||||
}
|
||||
|
||||
var keyFolder = Path.Combine(applicationDataPath, "steamos-devkit");
|
||||
return Path.Combine(keyFolder, "devkit_rsa");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a SSH Connection Info for a SteamOS devkit device
|
||||
/// </summary>
|
||||
/// <param name="device">A SteamOS devkit device</param>
|
||||
/// <returns>An SSH ConnectionInfo</returns>
|
||||
/// <exception cref="Exception">Throws if there is no private key present</exception>
|
||||
public static ConnectionInfo GetSSHConnectionInfo(Device device)
|
||||
{
|
||||
var privateKeyPath = GetPrivateKeyPath();
|
||||
if (!File.Exists(privateKeyPath)) throw new Exception("devkit_rsa key is missing. Have you connected to your device via the official devkit UI yet?");
|
||||
|
||||
var privateKeyFile = new PrivateKeyFile(privateKeyPath);
|
||||
return new ConnectionInfo(device.IPAdress, device.Login, new PrivateKeyAuthenticationMethod(device.Login, privateKeyFile));
|
||||
}
|
||||
|
||||
public static readonly JsonSerializerOptions DefaultSerializerOptions = new JsonSerializerOptions
|
||||
{
|
||||
PropertyNameCaseInsensitive = true,
|
||||
};
|
||||
}
|
||||
1
addons/deploy_to_steamos/SteamOSDevkitManager.cs.uid
Normal file
1
addons/deploy_to_steamos/SteamOSDevkitManager.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dvupxtmvbmofd
|
||||
130
addons/deploy_to_steamos/add_device_window/AddDeviceWindow.cs
Normal file
130
addons/deploy_to_steamos/add_device_window/AddDeviceWindow.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class AddDeviceWindow : Window
|
||||
{
|
||||
private bool _isVisible;
|
||||
private bool _isUpdatingDevices;
|
||||
private float _scanCooldown;
|
||||
private List<SteamOSDevkitManager.Device> _scannedDevices = new();
|
||||
private List<SteamOSDevkitManager.Device> _pairedDevices = new();
|
||||
|
||||
public delegate void DevicesChangedDelegate(List<SteamOSDevkitManager.Device> devices);
|
||||
public event DevicesChangedDelegate OnDevicesChanged;
|
||||
|
||||
[ExportGroup("References")]
|
||||
[Export] private VBoxContainer _devicesContainer;
|
||||
[Export] private PackedScene _deviceItemPrefab;
|
||||
[Export] private Button _refreshButton;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (!Visible) return;
|
||||
|
||||
_scanCooldown -= (float)delta;
|
||||
if (_scanCooldown < 0f)
|
||||
{
|
||||
_scanCooldown = 10f;
|
||||
UpdateDevices();
|
||||
UpdateDeviceList();
|
||||
}
|
||||
|
||||
_refreshButton.Disabled = _isUpdatingDevices;
|
||||
}
|
||||
|
||||
private async void UpdateDevices()
|
||||
{
|
||||
if (!Visible || _isUpdatingDevices) return;
|
||||
|
||||
_isUpdatingDevices = true;
|
||||
|
||||
var devices = await SteamOSDevkitManager.ScanDevices();
|
||||
if (devices != _scannedDevices)
|
||||
{
|
||||
foreach (var device in devices)
|
||||
{
|
||||
if (
|
||||
_scannedDevices.Exists(x => x.IPAdress == device.IPAdress && x.Login == device.Login)
|
||||
|| _pairedDevices.Exists(x => x.IPAdress == device.IPAdress && x.Login == device.Login)
|
||||
) continue;
|
||||
|
||||
_scannedDevices.Add(device);
|
||||
}
|
||||
|
||||
UpdateDeviceList();
|
||||
}
|
||||
|
||||
_isUpdatingDevices = false;
|
||||
}
|
||||
|
||||
public void UpdateDeviceList()
|
||||
{
|
||||
// Clear List
|
||||
foreach (var childNode in _devicesContainer.GetChildren())
|
||||
{
|
||||
childNode.QueueFree();
|
||||
}
|
||||
|
||||
var devices = new List<SteamOSDevkitManager.Device>();
|
||||
devices.AddRange(_pairedDevices);
|
||||
foreach (var scannedDevice in _scannedDevices)
|
||||
{
|
||||
if (devices.Exists(x => x.IPAdress == scannedDevice.IPAdress && x.Login == scannedDevice.Login))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
devices.Add(scannedDevice);
|
||||
}
|
||||
|
||||
foreach (var scannedDevice in devices)
|
||||
{
|
||||
var deviceItem = _deviceItemPrefab.Instantiate<DeviceItemPrefab>();
|
||||
deviceItem.SetUI(scannedDevice);
|
||||
deviceItem.OnDevicePair += device =>
|
||||
{
|
||||
// TODO: Connect to device and run a random ssh command to check communication
|
||||
if (!_pairedDevices.Exists(x => x.IPAdress == device.IPAdress && x.Login == device.Login))
|
||||
{
|
||||
_pairedDevices.Add(device);
|
||||
}
|
||||
UpdateDeviceList();
|
||||
};
|
||||
deviceItem.OnDeviceUnpair += device =>
|
||||
{
|
||||
_pairedDevices.Remove(device);
|
||||
UpdateDeviceList();
|
||||
};
|
||||
_devicesContainer.AddChild(deviceItem);
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Hide();
|
||||
|
||||
if (_pairedDevices != SettingsManager.Instance.Devices)
|
||||
{
|
||||
OnDevicesChanged?.Invoke(_pairedDevices);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnVisibilityChanged()
|
||||
{
|
||||
if (Visible)
|
||||
{
|
||||
_isVisible = true;
|
||||
|
||||
// Prepopulate device list with saved devices
|
||||
_pairedDevices = new List<SteamOSDevkitManager.Device>(SettingsManager.Instance.Devices);
|
||||
UpdateDeviceList();
|
||||
}
|
||||
else
|
||||
{
|
||||
_isVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://db4834umjmne2
|
||||
@@ -0,0 +1,42 @@
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class DeviceItemPrefab : PanelContainer
|
||||
{
|
||||
private SteamOSDevkitManager.Device _device;
|
||||
|
||||
public delegate void DeviceDelegate(SteamOSDevkitManager.Device device);
|
||||
public event DeviceDelegate OnDevicePair;
|
||||
public event DeviceDelegate OnDeviceUnpair;
|
||||
|
||||
[ExportGroup("References")]
|
||||
[Export] private Label _deviceNameLabel;
|
||||
[Export] private Label _deviceConnectionLabel;
|
||||
[Export] private Button _devicePairButton;
|
||||
[Export] private Button _deviceUnpairButton;
|
||||
|
||||
public void SetUI(SteamOSDevkitManager.Device device)
|
||||
{
|
||||
_device = device;
|
||||
_deviceNameLabel.Text = device.DisplayName;
|
||||
_deviceConnectionLabel.Text = $"{device.Login}@{device.IPAdress}";
|
||||
|
||||
if (SettingsManager.Instance.Devices.Exists(x => x.IPAdress == device.IPAdress && x.Login == device.Login))
|
||||
{
|
||||
_devicePairButton.Visible = false;
|
||||
_deviceUnpairButton.Visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Pair()
|
||||
{
|
||||
OnDevicePair?.Invoke(_device);
|
||||
}
|
||||
|
||||
public void Unpair()
|
||||
{
|
||||
OnDeviceUnpair?.Invoke(_device);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://b42137lbyy050
|
||||
@@ -0,0 +1,107 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://6be5afncp3nr"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/deploy_to_steamos/add_device_window/AddDeviceWindow.cs" id="1_3tepc"]
|
||||
[ext_resource type="PackedScene" uid="uid://p64nkj5ii2xt" path="res://addons/deploy_to_steamos/add_device_window/device_item_prefab.tscn" id="2_dka1k"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mam6h"]
|
||||
content_margin_left = 0.0
|
||||
content_margin_top = 0.0
|
||||
content_margin_right = 0.0
|
||||
content_margin_bottom = 0.0
|
||||
bg_color = Color(0.0666667, 0.0666667, 0.0666667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_imdn0"]
|
||||
content_margin_left = 30.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 30.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.2, 0.0823529, 0.121569, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_74135"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ne8al"]
|
||||
content_margin_left = 30.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 30.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.133333, 0.133333, 0.133333, 1)
|
||||
|
||||
[node name="AddDeviceWindow" type="Window" node_paths=PackedStringArray("_devicesContainer", "_refreshButton")]
|
||||
title = "Add devkit device"
|
||||
initial_position = 1
|
||||
size = Vector2i(650, 500)
|
||||
transient = true
|
||||
exclusive = true
|
||||
min_size = Vector2i(650, 500)
|
||||
script = ExtResource("1_3tepc")
|
||||
_devicesContainer = NodePath("PanelContainer/VBoxContainer/ScrollContainer/ContentContainer/DevicesContainer")
|
||||
_deviceItemPrefab = ExtResource("2_dka1k")
|
||||
_refreshButton = NodePath("PanelContainer/VBoxContainer/ActionsContainer/HBoxContainer/RefreshButton")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
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_styles/panel = SubResource("StyleBoxFlat_mam6h")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="InfoContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_imdn0")
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/InfoContainer"]
|
||||
custom_minimum_size = Vector2(0, 10)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 0.788235, 0.858824, 1)
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "Please keep in mind that you need to connect to your devkit device at least once through the official SteamOS devkit client to install the devkit tools to your device and create the necessary authentication keys."
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ContentContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_74135")
|
||||
|
||||
[node name="DevicesContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/ScrollContainer/ContentContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="ActionsContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ne8al")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/ActionsContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 2
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="PanelContainer/VBoxContainer/ActionsContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Refresh"
|
||||
|
||||
[node name="CloseButton" type="Button" parent="PanelContainer/VBoxContainer/ActionsContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Close"
|
||||
|
||||
[connection signal="close_requested" from="." to="." method="Close"]
|
||||
[connection signal="visibility_changed" from="." to="." method="OnVisibilityChanged"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/ActionsContainer/HBoxContainer/RefreshButton" to="." method="UpdateDevices"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/ActionsContainer/HBoxContainer/CloseButton" to="." method="Close"]
|
||||
@@ -0,0 +1,63 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://p64nkj5ii2xt"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/deploy_to_steamos/add_device_window/DeviceItemPrefab.cs" id="1_q77lw"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6g2hd"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.133333, 0.133333, 0.133333, 1)
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[node name="DeviceItemPrefab" type="PanelContainer" node_paths=PackedStringArray("_deviceNameLabel", "_deviceConnectionLabel", "_devicePairButton", "_deviceUnpairButton")]
|
||||
offset_right = 532.0
|
||||
offset_bottom = 51.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_6g2hd")
|
||||
script = ExtResource("1_q77lw")
|
||||
_deviceNameLabel = NodePath("HBoxContainer/VBoxContainer/DeviceNameLabel")
|
||||
_deviceConnectionLabel = NodePath("HBoxContainer/VBoxContainer/DeviceConnectionLabel")
|
||||
_devicePairButton = NodePath("HBoxContainer/PairButton")
|
||||
_deviceUnpairButton = NodePath("HBoxContainer/UnpairButton")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 5
|
||||
alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = -5
|
||||
|
||||
[node name="DeviceNameLabel" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "steamdeck"
|
||||
|
||||
[node name="DeviceConnectionLabel" type="Label" parent="HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 0.490196)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "deck@127.0.0.1"
|
||||
|
||||
[node name="PairButton" type="Button" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/icon_max_width = 20
|
||||
text = "Pair"
|
||||
|
||||
[node name="UnpairButton" type="Button" parent="HBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/icon_max_width = 20
|
||||
text = "Unpair"
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/PairButton" to="." method="Pair"]
|
||||
[connection signal="pressed" from="HBoxContainer/UnpairButton" to="." method="Unpair"]
|
||||
108
addons/deploy_to_steamos/deploy_dock/DeployDock.cs
Normal file
108
addons/deploy_to_steamos/deploy_dock/DeployDock.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class DeployDock : PanelContainer
|
||||
{
|
||||
private int _selectedId = 10000;
|
||||
|
||||
[Export] private OptionButton _deployTargetButton;
|
||||
[Export] private Button _deployButton;
|
||||
[Export] private AddDeviceWindow _addDeviceWindow;
|
||||
[Export] private DeployWindow _deployWindow;
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
_addDeviceWindow.OnDevicesChanged += OnDevicesChanged;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
_addDeviceWindow.OnDevicesChanged -= OnDevicesChanged;
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
UpdateDropdown();
|
||||
}
|
||||
|
||||
public void OnDeployTargetItemSelected(int index)
|
||||
{
|
||||
var itemId = _deployTargetButton.GetItemId(index);
|
||||
if (_selectedId == itemId) return;
|
||||
|
||||
if (itemId <= 10000)
|
||||
{
|
||||
_selectedId = itemId;
|
||||
}
|
||||
else if (itemId == 10001)
|
||||
{
|
||||
_addDeviceWindow.Show();
|
||||
}
|
||||
|
||||
_deployTargetButton.Select(_deployTargetButton.GetItemIndex(_selectedId));
|
||||
_deployButton.Disabled = _selectedId >= 10000;
|
||||
}
|
||||
|
||||
public void Deploy()
|
||||
{
|
||||
var device = SettingsManager.Instance.Devices.ElementAtOrDefault(_selectedId);
|
||||
if (device == null)
|
||||
{
|
||||
GD.PrintErr("[DeployToSteamOS] Unknown deploy target.");
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Detect Export Presets and stop if no Linux preset named "Steamdeck" exists
|
||||
|
||||
_deployWindow.Deploy(device);
|
||||
}
|
||||
|
||||
private void OnDevicesChanged(List<SteamOSDevkitManager.Device> devices)
|
||||
{
|
||||
// Adding Devices
|
||||
var devicesToAdd = devices.Where(device => !SettingsManager.Instance.Devices.Exists(x => x.IPAdress == device.IPAdress && x.Login == device.Login)).ToList();
|
||||
foreach (var device in devicesToAdd)
|
||||
{
|
||||
SettingsManager.Instance.Devices.Add(device);
|
||||
}
|
||||
|
||||
// Removing Devices
|
||||
var devicesToRemove = SettingsManager.Instance.Devices.Where(savedDevice => !devices.Exists(x => x.IPAdress == savedDevice.IPAdress && x.Login == savedDevice.Login)).ToList();
|
||||
foreach (var savedDevice in devicesToRemove)
|
||||
{
|
||||
SettingsManager.Instance.Devices.Remove(savedDevice);
|
||||
}
|
||||
|
||||
SettingsManager.Instance.Save();
|
||||
UpdateDropdown();
|
||||
}
|
||||
|
||||
private async void UpdateDropdown()
|
||||
{
|
||||
// Hack to prevent console error
|
||||
// Godot apparently calls this before the settings are loaded
|
||||
while (SettingsManager.Instance == null)
|
||||
{
|
||||
await Task.Delay(10);
|
||||
}
|
||||
|
||||
_deployTargetButton.Clear();
|
||||
_deployTargetButton.AddItem("None", 10000);
|
||||
|
||||
for (var index = 0; index < SettingsManager.Instance.Devices.Count; index++)
|
||||
{
|
||||
var savedDevice = SettingsManager.Instance.Devices.ElementAtOrDefault(index);
|
||||
if(savedDevice == null) continue;
|
||||
|
||||
_deployTargetButton.AddItem($"{savedDevice.DisplayName} ({savedDevice.Login}@{savedDevice.IPAdress})", index);
|
||||
}
|
||||
|
||||
_deployTargetButton.AddSeparator();
|
||||
_deployTargetButton.AddItem("Add devkit device", 10001);
|
||||
}
|
||||
}
|
||||
1
addons/deploy_to_steamos/deploy_dock/DeployDock.cs.uid
Normal file
1
addons/deploy_to_steamos/deploy_dock/DeployDock.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://0kau18vff4u2
|
||||
54
addons/deploy_to_steamos/deploy_dock/deploy_dock.tscn
Normal file
54
addons/deploy_to_steamos/deploy_dock/deploy_dock.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://kdbpdei4v1ub"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/deploy_to_steamos/deploy_dock/DeployDock.cs" id="1_atc6e"]
|
||||
[ext_resource type="Texture2D" uid="uid://s1tcpal4iir4" path="res://addons/deploy_to_steamos/icon.svg" id="2_rpj28"]
|
||||
[ext_resource type="PackedScene" uid="uid://6be5afncp3nr" path="res://addons/deploy_to_steamos/add_device_window/add_device_window.tscn" id="3_qfyb3"]
|
||||
[ext_resource type="PackedScene" uid="uid://ds2umdqybfls8" path="res://addons/deploy_to_steamos/deploy_window/deploy_window.tscn" id="4_8y8co"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ebqha"]
|
||||
content_margin_left = 10.0
|
||||
|
||||
[node name="DeployDock" type="PanelContainer" node_paths=PackedStringArray("_deployTargetButton", "_deployButton", "_addDeviceWindow", "_deployWindow")]
|
||||
offset_right = 337.0
|
||||
offset_bottom = 32.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ebqha")
|
||||
script = ExtResource("1_atc6e")
|
||||
_deployTargetButton = NodePath("HBoxContainer/DeployTargetButton")
|
||||
_deployButton = NodePath("HBoxContainer/DeployButton")
|
||||
_addDeviceWindow = NodePath("AddDeviceWindow")
|
||||
_deployWindow = NodePath("DeployWindow")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DeployTargetButton" type="OptionButton" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
item_count = 3
|
||||
selected = 0
|
||||
popup/item_0/text = "None"
|
||||
popup/item_0/id = 10000
|
||||
popup/item_1/text = ""
|
||||
popup/item_1/id = -1
|
||||
popup/item_1/separator = true
|
||||
popup/item_2/text = "Add devkit device"
|
||||
popup/item_2/id = 10001
|
||||
|
||||
[node name="DeployButton" type="Button" parent="HBoxContainer"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
icon = ExtResource("2_rpj28")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="AddDeviceWindow" parent="." instance=ExtResource("3_qfyb3")]
|
||||
visible = false
|
||||
|
||||
[node name="DeployWindow" parent="." instance=ExtResource("4_8y8co")]
|
||||
visible = false
|
||||
|
||||
[connection signal="item_selected" from="HBoxContainer/DeployTargetButton" to="." method="OnDeployTargetItemSelected"]
|
||||
[connection signal="pressed" from="HBoxContainer/DeployButton" to="." method="Deploy"]
|
||||
38
addons/deploy_to_steamos/deploy_window/DeployWindow.Build.cs
Normal file
38
addons/deploy_to_steamos/deploy_window/DeployWindow.Build.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
public partial class DeployWindow
|
||||
{
|
||||
private async Task DeployBuild(Callable logCallable)
|
||||
{
|
||||
CurrentStep = DeployStep.Building;
|
||||
CurrentProgress = StepProgress.Running;
|
||||
UpdateUI();
|
||||
|
||||
// Adding a 2 second delay so the UI can update
|
||||
await ToSignal(GetTree().CreateTimer(1), "timeout");
|
||||
var buildTask = new TaskCompletionSource<bool>();
|
||||
|
||||
if (SettingsManager.Instance.Settings.UploadMethod == SettingsFile.UploadMethods.CleanReplace)
|
||||
{
|
||||
AddToConsole(DeployStep.Building, "Removing previous build as upload method is set to CleanReplace");
|
||||
await SteamOSDevkitManager.RunSSHCommand(_device, "python3 ~/devkit-utils/steamos-delete --delete-title " + _gameId, logCallable);
|
||||
}
|
||||
|
||||
GodotExportManager.ExportProject(
|
||||
ProjectSettings.GlobalizePath("res://"),
|
||||
Path.Join(_localPath, "game.x86_64"),
|
||||
false,
|
||||
logCallable,
|
||||
() => { buildTask.SetResult(true); }
|
||||
);
|
||||
|
||||
await buildTask.Task;
|
||||
|
||||
CurrentProgress = StepProgress.Succeeded;
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bye7k4dvdra1b
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
public partial class DeployWindow
|
||||
{
|
||||
private async Task DeployCreateShortcut(Callable logCallable)
|
||||
{
|
||||
CurrentStep = DeployStep.CreateShortcut;
|
||||
CurrentProgress = StepProgress.Running;
|
||||
UpdateUI();
|
||||
|
||||
var createShortcutParameters = new SteamOSDevkitManager.CreateShortcutParameters
|
||||
{
|
||||
gameid = _gameId,
|
||||
directory = _prepareUploadResult.Directory,
|
||||
argv = new[] { "game.x86_64", SettingsManager.Instance.Settings.StartParameters },
|
||||
settings = new Dictionary<string, string>
|
||||
{
|
||||
{ "steam_play", "0" }
|
||||
},
|
||||
};
|
||||
|
||||
// TODO: Fix Result, success/error are not filled in response but exist/dont
|
||||
_createShortcutResult = await SteamOSDevkitManager.CreateShortcut(
|
||||
_device,
|
||||
createShortcutParameters,
|
||||
logCallable
|
||||
);
|
||||
|
||||
CurrentProgress = StepProgress.Succeeded;
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cveynna4dxqj
|
||||
41
addons/deploy_to_steamos/deploy_window/DeployWindow.Init.cs
Normal file
41
addons/deploy_to_steamos/deploy_window/DeployWindow.Init.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
public partial class DeployWindow
|
||||
{
|
||||
private async Task DeployInit()
|
||||
{
|
||||
CurrentStep = DeployStep.Init;
|
||||
CurrentProgress = StepProgress.Running;
|
||||
UpdateUI();
|
||||
|
||||
await Task.Delay(0);
|
||||
|
||||
_gameId = ProjectSettings.GetSetting("application/config/name", "game").AsString();
|
||||
_gameId = Regex.Replace(_gameId, @"[^a-zA-Z0-9]", string.Empty);
|
||||
|
||||
// Add current timestamp to gameid for incremental builds
|
||||
if (SettingsManager.Instance.Settings.UploadMethod == SettingsFile.UploadMethods.Incremental)
|
||||
{
|
||||
_gameId += "_" + DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||
}
|
||||
|
||||
GD.Print($"[DeployToSteamOS] Deploying '{_gameId}' to '{_device.DisplayName} ({_device.Login}@{_device.IPAdress})'");
|
||||
|
||||
_localPath = SettingsManager.Instance.Settings.BuildPath;
|
||||
if (DirAccess.Open(_localPath) == null)
|
||||
{
|
||||
GD.PrintErr($"[DeployToSteamOS] Build path '{_localPath}' does not exist.");
|
||||
UpdateUIToFail();
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentProgress = StepProgress.Succeeded;
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://bhkwfem6monsw
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
public partial class DeployWindow
|
||||
{
|
||||
private async Task DeployPrepareUpload(Callable logCallable)
|
||||
{
|
||||
CurrentStep = DeployStep.PrepareUpload;
|
||||
CurrentProgress = StepProgress.Running;
|
||||
UpdateUI();
|
||||
|
||||
_prepareUploadResult = await SteamOSDevkitManager.PrepareUpload(
|
||||
_device,
|
||||
_gameId,
|
||||
logCallable
|
||||
);
|
||||
|
||||
AddToConsole(DeployStep.PrepareUpload, $"User: {_prepareUploadResult.User}");
|
||||
AddToConsole(DeployStep.PrepareUpload, $"Directory: {_prepareUploadResult.Directory}");
|
||||
|
||||
CurrentProgress = StepProgress.Succeeded;
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://do8iwi7jpset4
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
public partial class DeployWindow
|
||||
{
|
||||
private async Task DeployUpload(Callable logCallable)
|
||||
{
|
||||
CurrentStep = DeployStep.Uploading;
|
||||
CurrentProgress = StepProgress.Running;
|
||||
UpdateUI();
|
||||
|
||||
try
|
||||
{
|
||||
await SteamOSDevkitManager.CopyFiles(
|
||||
_device,
|
||||
_localPath,
|
||||
_prepareUploadResult.Directory,
|
||||
logCallable
|
||||
);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
AddToConsole(DeployStep.Uploading, e.Message);
|
||||
UpdateUIToFail();
|
||||
}
|
||||
|
||||
CurrentProgress = StepProgress.Succeeded;
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://csn5do4f3tqya
|
||||
304
addons/deploy_to_steamos/deploy_window/DeployWindow.cs
Normal file
304
addons/deploy_to_steamos/deploy_window/DeployWindow.cs
Normal file
@@ -0,0 +1,304 @@
|
||||
using System.Collections.Generic;
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class DeployWindow : Window
|
||||
{
|
||||
public enum DeployStep
|
||||
{
|
||||
Init,
|
||||
Building,
|
||||
PrepareUpload,
|
||||
Uploading,
|
||||
CreateShortcut,
|
||||
Done
|
||||
}
|
||||
public DeployStep CurrentStep = DeployStep.Init;
|
||||
|
||||
public enum StepProgress
|
||||
{
|
||||
Queued,
|
||||
Running,
|
||||
Succeeded,
|
||||
Failed
|
||||
}
|
||||
public StepProgress CurrentProgress = StepProgress.Queued;
|
||||
|
||||
private string _localPath;
|
||||
private string _gameId;
|
||||
private SteamOSDevkitManager.Device _device;
|
||||
private SteamOSDevkitManager.PrepareUploadResult _prepareUploadResult;
|
||||
private SteamOSDevkitManager.CreateShortcutResult _createShortcutResult;
|
||||
|
||||
private Dictionary<StepProgress, Color> _colorsBright = new()
|
||||
{
|
||||
{ StepProgress.Queued, new Color("#6a6a6a") },
|
||||
{ StepProgress.Running, new Color("#ffffff") },
|
||||
{ StepProgress.Succeeded, new Color("#00f294") },
|
||||
{ StepProgress.Failed, new Color("#ff4245") },
|
||||
};
|
||||
private Dictionary<StepProgress, Color> _colorsDim = new()
|
||||
{
|
||||
{ StepProgress.Queued, new Color("#1d1d1d") },
|
||||
{ StepProgress.Running, new Color("#222222") },
|
||||
{ StepProgress.Succeeded, new Color("#13241d") },
|
||||
{ StepProgress.Failed, new Color("#241313") },
|
||||
};
|
||||
|
||||
[ExportGroup("References")]
|
||||
[Export] private VBoxContainer _buildingContainer;
|
||||
[Export] private VBoxContainer _prepareUploadContainer;
|
||||
[Export] private VBoxContainer _uploadingContainer;
|
||||
[Export] private VBoxContainer _createShortcutContainer;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (CurrentStep != DeployStep.Done)
|
||||
{
|
||||
var container = CurrentStep switch
|
||||
{
|
||||
DeployStep.Building => _buildingContainer,
|
||||
DeployStep.PrepareUpload => _prepareUploadContainer,
|
||||
DeployStep.Uploading => _uploadingContainer,
|
||||
DeployStep.CreateShortcut => _createShortcutContainer,
|
||||
_ => null
|
||||
};
|
||||
if (container != null)
|
||||
{
|
||||
var progressBar = container.GetNode<ProgressBar>("Progressbar");
|
||||
if (progressBar.Value < 95f)
|
||||
{
|
||||
var shouldDoubleSpeed = CurrentStep is DeployStep.PrepareUpload or DeployStep.CreateShortcut;
|
||||
progressBar.Value += (float)delta * (shouldDoubleSpeed ? 2f : 1f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async void Deploy(SteamOSDevkitManager.Device device)
|
||||
{
|
||||
if (device == null)
|
||||
{
|
||||
GD.PrintErr("[DeployToSteamOS] Device is not available.");
|
||||
return;
|
||||
}
|
||||
|
||||
_device = device;
|
||||
_prepareUploadResult = null;
|
||||
_createShortcutResult = null;
|
||||
ResetUI();
|
||||
|
||||
Title = $"Deploying to {_device.DisplayName} ({_device.Login}@{_device.IPAdress})";
|
||||
Show();
|
||||
|
||||
await DeployInit();
|
||||
await DeployBuild(Callable.From((Variant log) => AddToConsole(DeployStep.Building, log.AsString())));
|
||||
await DeployPrepareUpload(Callable.From((Variant log) => AddToConsole(DeployStep.PrepareUpload, log.AsString())));
|
||||
await DeployUpload(Callable.From((Variant log) => AddToConsole(DeployStep.Uploading, log.AsString())));
|
||||
await DeployCreateShortcut(Callable.From((Variant log) => AddToConsole(DeployStep.CreateShortcut, log.AsString())));
|
||||
|
||||
CurrentStep = DeployStep.Done;
|
||||
CurrentProgress = StepProgress.Succeeded;
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (CurrentStep != DeployStep.Init && CurrentStep != DeployStep.Done) return;
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void UpdateUI()
|
||||
{
|
||||
UpdateContainer(CurrentStep, CurrentProgress);
|
||||
if (CurrentStep == DeployStep.Done)
|
||||
{
|
||||
SetConsoleVisibility(DeployStep.Building, false, false);
|
||||
SetConsoleVisibility(DeployStep.PrepareUpload, false, false);
|
||||
SetConsoleVisibility(DeployStep.Uploading, false, false);
|
||||
SetConsoleVisibility(DeployStep.CreateShortcut, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetUI()
|
||||
{
|
||||
// Clear Consoles
|
||||
List<Node> consoleNodes = new();
|
||||
consoleNodes.AddRange(_buildingContainer.GetNode<VBoxContainer>("ConsoleContainer/ScrollContainer/VBoxContainer").GetChildren());
|
||||
consoleNodes.AddRange(_prepareUploadContainer.GetNode<VBoxContainer>("ConsoleContainer/ScrollContainer/VBoxContainer").GetChildren());
|
||||
consoleNodes.AddRange(_uploadingContainer.GetNode<VBoxContainer>("ConsoleContainer/ScrollContainer/VBoxContainer").GetChildren());
|
||||
consoleNodes.AddRange(_createShortcutContainer.GetNode<VBoxContainer>("ConsoleContainer/ScrollContainer/VBoxContainer").GetChildren());
|
||||
|
||||
foreach (var consoleNode in consoleNodes)
|
||||
{
|
||||
consoleNode.QueueFree();
|
||||
}
|
||||
|
||||
// Clear States
|
||||
UpdateContainer(DeployStep.Building, StepProgress.Queued);
|
||||
UpdateContainer(DeployStep.PrepareUpload, StepProgress.Queued);
|
||||
UpdateContainer(DeployStep.Uploading, StepProgress.Queued);
|
||||
UpdateContainer(DeployStep.CreateShortcut, StepProgress.Queued);
|
||||
|
||||
CurrentStep = DeployStep.Init;
|
||||
CurrentProgress = StepProgress.Queued;
|
||||
}
|
||||
|
||||
private void UpdateContainer(DeployStep step, StepProgress progress)
|
||||
{
|
||||
var container = step switch
|
||||
{
|
||||
DeployStep.Building => _buildingContainer,
|
||||
DeployStep.PrepareUpload => _prepareUploadContainer,
|
||||
DeployStep.Uploading => _uploadingContainer,
|
||||
DeployStep.CreateShortcut => _createShortcutContainer,
|
||||
_ => null
|
||||
};
|
||||
if (container == null) return;
|
||||
|
||||
var headerContainer = container.GetNode<PanelContainer>("HeaderContainer");
|
||||
var label = headerContainer.GetNode<Label>("HBoxContainer/Label");
|
||||
var toggleConsoleButton = headerContainer.GetNode<Button>("HBoxContainer/ToggleConsoleButton");
|
||||
var progressBar = container.GetNode<ProgressBar>("Progressbar");
|
||||
|
||||
label.AddThemeColorOverride("font_color", _colorsBright[progress]);
|
||||
|
||||
headerContainer.AddThemeStyleboxOverride("panel", new StyleBoxFlat
|
||||
{
|
||||
BgColor = _colorsDim[progress],
|
||||
ContentMarginTop = 10,
|
||||
ContentMarginBottom = 10,
|
||||
ContentMarginLeft = 10,
|
||||
ContentMarginRight = 10,
|
||||
});
|
||||
|
||||
progressBar.AddThemeStyleboxOverride("fill", new StyleBoxFlat
|
||||
{
|
||||
BgColor = _colorsBright[progress],
|
||||
});
|
||||
progressBar.Value = progress switch
|
||||
{
|
||||
StepProgress.Queued => 0,
|
||||
StepProgress.Running => 0,
|
||||
StepProgress.Succeeded => 100,
|
||||
StepProgress.Failed => 100,
|
||||
_ => progressBar.Value
|
||||
};
|
||||
|
||||
SetConsoleVisibility(step, progress == StepProgress.Running, false);
|
||||
|
||||
toggleConsoleButton.Visible = progress is StepProgress.Succeeded or StepProgress.Failed;
|
||||
toggleConsoleButton.Disabled = progress is not StepProgress.Succeeded and not StepProgress.Failed;
|
||||
}
|
||||
|
||||
private void AddToConsole(DeployStep step, string text)
|
||||
{
|
||||
var consoleContainer = step switch
|
||||
{
|
||||
DeployStep.Building => _buildingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.PrepareUpload => _prepareUploadContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.Uploading => _uploadingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.CreateShortcut => _createShortcutContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
_ => null
|
||||
};
|
||||
if (consoleContainer == null) return;
|
||||
|
||||
var consoleScrollContainer = consoleContainer.GetNode<ScrollContainer>("ScrollContainer");
|
||||
var consoleVBoxContainer = consoleScrollContainer.GetNode<VBoxContainer>("VBoxContainer");
|
||||
|
||||
// Create new Label
|
||||
var newLabel = new Label { Text = text };
|
||||
newLabel.AddThemeFontSizeOverride("font_size", 12);
|
||||
newLabel.AutowrapMode = TextServer.AutowrapMode.Word;
|
||||
newLabel.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
|
||||
consoleVBoxContainer.AddChild(newLabel);
|
||||
consoleScrollContainer.ScrollVertical = (int)consoleScrollContainer.GetVScrollBar().MaxValue;
|
||||
}
|
||||
|
||||
private void SetConsoleVisibility(DeployStep step, bool shouldOpen, bool closeOthers)
|
||||
{
|
||||
var consoleContainer = step switch
|
||||
{
|
||||
DeployStep.Building => _buildingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.PrepareUpload => _prepareUploadContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.Uploading => _uploadingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.CreateShortcut => _createShortcutContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
_ => null
|
||||
};
|
||||
if (consoleContainer == null) return;
|
||||
|
||||
// Open Container
|
||||
if (shouldOpen)
|
||||
{
|
||||
// Close all other open containers if not running anymore
|
||||
if (closeOthers)
|
||||
{
|
||||
var consoleContainers = new List<PanelContainer>
|
||||
{
|
||||
_buildingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
_prepareUploadContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
_uploadingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
_createShortcutContainer.GetNode<PanelContainer>("ConsoleContainer")
|
||||
};
|
||||
foreach (var container in consoleContainers)
|
||||
{
|
||||
container.Visible = false;
|
||||
container.GetParent<VBoxContainer>().SizeFlagsVertical = Control.SizeFlags.ShrinkBegin;
|
||||
}
|
||||
}
|
||||
|
||||
// Open container
|
||||
consoleContainer.Visible = true;
|
||||
consoleContainer.GetParent<VBoxContainer>().SizeFlagsVertical = Control.SizeFlags.ExpandFill;
|
||||
}
|
||||
else
|
||||
{
|
||||
consoleContainer.Visible = false;
|
||||
consoleContainer.GetParent<VBoxContainer>().SizeFlagsVertical = Control.SizeFlags.ShrinkBegin;
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleConsoleVisiblity(DeployStep step)
|
||||
{
|
||||
var consoleContainer = step switch
|
||||
{
|
||||
DeployStep.Building => _buildingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.PrepareUpload => _prepareUploadContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.Uploading => _uploadingContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
DeployStep.CreateShortcut => _createShortcutContainer.GetNode<PanelContainer>("ConsoleContainer"),
|
||||
_ => null
|
||||
};
|
||||
if (consoleContainer == null) return;
|
||||
|
||||
SetConsoleVisibility(step, !consoleContainer.Visible, CurrentStep == DeployStep.Done);
|
||||
}
|
||||
|
||||
private void UpdateUIToFail()
|
||||
{
|
||||
CurrentProgress = StepProgress.Failed;
|
||||
UpdateUI();
|
||||
CurrentStep = DeployStep.Done;
|
||||
CurrentProgress = StepProgress.Queued;
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void OnBuildingConsolePressed()
|
||||
{
|
||||
ToggleConsoleVisiblity(DeployStep.Building);
|
||||
}
|
||||
public void OnPrepareUploadConsolePressed()
|
||||
{
|
||||
ToggleConsoleVisiblity(DeployStep.PrepareUpload);
|
||||
}
|
||||
public void OnUploadingConsolePressed()
|
||||
{
|
||||
ToggleConsoleVisiblity(DeployStep.Uploading);
|
||||
}
|
||||
public void OnCreatingShortcutConsolePressed()
|
||||
{
|
||||
ToggleConsoleVisiblity(DeployStep.CreateShortcut);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dwen7451fh4y0
|
||||
287
addons/deploy_to_steamos/deploy_window/deploy_window.tscn
Normal file
287
addons/deploy_to_steamos/deploy_window/deploy_window.tscn
Normal file
@@ -0,0 +1,287 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://ds2umdqybfls8"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/deploy_to_steamos/deploy_window/DeployWindow.cs" id="1_01184"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4voio"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.0666667, 0.0666667, 0.0666667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_e8gqy"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lhk4y"]
|
||||
bg_color = Color(0.866667, 0.866667, 0.866667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_asgva"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.113725, 0.113725, 0.113725, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_7uvru"]
|
||||
content_margin_left = 5.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ojxav"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_e3114"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gqti7"]
|
||||
bg_color = Color(0.866667, 0.866667, 0.866667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ok20f"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.113725, 0.113725, 0.113725, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_aj0up"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_td6y3"]
|
||||
bg_color = Color(0.866667, 0.866667, 0.866667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_017mf"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.113725, 0.113725, 0.113725, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_encuu"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_esvxa"]
|
||||
bg_color = Color(0.866667, 0.866667, 0.866667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dgegm"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.113725, 0.113725, 0.113725, 1)
|
||||
|
||||
[node name="DeployWindow" type="Window" node_paths=PackedStringArray("_buildingContainer", "_prepareUploadContainer", "_uploadingContainer", "_createShortcutContainer")]
|
||||
title = "Deploying to steamdeck (deck@127.0.0.1)"
|
||||
initial_position = 1
|
||||
size = Vector2i(450, 600)
|
||||
transient = true
|
||||
min_size = Vector2i(450, 600)
|
||||
script = ExtResource("1_01184")
|
||||
_buildingContainer = NodePath("PanelContainer/VBoxContainer/BuildContainer")
|
||||
_prepareUploadContainer = NodePath("PanelContainer/VBoxContainer/PrepareUploadContainer")
|
||||
_uploadingContainer = NodePath("PanelContainer/VBoxContainer/UploadContainer")
|
||||
_createShortcutContainer = NodePath("PanelContainer/VBoxContainer/CreateShortcutContainer")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
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_styles/panel = SubResource("StyleBoxFlat_4voio")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="BuildContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Progressbar" type="ProgressBar" parent="PanelContainer/VBoxContainer/BuildContainer"]
|
||||
custom_minimum_size = Vector2(0, 2)
|
||||
layout_mode = 2
|
||||
theme_override_styles/background = SubResource("StyleBoxEmpty_e8gqy")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_lhk4y")
|
||||
show_percentage = false
|
||||
|
||||
[node name="HeaderContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/BuildContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_asgva")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/BuildContainer/HeaderContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/BuildContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.415686, 0.415686, 0.415686, 1)
|
||||
text = "Building Project"
|
||||
|
||||
[node name="ToggleConsoleButton" type="Button" parent="PanelContainer/VBoxContainer/BuildContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Output"
|
||||
|
||||
[node name="ConsoleContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/BuildContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_7uvru")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/BuildContainer/ConsoleContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ojxav")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/BuildContainer/ConsoleContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="PrepareUploadContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Progressbar" type="ProgressBar" parent="PanelContainer/VBoxContainer/PrepareUploadContainer"]
|
||||
custom_minimum_size = Vector2(0, 2)
|
||||
layout_mode = 2
|
||||
theme_override_styles/background = SubResource("StyleBoxEmpty_e3114")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_gqti7")
|
||||
show_percentage = false
|
||||
|
||||
[node name="HeaderContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/PrepareUploadContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_ok20f")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/PrepareUploadContainer/HeaderContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/PrepareUploadContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.415686, 0.415686, 0.415686, 1)
|
||||
text = "Preparing Upload"
|
||||
|
||||
[node name="ToggleConsoleButton" type="Button" parent="PanelContainer/VBoxContainer/PrepareUploadContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Output"
|
||||
|
||||
[node name="ConsoleContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/PrepareUploadContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_7uvru")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/PrepareUploadContainer/ConsoleContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ojxav")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/PrepareUploadContainer/ConsoleContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="UploadContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Progressbar" type="ProgressBar" parent="PanelContainer/VBoxContainer/UploadContainer"]
|
||||
custom_minimum_size = Vector2(0, 2)
|
||||
layout_mode = 2
|
||||
theme_override_styles/background = SubResource("StyleBoxEmpty_aj0up")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_td6y3")
|
||||
show_percentage = false
|
||||
|
||||
[node name="HeaderContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/UploadContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_017mf")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/UploadContainer/HeaderContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/UploadContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.415686, 0.415686, 0.415686, 1)
|
||||
text = "Uploading Project"
|
||||
|
||||
[node name="ToggleConsoleButton" type="Button" parent="PanelContainer/VBoxContainer/UploadContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Output"
|
||||
|
||||
[node name="ConsoleContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/UploadContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_7uvru")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/UploadContainer/ConsoleContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ojxav")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/UploadContainer/ConsoleContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="CreateShortcutContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="Progressbar" type="ProgressBar" parent="PanelContainer/VBoxContainer/CreateShortcutContainer"]
|
||||
custom_minimum_size = Vector2(0, 2)
|
||||
layout_mode = 2
|
||||
theme_override_styles/background = SubResource("StyleBoxEmpty_encuu")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_esvxa")
|
||||
show_percentage = false
|
||||
|
||||
[node name="HeaderContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/CreateShortcutContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_dgegm")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/CreateShortcutContainer/HeaderContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/CreateShortcutContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0.415686, 0.415686, 0.415686, 1)
|
||||
text = "Creating Shortcut"
|
||||
|
||||
[node name="ToggleConsoleButton" type="Button" parent="PanelContainer/VBoxContainer/CreateShortcutContainer/HeaderContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
disabled = true
|
||||
text = "Output"
|
||||
|
||||
[node name="ConsoleContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/CreateShortcutContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_7uvru")
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/CreateShortcutContainer/ConsoleContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_ojxav")
|
||||
horizontal_scroll_mode = 0
|
||||
vertical_scroll_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/CreateShortcutContainer/ConsoleContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[connection signal="close_requested" from="." to="." method="Close"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/BuildContainer/HeaderContainer/HBoxContainer/ToggleConsoleButton" to="." method="OnBuildingConsolePressed"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/PrepareUploadContainer/HeaderContainer/HBoxContainer/ToggleConsoleButton" to="." method="OnPrepareUploadConsolePressed"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/UploadContainer/HeaderContainer/HBoxContainer/ToggleConsoleButton" to="." method="OnUploadingConsolePressed"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/CreateShortcutContainer/HeaderContainer/HBoxContainer/ToggleConsoleButton" to="." method="OnCreatingShortcutConsolePressed"]
|
||||
1
addons/deploy_to_steamos/folder.svg
Normal file
1
addons/deploy_to_steamos/folder.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M2 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-4a1 1 0 0 1-1-1V3a1 1 0 0 0-1-1z" fill="#e0e0e0"/></svg>
|
||||
|
After Width: | Height: | Size: 219 B |
37
addons/deploy_to_steamos/folder.svg.import
Normal file
37
addons/deploy_to_steamos/folder.svg.import
Normal file
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://du661vtsmqc7h"
|
||||
path="res://.godot/imported/folder.svg-3209c1ff45131a205cbeb3923822ebc7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/deploy_to_steamos/folder.svg"
|
||||
dest_files=["res://.godot/imported/folder.svg-3209c1ff45131a205cbeb3923822ebc7.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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
13
addons/deploy_to_steamos/icon.svg
Normal file
13
addons/deploy_to_steamos/icon.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: #e0e0e0;
|
||||
stroke-width: 0px;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path class="cls-1" d="M12,2C6.9,2,2.3,6.1,2,11.2c1.3.6,6.8,2.8,6.8,2.8l2.2-4.4-3.4-1.7c-.9-.5.2-1.8.5-2.4,0-.2.4-.4.6-.4h4.2l7.1,3.7c.3.2.5.6.3.9-2.4,4.5-1.1,4-5.6,1.8l-3.5,6.8c-1.1,2.2-4.6.8-3.9-1.5l-5-2.1c2.8,10,17.3,9.5,19.4-.7,1.4-6.1-3.5-12-9.7-12Z"/>
|
||||
<rect class="cls-1" x="16.6" y="9.7" width="2.1" height="1.4" transform="translate(.3 21.3) rotate(-62.9)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 641 B |
37
addons/deploy_to_steamos/icon.svg.import
Normal file
37
addons/deploy_to_steamos/icon.svg.import
Normal file
@@ -0,0 +1,37 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://s1tcpal4iir4"
|
||||
path="res://.godot/imported/icon.svg-3fd3169593c3fd142e77475bb0bb8a61.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/deploy_to_steamos/icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-3fd3169593c3fd142e77475bb0bb8a61.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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
7
addons/deploy_to_steamos/plugin.cfg
Normal file
7
addons/deploy_to_steamos/plugin.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[plugin]
|
||||
|
||||
name="Deploy to SteamOS"
|
||||
description="A Godot plugin integrating a direct deployment workflow to SteamOS"
|
||||
author="Laura Sofia Heimann"
|
||||
version="1.1.0"
|
||||
script="Plugin.cs"
|
||||
101
addons/deploy_to_steamos/settings_panel/SettingsPanel.cs
Normal file
101
addons/deploy_to_steamos/settings_panel/SettingsPanel.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using Godot;
|
||||
|
||||
namespace Laura.DeployToSteamOS;
|
||||
|
||||
[Tool]
|
||||
public partial class SettingsPanel : PanelContainer
|
||||
{
|
||||
[ExportGroup("References")]
|
||||
[Export] private Label _versionLabel;
|
||||
[Export] private AddDeviceWindow _addDeviceWindow;
|
||||
[Export] private LineEdit _buildPathLineEdit;
|
||||
[Export] private FileDialog _buildPathFileDialog;
|
||||
[Export] private LineEdit _startParametersLineEdit;
|
||||
[Export] private OptionButton _uploadMethodOptionButton;
|
||||
[Export] private Label _uploadMethodDifferentialHintLabel;
|
||||
[Export] private Label _uploadMethodIncrementalHintLabel;
|
||||
[Export] private Label _uploadMethodCleanReplaceHintLabel;
|
||||
|
||||
private float _saveCooldown = 2f;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (SettingsManager.Instance.IsDirty && _saveCooldown < 0f)
|
||||
{
|
||||
_saveCooldown = 2f;
|
||||
SettingsManager.Instance.Save();
|
||||
}
|
||||
|
||||
if (SettingsManager.Instance.IsDirty && Visible)
|
||||
{
|
||||
_saveCooldown -= (float)delta;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnVisibilityChanged()
|
||||
{
|
||||
if (Visible)
|
||||
{
|
||||
ShowPanel();
|
||||
}
|
||||
else
|
||||
{
|
||||
HidePanel();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowPanel()
|
||||
{
|
||||
_buildPathLineEdit.Text = SettingsManager.Instance.Settings.BuildPath;
|
||||
_startParametersLineEdit.Text = SettingsManager.Instance.Settings.StartParameters;
|
||||
_uploadMethodOptionButton.Selected = (int)SettingsManager.Instance.Settings.UploadMethod;
|
||||
|
||||
_saveCooldown = 2f;
|
||||
}
|
||||
|
||||
private void HidePanel()
|
||||
{
|
||||
}
|
||||
|
||||
public void BuildPathTextChanged(string newBuildPath)
|
||||
{
|
||||
SettingsManager.Instance.Settings.BuildPath = newBuildPath;
|
||||
_buildPathLineEdit.Text = newBuildPath;
|
||||
|
||||
_saveCooldown = 2f;
|
||||
SettingsManager.Instance.IsDirty = true;
|
||||
}
|
||||
|
||||
public void BuildPathOpenFileDialog()
|
||||
{
|
||||
_buildPathFileDialog.Show();
|
||||
}
|
||||
|
||||
public void StartParametersTextChanged(string newStartParameters)
|
||||
{
|
||||
SettingsManager.Instance.Settings.StartParameters = newStartParameters;
|
||||
_startParametersLineEdit.Text = newStartParameters;
|
||||
|
||||
_saveCooldown = 2f;
|
||||
SettingsManager.Instance.IsDirty = true;
|
||||
}
|
||||
|
||||
public void UploadMethodItemSelected(int newItemIndex)
|
||||
{
|
||||
var newUploadMethod = (SettingsFile.UploadMethods)newItemIndex;
|
||||
SettingsManager.Instance.Settings.UploadMethod = newUploadMethod;
|
||||
_uploadMethodOptionButton.Selected = newItemIndex;
|
||||
|
||||
_saveCooldown = 2f;
|
||||
SettingsManager.Instance.IsDirty = true;
|
||||
|
||||
_uploadMethodDifferentialHintLabel.Visible = newUploadMethod == SettingsFile.UploadMethods.Differential;
|
||||
_uploadMethodIncrementalHintLabel.Visible = newUploadMethod == SettingsFile.UploadMethods.Incremental;
|
||||
_uploadMethodCleanReplaceHintLabel.Visible = newUploadMethod == SettingsFile.UploadMethods.CleanReplace;
|
||||
}
|
||||
|
||||
public void PairDevices()
|
||||
{
|
||||
_addDeviceWindow.Show();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://dkuod3bjmlgy3
|
||||
259
addons/deploy_to_steamos/settings_panel/settings_panel.tscn
Normal file
259
addons/deploy_to_steamos/settings_panel/settings_panel.tscn
Normal file
@@ -0,0 +1,259 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://c8k27e2fcl21j"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/deploy_to_steamos/settings_panel/SettingsPanel.cs" id="1_sde4n"]
|
||||
[ext_resource type="Texture2D" uid="uid://s1tcpal4iir4" path="res://addons/deploy_to_steamos/icon.svg" id="2_uruwd"]
|
||||
[ext_resource type="Texture2D" uid="uid://du661vtsmqc7h" path="res://addons/deploy_to_steamos/folder.svg" id="3_w3m1c"]
|
||||
[ext_resource type="PackedScene" uid="uid://6be5afncp3nr" path="res://addons/deploy_to_steamos/add_device_window/add_device_window.tscn" id="4_yoa1a"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_txpoc"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
bg_color = Color(0.0666667, 0.0666667, 0.0666667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_t6jug"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_twxhr"]
|
||||
texture = ExtResource("2_uruwd")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_jrblc"]
|
||||
content_margin_left = 15.0
|
||||
content_margin_top = 15.0
|
||||
content_margin_right = 15.0
|
||||
content_margin_bottom = 15.0
|
||||
bg_color = Color(0.133333, 0.133333, 0.133333, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_so52p"]
|
||||
content_margin_left = 5.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_right = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_r6ghl"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2gufl"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(0.2, 0.2, 0.2, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[node name="Deploy to SteamOS" type="PanelContainer" node_paths=PackedStringArray("_versionLabel", "_addDeviceWindow", "_buildPathLineEdit", "_buildPathFileDialog", "_startParametersLineEdit", "_uploadMethodOptionButton", "_uploadMethodDifferentialHintLabel", "_uploadMethodIncrementalHintLabel", "_uploadMethodCleanReplaceHintLabel")]
|
||||
offset_right = 600.0
|
||||
offset_bottom = 500.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_txpoc")
|
||||
script = ExtResource("1_sde4n")
|
||||
_versionLabel = NodePath("VBoxContainer/LogoContainer/VBoxContainer/VersionLabel")
|
||||
_addDeviceWindow = NodePath("AddDeviceWindow")
|
||||
_buildPathLineEdit = NodePath("VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer/HBoxContainer/BuildPathInput")
|
||||
_buildPathFileDialog = NodePath("BuildPathFileDialog")
|
||||
_startParametersLineEdit = NodePath("VBoxContainer/ScrollContainer/SettingsContainer/StartParametersContainer/HBoxContainer/StartParametersInput")
|
||||
_uploadMethodOptionButton = NodePath("VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/HBoxContainer/PanelContainer/UploadMethodOptionButton")
|
||||
_uploadMethodDifferentialHintLabel = NodePath("VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/UploadMethodHintContainer/DifferentialHintLabel")
|
||||
_uploadMethodIncrementalHintLabel = NodePath("VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/UploadMethodHintContainer/IncrementalHintLabel")
|
||||
_uploadMethodCleanReplaceHintLabel = NodePath("VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/UploadMethodHintContainer/CleanReplaceHintLabel")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="LogoContainer" type="PanelContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_t6jug")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/LogoContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="LogoContainer" type="HBoxContainer" parent="VBoxContainer/LogoContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
alignment = 1
|
||||
|
||||
[node name="Icon" type="Panel" parent="VBoxContainer/LogoContainer/VBoxContainer/LogoContainer"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxTexture_twxhr")
|
||||
|
||||
[node name="DevkitPathLabel" type="Label" parent="VBoxContainer/LogoContainer/VBoxContainer/LogoContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Deploy to SteamOS"
|
||||
|
||||
[node name="VersionLabel" type="Label" parent="VBoxContainer/LogoContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 0.490196)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "Version 1.1.0"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_jrblc")
|
||||
|
||||
[node name="SettingsContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="BuildPathContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_so52p")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="BuildPathLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Build Path"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="BuildPathInput" type="LineEdit" parent="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "C:/Users/hello/Development/Godot4-DeployToSteamOS-Builds"
|
||||
|
||||
[node name="BrowseButton" type="Button" parent="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/icon_max_width = 20
|
||||
icon = ExtResource("3_w3m1c")
|
||||
|
||||
[node name="StartParametersContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_so52p")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/StartParametersContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="StartParametersLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/StartParametersContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Start Parameters"
|
||||
|
||||
[node name="StartParametersInput" type="LineEdit" parent="VBoxContainer/ScrollContainer/SettingsContainer/StartParametersContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="UploadMethodContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_so52p")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="UploadMethodLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Upload Method"
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_r6ghl")
|
||||
|
||||
[node name="UploadMethodOptionButton" type="OptionButton" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/HBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
item_count = 3
|
||||
selected = 0
|
||||
popup/item_0/text = "Differential"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Incremental"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "CleanReplace"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="UploadMethodHintContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_2gufl")
|
||||
|
||||
[node name="DifferentialHintLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/UploadMethodHintContainer"]
|
||||
custom_minimum_size = Vector2(0, 15)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 0.588235)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "Only changed and new files of the build will be uploaded."
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="IncrementalHintLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/UploadMethodHintContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(0, 15)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 0.588235)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "A new build will be uploaded with the current timestamp. Existing builds will not be changed."
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="CleanReplaceHintLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/UploadMethodHintContainer"]
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(0, 15)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 0.588235)
|
||||
theme_override_font_sizes/font_size = 12
|
||||
text = "Before the new build will be uploaded, the old one will be fully removed."
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="DevicesContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_so52p")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/DevicesContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="DevicesLabel" type="Label" parent="VBoxContainer/ScrollContainer/SettingsContainer/DevicesContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Devices"
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/ScrollContainer/SettingsContainer/DevicesContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_r6ghl")
|
||||
|
||||
[node name="PairDevicesButton" type="Button" parent="VBoxContainer/ScrollContainer/SettingsContainer/DevicesContainer/HBoxContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "Pair Devices"
|
||||
|
||||
[node name="BuildPathFileDialog" type="FileDialog" parent="."]
|
||||
title = "Open a Directory"
|
||||
initial_position = 2
|
||||
size = Vector2i(700, 400)
|
||||
ok_button_text = "Select Current Folder"
|
||||
file_mode = 2
|
||||
access = 2
|
||||
|
||||
[node name="AddDeviceWindow" parent="." instance=ExtResource("4_yoa1a")]
|
||||
visible = false
|
||||
|
||||
[connection signal="visibility_changed" from="." to="." method="OnVisibilityChanged"]
|
||||
[connection signal="text_changed" from="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer/HBoxContainer/BuildPathInput" to="." method="BuildPathTextChanged"]
|
||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/SettingsContainer/BuildPathContainer/HBoxContainer/HBoxContainer/BrowseButton" to="." method="BuildPathOpenFileDialog"]
|
||||
[connection signal="text_changed" from="VBoxContainer/ScrollContainer/SettingsContainer/StartParametersContainer/HBoxContainer/StartParametersInput" to="." method="StartParametersTextChanged"]
|
||||
[connection signal="item_selected" from="VBoxContainer/ScrollContainer/SettingsContainer/UploadMethodContainer/VBoxContainer/HBoxContainer/PanelContainer/UploadMethodOptionButton" to="." method="UploadMethodItemSelected"]
|
||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/SettingsContainer/DevicesContainer/HBoxContainer/PanelContainer/PairDevicesButton" to="." method="PairDevices"]
|
||||
[connection signal="dir_selected" from="BuildPathFileDialog" to="." method="BuildPathTextChanged"]
|
||||
@@ -7,12 +7,14 @@ advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="exclude"
|
||||
export_files=PackedStringArray("res://addons/deploy_to_steamos/add_device_window/AddDeviceWindow.cs", "res://addons/deploy_to_steamos/add_device_window/add_device_window.tscn", "res://addons/deploy_to_steamos/add_device_window/DeviceItemPrefab.cs", "res://addons/deploy_to_steamos/add_device_window/device_item_prefab.tscn", "res://addons/deploy_to_steamos/deploy_dock/DeployDock.cs", "res://addons/deploy_to_steamos/deploy_dock/deploy_dock.tscn", "res://addons/deploy_to_steamos/deploy_window/DeployWindow.Build.cs", "res://addons/deploy_to_steamos/deploy_window/DeployWindow.CreateShortcut.cs", "res://addons/deploy_to_steamos/deploy_window/DeployWindow.cs", "res://addons/deploy_to_steamos/deploy_window/DeployWindow.Init.cs", "res://addons/deploy_to_steamos/deploy_window/DeployWindow.PrepareUpload.cs", "res://addons/deploy_to_steamos/deploy_window/DeployWindow.Upload.cs", "res://addons/deploy_to_steamos/deploy_window/deploy_window.tscn", "res://addons/deploy_to_steamos/settings_panel/SettingsPanel.cs", "res://addons/deploy_to_steamos/settings_panel/settings_panel.tscn", "res://addons/deploy_to_steamos/folder.svg", "res://addons/deploy_to_steamos/GodotExportManager.cs", "res://addons/deploy_to_steamos/icon.svg", "res://addons/deploy_to_steamos/Plugin.cs", "res://addons/deploy_to_steamos/SettingsFile.cs", "res://addons/deploy_to_steamos/SettingsManager.cs", "res://addons/deploy_to_steamos/SteamOSDevkitManager.cs")
|
||||
export_files=PackedStringArray()
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=""
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
@@ -19,6 +19,7 @@ boot_splash/show_image=false
|
||||
|
||||
DialogueManager="*res://addons/dialogue_manager/dialogue_manager.gd"
|
||||
DialogueController="*res://src/game/DialogueController.cs"
|
||||
SettingsManager="*res://addons/deploy_to_steamos/SettingsManager.cs"
|
||||
|
||||
[dialogue_manager]
|
||||
|
||||
@@ -37,7 +38,7 @@ project/assembly_name="GameJamDungeon"
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/SimpleDungeons/plugin.cfg", "res://addons/dialogue_manager/plugin.cfg")
|
||||
enabled=PackedStringArray("res://addons/SimpleDungeons/plugin.cfg", "res://addons/deploy_to_steamos/plugin.cfg", "res://addons/dialogue_manager/plugin.cfg")
|
||||
|
||||
[file_customization]
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@startuml AppLogic
|
||||
state "AppLogic State" as GameJamDungeon_AppLogic_State {
|
||||
state "SetupGameScene" as GameJamDungeon_AppLogic_State_SetupGameScene
|
||||
state "InGame" as GameJamDungeon_AppLogic_State_InGame
|
||||
state "LoadingScreen" as GameJamDungeon_AppLogic_State_LoadingScreen
|
||||
state "MainMenu" as GameJamDungeon_AppLogic_State_MainMenu
|
||||
state "LoadingScreen" as GameJamDungeon_AppLogic_State_LoadingScreen
|
||||
state "InGame" as GameJamDungeon_AppLogic_State_InGame
|
||||
}
|
||||
|
||||
GameJamDungeon_AppLogic_State_InGame --> GameJamDungeon_AppLogic_State_MainMenu : GameOver
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
|
||||
namespace GameJamDungeon;
|
||||
|
||||
public interface IEnemy : IRigidBody3D
|
||||
{
|
||||
public IEnemyLogic EnemyLogic { get; }
|
||||
|
||||
public AutoProp<double> CurrentHP { get; set; }
|
||||
|
||||
public EnemyStatResource EnemyStatResource { get; set; }
|
||||
|
||||
public NavigationAgent3D NavAgent { get; set; }
|
||||
|
||||
public Area3D LineOfSight { get; set; }
|
||||
|
||||
public Timer AttackTimer { get; set; }
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Enemy : RigidBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
{
|
||||
|
||||
20
src/enemy/IEnemy.cs
Normal file
20
src/enemy/IEnemy.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Godot;
|
||||
|
||||
namespace GameJamDungeon;
|
||||
|
||||
public interface IEnemy : IRigidBody3D
|
||||
{
|
||||
public IEnemyLogic EnemyLogic { get; }
|
||||
|
||||
public AutoProp<double> CurrentHP { get; set; }
|
||||
|
||||
public EnemyStatResource EnemyStatResource { get; set; }
|
||||
|
||||
public NavigationAgent3D NavAgent { get; set; }
|
||||
|
||||
public Area3D LineOfSight { get; set; }
|
||||
|
||||
public Timer AttackTimer { get; set; }
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://b0gwivt7cw7nd"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_a6wro"]
|
||||
[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_x4pjh"]
|
||||
[ext_resource type="Script" uid="uid://2d34jler3rmv" path="res://src/enemy/Enemy.cs" id="1_a6wro"]
|
||||
[ext_resource type="Script" uid="uid://dnkmr0eq1sij0" path="res://src/enemy/EnemyStatResource.cs" id="2_x4pjh"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjg8wyvp8q6oc" path="res://src/enemy/enemy_types/michael/MichaelModelView.tscn" id="3_wrps7"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_k2g1o"]
|
||||
@@ -76,7 +76,6 @@ shape = SubResource("CapsuleShape3D_0h5s2")
|
||||
[node name="NavAgent" type="NavigationAgent3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
avoidance_enabled = true
|
||||
debug_enabled = true
|
||||
debug_path_custom_color = Color(1, 0, 0, 1)
|
||||
|
||||
[node name="EnemyModelView" parent="." instance=ExtResource("3_wrps7")]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bksq62muhk3h5"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_7tinp"]
|
||||
[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_j3knd"]
|
||||
[ext_resource type="Script" uid="uid://2d34jler3rmv" path="res://src/enemy/Enemy.cs" id="1_7tinp"]
|
||||
[ext_resource type="Script" uid="uid://dnkmr0eq1sij0" path="res://src/enemy/EnemyStatResource.cs" id="2_j3knd"]
|
||||
[ext_resource type="PackedScene" uid="uid://bli0t0d6ommvi" path="res://src/enemy/enemy_types/sproingy/SproingyModelView.tscn" id="4_o3b7p"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_rxw8v"]
|
||||
@@ -56,7 +56,6 @@ path_max_distance = 3.01
|
||||
simplify_path = true
|
||||
avoidance_enabled = true
|
||||
radius = 2.0
|
||||
debug_enabled = true
|
||||
debug_path_custom_color = Color(1, 0, 0, 1)
|
||||
|
||||
[node name="LineOfSight" type="Area3D" parent="."]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
@startuml EnemyLogic
|
||||
state "EnemyLogic State" as GameJamDungeon_EnemyLogic_State {
|
||||
state "Defeated" as GameJamDungeon_EnemyLogic_State_Defeated
|
||||
state "Alive" as GameJamDungeon_EnemyLogic_State_Alive {
|
||||
state "FollowPlayer" as GameJamDungeon_EnemyLogic_State_FollowPlayer
|
||||
state "Idle" as GameJamDungeon_EnemyLogic_State_Idle
|
||||
}
|
||||
state "Defeated" as GameJamDungeon_EnemyLogic_State_Defeated
|
||||
}
|
||||
|
||||
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Alive : AttackTimer
|
||||
|
||||
@@ -2,34 +2,11 @@
|
||||
namespace GameJamDungeon;
|
||||
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.SaveFileBuilder;
|
||||
using GameJamDungeon.src.item_rescue;
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvide<IGame>, INode3D
|
||||
{
|
||||
event Game.StatRaisedAlertEventHandler StatRaisedAlert;
|
||||
|
||||
public IPlayer Player { get; }
|
||||
|
||||
public RescuedItemDatabase RescuedItems { get; }
|
||||
|
||||
public void DropItem(IInventoryItem item);
|
||||
|
||||
public void ThrowItem(IInventoryItem item);
|
||||
|
||||
public void HealHP(int amountToRaise);
|
||||
public void RaiseHP(int amountToRaise);
|
||||
|
||||
public void HealVT(int amountToRaise);
|
||||
public void RaiseVT(int amountToRaise);
|
||||
|
||||
public void DoubleEXP(TimeSpan lengthOfEffect);
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Game : Node3D, IGame
|
||||
{
|
||||
@@ -151,12 +128,20 @@ public partial class Game : Node3D, IGame
|
||||
Player.MinimapButtonHeld += Player_MinimapButtonHeld;
|
||||
Player.PauseButtonPressed += Player_PauseButtonPressed;
|
||||
|
||||
GameRepo.PlayerData.CurrentHP.Sync += CurrentHP_Sync;
|
||||
|
||||
GameEventDepot.EnemyDefeated += OnEnemyDefeated;
|
||||
GameEventDepot.RestorativePickedUp += GameEventDepot_RestorativePickedUp;
|
||||
|
||||
DoubleEXPTimer.Timeout += DoubleEXPTimer_Timeout;
|
||||
}
|
||||
|
||||
private void CurrentHP_Sync(int currentHP)
|
||||
{
|
||||
if (currentHP <= 0)
|
||||
GameLogic.Input(new GameLogic.Input.GameOver());
|
||||
}
|
||||
|
||||
private void Inventory_PickedUpItem(string pickedUpItemName)
|
||||
{
|
||||
InGameUI.PlayerInfoUI.DisplayMessage($"{pickedUpItemName} picked up.");
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
@startuml GameLogic
|
||||
state "GameLogic State" as GameJamDungeon_GameLogic_State {
|
||||
state "GameStarted" as GameJamDungeon_GameLogic_State_GameStarted
|
||||
state "Quit" as GameJamDungeon_GameLogic_State_Quit
|
||||
state "Playing" as GameJamDungeon_GameLogic_State_Playing {
|
||||
state "AskForTeleport" as GameJamDungeon_GameLogic_State_AskForTeleport
|
||||
state "FloorClearedDecisionState" as GameJamDungeon_GameLogic_State_FloorClearedDecisionState
|
||||
state "InventoryOpened" as GameJamDungeon_GameLogic_State_InventoryOpened
|
||||
state "MinimapOpen" as GameJamDungeon_GameLogic_State_MinimapOpen
|
||||
state "Paused" as GameJamDungeon_GameLogic_State_Paused
|
||||
state "FloorClearedDecisionState" as GameJamDungeon_GameLogic_State_FloorClearedDecisionState
|
||||
state "AskForTeleport" as GameJamDungeon_GameLogic_State_AskForTeleport
|
||||
state "InventoryOpened" as GameJamDungeon_GameLogic_State_InventoryOpened
|
||||
state "Resuming" as GameJamDungeon_GameLogic_State_Resuming
|
||||
}
|
||||
state "Quit" as GameJamDungeon_GameLogic_State_Quit
|
||||
state "GameStarted" as GameJamDungeon_GameLogic_State_GameStarted
|
||||
}
|
||||
|
||||
GameJamDungeon_GameLogic_State_AskForTeleport --> GameJamDungeon_GameLogic_State_FloorClearedDecisionState : FloorExitReached
|
||||
|
||||
28
src/game/IGame.cs
Normal file
28
src/game/IGame.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
namespace GameJamDungeon;
|
||||
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using GameJamDungeon.src.item_rescue;
|
||||
using System;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvide<IGame>, INode3D
|
||||
{
|
||||
event Game.StatRaisedAlertEventHandler StatRaisedAlert;
|
||||
|
||||
public IPlayer Player { get; }
|
||||
|
||||
public RescuedItemDatabase RescuedItems { get; }
|
||||
|
||||
public void DropItem(IInventoryItem item);
|
||||
|
||||
public void ThrowItem(IInventoryItem item);
|
||||
|
||||
public void HealHP(int amountToRaise);
|
||||
public void RaiseHP(int amountToRaise);
|
||||
|
||||
public void HealVT(int amountToRaise);
|
||||
public void RaiseVT(int amountToRaise);
|
||||
|
||||
public void DoubleEXP(TimeSpan lengthOfEffect);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://twrj4wixcbu7"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/ItemDatabase.cs" id="1_7b315"]
|
||||
[ext_resource type="Script" uid="uid://vdunjh1f4jry" path="res://src/items/ItemDatabase.cs" id="1_7b315"]
|
||||
[ext_resource type="PackedScene" uid="uid://db206brufi83s" path="res://src/items/weapons/Weapon.tscn" id="2_wq002"]
|
||||
[ext_resource type="PackedScene" uid="uid://dorr7v1tkeiy0" path="res://src/items/armor/Armor.tscn" id="3_8wlg5"]
|
||||
[ext_resource type="PackedScene" uid="uid://b07srt3lckt4e" path="res://src/items/accessory/Accessory.tscn" id="4_pr7ub"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dofju2wfj12y4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dy6iul5xgcj47" path="res://src/items/restorative/textures/divinity recall 2.PNG" id="1_1rwq6"]
|
||||
[ext_resource type="Script" path="res://src/items/restorative/Restorative.cs" id="1_3beyl"]
|
||||
[ext_resource type="Script" uid="uid://qjvotbwutcb5" path="res://src/items/restorative/Restorative.cs" id="1_3beyl"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_o8f22"]
|
||||
radius = 0.13613
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://1fl6s352e2ej"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://1fl6s352e2ej"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dj28ol2cpeiwm" path="res://src/items/throwable/ThrowableItem.cs" id="1_nac2l"]
|
||||
[ext_resource type="Script" uid="uid://d3wlunkcuv2w2" path="res://src/items/throwable/ThrowableItemStats.cs" id="2_8h2lx"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_b0s4k"]
|
||||
script = ExtResource("2_8h2lx")
|
||||
ThrowableItemTags = Array[int]([])
|
||||
UsableItemTags = Array[int]([])
|
||||
Name = ""
|
||||
Description = ""
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
metadata/_custom_type_script = ExtResource("2_8h2lx")
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_03cqg"]
|
||||
size = Vector3(0.778381, 0.929947, 0.731567)
|
||||
@@ -8,6 +22,7 @@ size = Vector3(0.778381, 0.929947, 0.731567)
|
||||
[node name="ThrowableItem" type="Node3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.75, 0)
|
||||
script = ExtResource("1_nac2l")
|
||||
ThrowableItemInfo = SubResource("Resource_b0s4k")
|
||||
|
||||
[node name="Pickup" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://b1twcuneob5kt"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/thrown/ThrownItem.cs" id="1_wlplc"]
|
||||
[ext_resource type="Script" uid="uid://bx1k4yff3m82m" path="res://src/items/thrown/ThrownItem.cs" id="1_wlplc"]
|
||||
[ext_resource type="Texture2D" uid="uid://mi70lolgtf3n" path="res://src/items/throwable/textures/GEOMANCER-DICE.png" id="2_alcjn"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_s4ym5"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://db206brufi83s"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_7pkyf"]
|
||||
[ext_resource type="Script" uid="uid://bq8aaf1ae4afh" path="res://src/items/weapons/Weapon.cs" id="1_7pkyf"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wll7p"]
|
||||
radius = 0.470016
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=89 format=4 uid="uid://vdhl32je6hq2"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_j1kxr"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_6qgti"]
|
||||
[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_j1kxr"]
|
||||
[ext_resource type="Script" uid="uid://daetb3e2nm56p" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_6qgti"]
|
||||
[ext_resource type="Texture2D" uid="uid://dytao2mlwn70b" path="res://src/map/dungeon/models/antechamber_2/ANTECHAMBER_TYPE2_VER3_STONE_PANEL_2png.png" id="3_po4ye"]
|
||||
[ext_resource type="Texture2D" uid="uid://donkyolj48lnx" path="res://src/map/dungeon/models/antechamber_2/ANTECHAMBER_TYPE2_VER3_SA003.jpg" id="4_u2s1f"]
|
||||
[ext_resource type="Texture2D" uid="uid://dq85on808gpsv" path="res://src/map/dungeon/models/antechamber_2/ANTECHAMBER_TYPE2_VER3_PIPE.jpg" id="5_5jr8j"]
|
||||
@@ -24,8 +24,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://bkvegamuqdsdd" path="res://src/map/dungeon/corridor/CORRIDOR test_FLOOR1.jpg" id="22_3r6v3"]
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="23_rhlsp"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="24_168rc"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="25_8521a"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/MinimapManager.cs" id="26_tvm82"]
|
||||
[ext_resource type="Script" uid="uid://yl7wyeo5m725" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="25_8521a"]
|
||||
[ext_resource type="Script" uid="uid://c6s8hvdj3u3aq" path="res://src/map/dungeon/code/MinimapManager.cs" id="26_tvm82"]
|
||||
[ext_resource type="Material" uid="uid://bsafm3t4drpl" path="res://src/map/dungeon/textures/MinimapTexture.tres" id="27_mgor6"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3iqv8"]
|
||||
@@ -1756,7 +1756,7 @@ flip_faces = true
|
||||
size = Vector3(16, 8, 16)
|
||||
|
||||
[node name="CSGBox2" type="CSGBox3D" parent="Antechamber2"]
|
||||
transform = Transform3D(1.91069e-15, 4.37114e-08, 1, 1, -4.37114e-08, 0, 4.37114e-08, 1, -4.37114e-08, 8.06523, 0.0211899, 1.9332)
|
||||
transform = Transform3D(1.91069e-15, 4.37114e-08, 1, 1, -4.37114e-08, 0, 4.37114e-08, 1, -4.37114e-08, 8.04886, 0.0211899, 1.9332)
|
||||
use_collision = true
|
||||
size = Vector3(4, 4, 0.5)
|
||||
material = SubResource("StandardMaterial3D_3mejj")
|
||||
@@ -1769,13 +1769,13 @@ size = Vector3(5.55383, 4, 2)
|
||||
material = SubResource("StandardMaterial3D_a7x8v")
|
||||
|
||||
[node name="CSGBox" type="CSGBox3D" parent="Antechamber2"]
|
||||
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, -1.89702, 0.21733, -8.00157)
|
||||
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, -1.89702, 0.0119586, -8.00157)
|
||||
use_collision = true
|
||||
size = Vector3(4, 4, 0.5)
|
||||
material = SubResource("StandardMaterial3D_3mejj")
|
||||
|
||||
[node name="DOOR?1" type="CSGBox3D" parent="Antechamber2/CSGBox"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.19209e-07, 0.0442526, 0.0686455)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0487772, 0.0442526, 0.0686455)
|
||||
material_override = SubResource("StandardMaterial3D_2xt56")
|
||||
operation = 2
|
||||
size = Vector3(4, 4, 2)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=85 format=4 uid="uid://b7111krf365x0"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_jccmw"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_5p5p8"]
|
||||
[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_jccmw"]
|
||||
[ext_resource type="Script" uid="uid://daetb3e2nm56p" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_5p5p8"]
|
||||
[ext_resource type="Texture2D" uid="uid://bb7y5jjl32b11" path="res://src/map/dungeon/models/inner_balcony/INNER_BALCONY_ROOM_VER2_STONE_PANEL_2png.png" id="2_40w7a"]
|
||||
[ext_resource type="Texture2D" uid="uid://1bmgm045nm7e" path="res://src/map/dungeon/models/inner_balcony/INNER_BALCONY_ROOM_VER2_COLUMN.jpg" id="3_87bce"]
|
||||
[ext_resource type="Texture2D" uid="uid://dgceb3iovrvsf" path="res://src/map/dungeon/models/inner_balcony/INNER_BALCONY_ROOM_VER2_WALL TILE 1.jpg" id="4_j2bdg"]
|
||||
@@ -17,9 +17,9 @@
|
||||
[ext_resource type="Texture2D" uid="uid://bkvegamuqdsdd" path="res://src/map/dungeon/corridor/CORRIDOR test_FLOOR1.jpg" id="14_vh3wx"]
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="15_n8s21"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="16_mk0iw"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="17_atu1n"]
|
||||
[ext_resource type="Script" uid="uid://yl7wyeo5m725" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="17_atu1n"]
|
||||
[ext_resource type="Material" uid="uid://bsafm3t4drpl" path="res://src/map/dungeon/textures/MinimapTexture.tres" id="19_dmkqn"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/MinimapManager.cs" id="19_gi8bh"]
|
||||
[ext_resource type="Script" uid="uid://c6s8hvdj3u3aq" path="res://src/map/dungeon/code/MinimapManager.cs" id="19_gi8bh"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ta5ix"]
|
||||
resource_name = "Material.003"
|
||||
@@ -861,11 +861,11 @@ data = PackedVector3Array(0.983567, -1, 0, 0.695487, -1, 0.695487, 0.695487, 1,
|
||||
albedo_texture = ExtResource("13_66rjw")
|
||||
texture_filter = 0
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ce8rm"]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xw1ea"]
|
||||
albedo_color = Color(1, 1, 1, 0)
|
||||
albedo_texture = ExtResource("14_vh3wx")
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xw1ea"]
|
||||
albedo_texture = ExtResource("14_vh3wx")
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ce8rm"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_suh2k"]
|
||||
size = Vector3(36, 8, 36)
|
||||
@@ -882,6 +882,7 @@ min_count = 1
|
||||
max_count = 1
|
||||
|
||||
[node name="InnerBalcony" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.041173)
|
||||
script = ExtResource("2_5p5p8")
|
||||
|
||||
[node name="INNER_BALCONY_ROOM_VER2" type="Node3D" parent="InnerBalcony"]
|
||||
@@ -1139,7 +1140,6 @@ material = SubResource("StandardMaterial3D_fgovc")
|
||||
|
||||
[node name="DOOR?" type="CSGBox3D" parent="InnerBalcony/CSGBox2"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00166607, -3.72529e-08, 0.0686455)
|
||||
material_override = SubResource("StandardMaterial3D_ce8rm")
|
||||
operation = 2
|
||||
size = Vector3(4, 4, 2)
|
||||
material = SubResource("StandardMaterial3D_xw1ea")
|
||||
@@ -1152,7 +1152,6 @@ material = SubResource("StandardMaterial3D_fgovc")
|
||||
|
||||
[node name="DOOR?" type="CSGBox3D" parent="InnerBalcony/CSGBox3"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00166607, -3.72529e-08, 0.0686455)
|
||||
material_override = SubResource("StandardMaterial3D_ce8rm")
|
||||
operation = 2
|
||||
size = Vector3(4, 4, 2)
|
||||
material = SubResource("StandardMaterial3D_xw1ea")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=87 format=4 uid="uid://cam640h4euewx"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_hww7y"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_abm0b"]
|
||||
[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_hww7y"]
|
||||
[ext_resource type="Script" uid="uid://daetb3e2nm56p" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_abm0b"]
|
||||
[ext_resource type="Texture2D" uid="uid://yv16a32nmuwg" path="res://src/map/dungeon/models/pit_room/PIT_ROOM_VER2_tile2.png" id="2_hnabh"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctmn1oyu2llal" path="res://src/map/dungeon/models/pit_room/PIT_ROOM_VER2_CEILING_1.jpg" id="3_dl8qf"]
|
||||
[ext_resource type="Texture2D" uid="uid://bworoo3u2hlob" path="res://src/map/dungeon/models/pit_room/PIT_ROOM_VER2_STONE_PANEL_2png.png" id="4_76lx1"]
|
||||
@@ -20,8 +20,8 @@
|
||||
[ext_resource type="Texture2D" uid="uid://bkvegamuqdsdd" path="res://src/map/dungeon/corridor/CORRIDOR test_FLOOR1.jpg" id="17_4r724"]
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="19_yh0qc"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="20_5xp0x"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="21_5mo1p"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/MinimapManager.cs" id="22_h4dhe"]
|
||||
[ext_resource type="Script" uid="uid://yl7wyeo5m725" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="21_5mo1p"]
|
||||
[ext_resource type="Script" uid="uid://c6s8hvdj3u3aq" path="res://src/map/dungeon/code/MinimapManager.cs" id="22_h4dhe"]
|
||||
[ext_resource type="Material" uid="uid://bsafm3t4drpl" path="res://src/map/dungeon/textures/MinimapTexture.tres" id="23_2yaqs"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mbeyw"]
|
||||
@@ -1117,6 +1117,7 @@ min_count = 1
|
||||
max_count = 2
|
||||
|
||||
[node name="PitRoom" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.0629635)
|
||||
script = ExtResource("2_abm0b")
|
||||
|
||||
[node name="PIT_ROOM_VER2" type="Node3D" parent="PitRoom"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=85 format=4 uid="uid://i781lbf2wb22"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_owolg"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_557rl"]
|
||||
[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_owolg"]
|
||||
[ext_resource type="Script" uid="uid://daetb3e2nm56p" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_557rl"]
|
||||
[ext_resource type="Texture2D" uid="uid://b3sg8oamch2i1" path="res://src/map/dungeon/models/tree_room/TREE_ROOM_VER2_STONE_PANEL_2png.png" id="2_q760f"]
|
||||
[ext_resource type="Texture2D" uid="uid://dosfvqc483qru" path="res://src/map/dungeon/models/tree_room/TREE_ROOM_VER2_COLUMN.jpg" id="3_f73tr"]
|
||||
[ext_resource type="Texture2D" uid="uid://shedoef7js3k" path="res://src/map/dungeon/models/tree_room/TREE_ROOM_VER2_COLUM2N.png" id="4_qwvcf"]
|
||||
@@ -20,11 +20,11 @@
|
||||
[ext_resource type="Texture2D" uid="uid://cjjdttsu7sily" path="res://src/map/dungeon/models/tree_room/TREE_ROOM_VER2_starsigns.png" id="17_xt3ee"]
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="19_rlr0c"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="20_blcsb"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="21_s12yd"]
|
||||
[ext_resource type="Script" uid="uid://yl7wyeo5m725" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="21_s12yd"]
|
||||
[ext_resource type="Material" uid="uid://bsafm3t4drpl" path="res://src/map/dungeon/textures/MinimapTexture.tres" id="22_3xjct"]
|
||||
[ext_resource type="Texture2D" uid="uid://del2dfj3etokd" path="res://src/map/dungeon/textures/BLOCKED-DOOR_REGULAR.png" id="23_sd6x0"]
|
||||
[ext_resource type="Texture2D" uid="uid://bkvegamuqdsdd" path="res://src/map/dungeon/corridor/CORRIDOR test_FLOOR1.jpg" id="24_nv6nc"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/MinimapManager.cs" id="24_s8wpb"]
|
||||
[ext_resource type="Script" uid="uid://c6s8hvdj3u3aq" path="res://src/map/dungeon/code/MinimapManager.cs" id="24_s8wpb"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_h5y3c"]
|
||||
resource_name = "Material.391"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=89 format=4 uid="uid://dfpyfpnya0f4u"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_ulct7"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_7yem4"]
|
||||
[ext_resource type="Script" uid="uid://ce73fuh74l81l" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_ulct7"]
|
||||
[ext_resource type="Script" uid="uid://daetb3e2nm56p" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_7yem4"]
|
||||
[ext_resource type="Texture2D" uid="uid://bn3fhfh4jpo6p" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_tile2.png" id="2_m6505"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxs4s61r4l127" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_CEILING_1.jpg" id="3_rjto0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dkcmohd0v7cew" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_STONE_PANEL_2png.png" id="4_ou63s"]
|
||||
@@ -15,7 +15,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://dd4hrbee7mvf" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_CHAIN_TEX_16.png" id="12_litgw"]
|
||||
[ext_resource type="Texture2D" uid="uid://cbdgpe3y7wk40" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_SD137.jpg" id="13_t7brn"]
|
||||
[ext_resource type="Texture2D" uid="uid://bmbvjyqrv1pfl" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_Stone4.png" id="14_gtr3o"]
|
||||
[ext_resource type="Shader" path="res://src/map/overworld/water.gdshader" id="15_na4gl"]
|
||||
[ext_resource type="Shader" uid="uid://blrcjqdo7emhs" path="res://src/map/overworld/water.gdshader" id="15_na4gl"]
|
||||
[ext_resource type="Texture2D" uid="uid://ddxpjgvw2a70i" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_flower.png" id="15_o7x30"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt7uu1n2fjl35" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_FLOOR1.jpg" id="16_v7iwe"]
|
||||
[ext_resource type="Texture2D" uid="uid://oaadtqvv1gj1" path="res://src/map/dungeon/models/water_room/WATER_ROOM_VER2_STONE_PANEL_1png_11.png" id="17_4pi80"]
|
||||
@@ -27,8 +27,8 @@
|
||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="24_7qo1y"]
|
||||
[ext_resource type="Material" uid="uid://bsafm3t4drpl" path="res://src/map/dungeon/textures/MinimapTexture.tres" id="24_w0ing"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="25_bfjom"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="26_c86xl"]
|
||||
[ext_resource type="Script" path="res://src/map/dungeon/code/MinimapManager.cs" id="28_txiha"]
|
||||
[ext_resource type="Script" uid="uid://yl7wyeo5m725" path="res://src/map/dungeon/corridor/remove_unused_doors.gd" id="26_c86xl"]
|
||||
[ext_resource type="Script" uid="uid://c6s8hvdj3u3aq" path="res://src/map/dungeon/code/MinimapManager.cs" id="28_txiha"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mt2fa"]
|
||||
resource_name = "Material.010"
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dl6h1djc27ddl"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dl6h1djc27ddl"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cuhfkyh3d7noa" path="res://src/map/dungeon/code/Overworld.cs" id="1_2ce63"]
|
||||
[ext_resource type="PackedScene" uid="uid://duis2vhf5ojy3" path="res://src/item_rescue/ItemRescue.tscn" id="2_4ixnb"]
|
||||
[ext_resource type="PackedScene" uid="uid://tc5kdfoggrng" path="res://src/item_rescue/RescuedItems.tscn" id="3_tbcl3"]
|
||||
[ext_resource type="PackedScene" uid="uid://1fl6s352e2ej" path="res://src/items/throwable/ThrowableItem.tscn" id="4_wibf0"]
|
||||
[ext_resource type="Resource" uid="uid://bph8c6by4s047" path="res://src/items/throwable/resources/GeomanticDice.tres" id="5_wibf0"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pb22g"]
|
||||
|
||||
@@ -60,6 +59,5 @@ shape = SubResource("SphereShape3D_tbcl3")
|
||||
|
||||
[node name="ThrowableItem" parent="." instance=ExtResource("4_wibf0")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
||||
ThrowableItemInfo = ExtResource("5_wibf0")
|
||||
|
||||
[connection signal="body_entered" from="Spawn Rescued Items/Area3D" to="Rescued Items" method="OnSpawnItemsEntered"]
|
||||
|
||||
@@ -22,9 +22,9 @@ MaximumVT = 90
|
||||
CurrentExp = 0
|
||||
ExpToNextLevel = 10
|
||||
CurrentLevel = 1
|
||||
CurrentAttack = 50
|
||||
CurrentAttack = 8
|
||||
CurrentDefense = 12
|
||||
MaxAttack = 50
|
||||
MaxAttack = 8
|
||||
MaxDefense = 12
|
||||
BonusAttack = 0
|
||||
BonusDefense = 0
|
||||
@@ -426,3 +426,8 @@ spot_range = 11.4821
|
||||
spot_attenuation = -0.67
|
||||
spot_angle = 70.0
|
||||
spot_angle_attenuation = 2.0
|
||||
|
||||
[node name="OmniLight3D2" type="OmniLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.52838, 0.471719)
|
||||
omni_range = 78.167
|
||||
omni_attenuation = -0.156
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@startuml PlayerLogic
|
||||
state "PlayerLogic State" as GameJamDungeon_PlayerLogic_State {
|
||||
state "Disabled" as GameJamDungeon_PlayerLogic_State_Disabled
|
||||
state "Dead" as GameJamDungeon_PlayerLogic_State_Dead
|
||||
state "Alive" as GameJamDungeon_PlayerLogic_State_Alive {
|
||||
state "Attacking" as GameJamDungeon_PlayerLogic_State_Attacking
|
||||
state "Idle" as GameJamDungeon_PlayerLogic_State_Idle
|
||||
}
|
||||
state "Dead" as GameJamDungeon_PlayerLogic_State_Dead
|
||||
state "Disabled" as GameJamDungeon_PlayerLogic_State_Disabled
|
||||
}
|
||||
|
||||
GameJamDungeon_PlayerLogic_State_Alive --> GameJamDungeon_PlayerLogic_State_Alive : Moved
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dbtfgrtgpr4qg"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dbtfgrtgpr4qg"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/ui/death_menu/DeathMenu.cs" id="1_megey"]
|
||||
[ext_resource type="Script" uid="uid://caqsfstq2l0lq" path="res://src/ui/death_menu/DeathMenu.cs" id="1_megey"]
|
||||
[ext_resource type="FontFile" uid="uid://cm8j5vcdop5x0" path="res://src/ui/fonts/Mrs-Eaves-OT-Roman_31443.ttf" id="2_ip5p6"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_6ji3u"]
|
||||
resource_name = "fade_out"
|
||||
length = 0.5
|
||||
[sub_resource type="Animation" id="Animation_qmlrq"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
@@ -12,10 +12,10 @@ tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_q2nvr"]
|
||||
@@ -34,8 +34,9 @@ tracks/0/keys = {
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qmlrq"]
|
||||
length = 0.001
|
||||
[sub_resource type="Animation" id="Animation_6ji3u"]
|
||||
resource_name = "fade_out"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
@@ -43,17 +44,17 @@ tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"times": PackedFloat32Array(0, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
"values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ek7oy"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_qmlrq"),
|
||||
"fade_in": SubResource("Animation_q2nvr"),
|
||||
"fade_out": SubResource("Animation_6ji3u")
|
||||
&"RESET": SubResource("Animation_qmlrq"),
|
||||
&"fade_in": SubResource("Animation_q2nvr"),
|
||||
&"fade_out": SubResource("Animation_6ji3u")
|
||||
}
|
||||
|
||||
[node name="DeathMenu" type="Control"]
|
||||
@@ -78,5 +79,21 @@ color = Color(0.137255, 0.121569, 0.12549, 1)
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_ek7oy")
|
||||
&"": SubResource("AnimationLibrary_ek7oy")
|
||||
}
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="GameOverPlaceholder" type="Label" parent="CenterContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.545098, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 12
|
||||
theme_override_fonts/font = ExtResource("2_ip5p6")
|
||||
theme_override_font_sizes/font_size = 72
|
||||
text = "Game Over"
|
||||
|
||||
Reference in New Issue
Block a user