添加了部分界面
This commit is contained in:
@@ -11,7 +11,7 @@ public partial class BITAppForGodot : Node
|
||||
{
|
||||
public static readonly ValidHandle AllowCursor = new();
|
||||
public static float DeltaTime { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 在构造函数中注册Logger
|
||||
/// </summary>
|
||||
|
@@ -27,4 +27,12 @@ public static partial class MathNode
|
||||
}
|
||||
return nodes.Distinct();
|
||||
}
|
||||
|
||||
public static void RemoveAllChild(Node self)
|
||||
{
|
||||
foreach (var x in self.GetChildren())
|
||||
{
|
||||
x.QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
extends Godot.Resource
|
||||
var Value;
|
@@ -2,6 +2,7 @@ using Godot;
|
||||
|
||||
namespace BITKit;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class StringResource : Resource
|
||||
{
|
||||
[Export]
|
||||
|
8
BITKit/Scripts/Resource/StringResourceTester.cs
Normal file
8
BITKit/Scripts/Resource/StringResourceTester.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using BITKit;
|
||||
|
||||
public partial class StringResourceTester : Node
|
||||
{
|
||||
[Export] private StringResource resource;
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace BITKit;
|
||||
|
||||
@@ -22,10 +23,14 @@ public partial class UXContainer:Control,IUXContainer
|
||||
[Export] public Label updateTimeLabel;
|
||||
[Export] public Label createTimeLabel;
|
||||
[Export] public Label headerLabel;
|
||||
[Export] public Array<Label> labels;
|
||||
[ExportCategory("Button")]
|
||||
[Export] public Button mainButton;
|
||||
[Export] public Button secButton;
|
||||
[Export] public Button thirdButton;
|
||||
[ExportCategory("Text Edit")]
|
||||
[Export] public LineEdit lineEdit;
|
||||
[Export] public Array<LineEdit> lineEdits;
|
||||
|
||||
public string Text
|
||||
{
|
||||
|
35
BITKit/Scripts/UX/UXWindowService.cs
Normal file
35
BITKit/Scripts/UX/UXWindowService.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace BITKit;
|
||||
[Tool]
|
||||
public partial class UXWindowService : Control
|
||||
{
|
||||
[Export] private Array<Button> tabs;
|
||||
[Export] private Array<Control> windows;
|
||||
public override void _Ready()
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
if(tabs.Count != windows.Count) throw new Exception("tabs.Count != windows.Count");
|
||||
ButtonGroup buttonGroup = new();
|
||||
for (var i = 0; i < tabs.Count; i++)
|
||||
{
|
||||
var tab = tabs[i];
|
||||
var window = windows[i];
|
||||
tab.Pressed += () =>
|
||||
{
|
||||
ShowWindow(window);
|
||||
};
|
||||
}
|
||||
}
|
||||
private void ShowWindow(CanvasItem window)
|
||||
{
|
||||
foreach (var x in windows)
|
||||
{
|
||||
//if(window.Visible is true && window != x)
|
||||
x.Hide();
|
||||
}
|
||||
window.Show();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user