✨ Conditionally Create Release (#8)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Godot;
|
||||
using NuGet.Versioning;
|
||||
using FileAccess = Godot.FileAccess;
|
||||
|
||||
namespace SharpIDE.Godot.Features.SlnPicker;
|
||||
|
||||
@@ -8,6 +10,8 @@ public partial class SlnPicker : Control
|
||||
private FileDialog _fileDialog = null!;
|
||||
private Button _openSlnButton = null!;
|
||||
private VBoxContainer _previousSlnsVBoxContainer = null!;
|
||||
private Label _versionLabel = null!;
|
||||
private static NuGetVersion? _version;
|
||||
|
||||
private PackedScene _previousSlnEntryScene = ResourceLoader.Load<PackedScene>("res://Features/SlnPicker/PreviousSlnEntry.tscn");
|
||||
|
||||
@@ -21,12 +25,19 @@ public partial class SlnPicker : Control
|
||||
public override void _Ready()
|
||||
{
|
||||
_previousSlnsVBoxContainer = GetNode<VBoxContainer>("%PreviousSlnsVBoxContainer");
|
||||
_versionLabel = GetNode<Label>("%VersionLabel");
|
||||
_fileDialog = GetNode<FileDialog>("%FileDialog");
|
||||
_openSlnButton = GetNode<Button>("%OpenSlnButton");
|
||||
_openSlnButton.Pressed += () => _fileDialog.PopupCentered();
|
||||
var windowParent = GetParentOrNull<Window>();
|
||||
_fileDialog.FileSelected += path => _tcs.SetResult(path);
|
||||
windowParent?.CloseRequested += () => _tcs.SetResult(null);
|
||||
if (_version is null)
|
||||
{
|
||||
var version = FileAccess.GetFileAsString("res://version.txt").Trim();
|
||||
_version = NuGetVersion.Parse(version);
|
||||
}
|
||||
_versionLabel.Text = $"v{_version.ToNormalizedString()}";
|
||||
if (Singletons.AppState.IdeSettings.AutoOpenLastSolution && GetParent() is not Window)
|
||||
{
|
||||
var lastSln = Singletons.AppState.RecentSlns.LastOrDefault();
|
||||
|
||||
@@ -65,7 +65,8 @@ alignment = 1
|
||||
layout_mode = 2
|
||||
text = "SharpIDE"
|
||||
|
||||
[node name="Label2" type="Label" parent="VSplitContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
[node name="VersionLabel" type="Label" parent="VSplitContainer/Panel2/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.5689727, 0.56897277, 0.5689727, 1)
|
||||
text = "v0.1.2"
|
||||
|
||||
1
src/SharpIDE.Godot/version.txt
Normal file
1
src/SharpIDE.Godot/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
0.1.2
|
||||
Reference in New Issue
Block a user