release
This commit is contained in:
parent
964e1a5875
commit
b4a22077dc
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dxsds46xgtfds"
|
||||
path="res://.godot/imported/logo-caict.png-ec22664722b38ba2bca6fdc74c2d23fb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Artists/Art/Logos/logo-caict.png"
|
||||
dest_files=["res://.godot/imported/logo-caict.png-ec22664722b38ba2bca6fdc74c2d23fb.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
|
|
@ -9,13 +9,14 @@ corner_radius_top_right = 8
|
|||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
||||
[node name="Option-Button" type="PanelContainer" node_paths=PackedStringArray("button", "labels", "lineEdits")]
|
||||
[node name="Option-Button" type="PanelContainer" node_paths=PackedStringArray("labels", "buttons", "lineEdits", "optionButtons")]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
script = ExtResource("1_vmd75")
|
||||
button = NodePath("Button")
|
||||
labels = []
|
||||
buttons = [NodePath("Button")]
|
||||
lineEdits = []
|
||||
optionButtons = []
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(384, 0)
|
||||
|
|
|
@ -8,10 +8,7 @@ theme_type_variation = &"HeaderLarge"
|
|||
text = "标识更新"
|
||||
|
||||
[node name="Context" type="Label" parent="."]
|
||||
custom_minimum_size = Vector2(0, 128)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
text = "通常该过程是自动更新的,但有时候会有需要手动更新标识的情况"
|
||||
|
||||
[node name="占位符" type="Control" parent="."]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://dey6r76kttak6"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dey6r76kttak6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://d1uver224k3px" path="res://addons/ui_design_tool/assets/icons/folder_open-white-18dp.svg" id="1_jbnj1"]
|
||||
[ext_resource type="Texture2D" uid="uid://dn7q7grbfr7kh" path="res://addons/ui_design_tool/assets/icons/refresh-white-18dp.svg" id="1_miiu5"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhws1cqlkdixm" path="res://Artists/Art/Icons/icon_folder.png" id="1_ipnal"]
|
||||
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXTabViewService.cs" id="3_7cg45"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_uocfi"]
|
||||
|
@ -29,6 +28,17 @@ layout_mode = 2
|
|||
layout_mode = 2
|
||||
text = "按钮"
|
||||
|
||||
[node name="Button6" type="Button" parent="Scroll/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Icon 按钮"
|
||||
icon = ExtResource("1_ipnal")
|
||||
|
||||
[node name="Button7" type="Button" parent="Scroll/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"SideTab"
|
||||
text = "SideBar"
|
||||
icon = ExtResource("1_ipnal")
|
||||
|
||||
[node name="Button2" type="Button" parent="Scroll/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"Accent"
|
||||
|
@ -42,7 +52,6 @@ text = "按钮 ColorPanel"
|
|||
[node name="Button5" type="Button" parent="Scroll/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "按钮"
|
||||
icon = ExtResource("1_miiu5")
|
||||
alignment = 0
|
||||
|
||||
[node name="Button4" type="Button" parent="Scroll/HBoxContainer/VBoxContainer"]
|
||||
|
@ -73,7 +82,6 @@ text = "SideBar 1"
|
|||
layout_mode = 2
|
||||
theme_type_variation = &"SideTab"
|
||||
text = "SideBar 1"
|
||||
icon = ExtResource("1_jbnj1")
|
||||
|
||||
[node name="Button3" type="Button" parent="Scroll/HBoxContainer/VBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25,7 +25,7 @@ public partial class NodeBuilder : Node
|
|||
Clear();
|
||||
}
|
||||
}
|
||||
public T Build<T>() where T : Node
|
||||
public T Build<T>() where T : Node, new()
|
||||
{
|
||||
Node instance;
|
||||
if (template is not null)
|
||||
|
@ -36,31 +36,20 @@ public partial class NodeBuilder : Node
|
|||
}
|
||||
else
|
||||
{
|
||||
instance = new PanelContainer();
|
||||
var margin = new MarginContainer();
|
||||
|
||||
AddChild(instance);
|
||||
|
||||
instance.AddChild(margin);
|
||||
instance = margin;
|
||||
|
||||
margin.AddThemeConstantOverride("theme_override_constants/margin_left",16);
|
||||
margin.AddThemeConstantOverride("theme_override_constants/margin_top",16);
|
||||
margin.AddThemeConstantOverride("theme_override_constants/margin_right",16);
|
||||
margin.AddThemeConstantOverride("theme_override_constants/margin_button",16);
|
||||
instance = this.Create<T>();
|
||||
}
|
||||
|
||||
emptyHints?.Hide();;
|
||||
emptyHints?.Hide();
|
||||
|
||||
_instances.Add(instance);
|
||||
return instance as T;
|
||||
return (T)instance;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_instances.Clear();
|
||||
emptyHints?.Show();
|
||||
if (clearTemplateOnly)
|
||||
if (clearTemplateOnly && template is not null)
|
||||
{
|
||||
foreach (var x in GetChildren())
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@ using System.Threading;
|
|||
using Cysharp.Threading.Tasks;
|
||||
using Godot;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using HttpClient = System.Net.Http.HttpClient;
|
||||
|
||||
namespace BITKit;
|
||||
|
|
|
@ -6,45 +6,22 @@ namespace BITKit;
|
|||
|
||||
public partial class UXContainer:Control
|
||||
{
|
||||
[Export] public Label label;
|
||||
[Export] public RichTextLabel richTextLabel;
|
||||
[Export] public Label titleLabel;
|
||||
[Export] public TextureRect icon;
|
||||
[Export] public Node contextContainer;
|
||||
|
||||
[ExportCategory(nameof(Label))]
|
||||
[Export] public Array<Label> labels;
|
||||
|
||||
public Label label => labels[0];
|
||||
|
||||
[ExportCategory(nameof(Button))]
|
||||
[Export] public Button button;
|
||||
[Export] public Array<Button> buttons;
|
||||
public Button button => buttons[0];
|
||||
|
||||
[ExportCategory(nameof(TextEdit))]
|
||||
[Export] public LineEdit lineEdit;
|
||||
[Export] public Array<LineEdit> lineEdits;
|
||||
|
||||
[ExportCategory(nameof(OptionButton))]
|
||||
[Export] public OptionButton optionButton;
|
||||
[Export] public Array<OptionButton> optionButtons;
|
||||
public LineEdit lineEdit => lineEdits[0];
|
||||
|
||||
[ExportCategory(nameof(OptionButton))]
|
||||
[Export] public Array<OptionButton> optionButtons;
|
||||
public OptionButton optionButton=>optionButtons[0];
|
||||
|
||||
public string Text
|
||||
{
|
||||
get =>label is not null ? label.Text : richTextLabel.Text;
|
||||
set
|
||||
{
|
||||
switch (label, richTextLabel)
|
||||
{
|
||||
case (not null, null):
|
||||
label.Text = value;
|
||||
break;
|
||||
case (null, not null):
|
||||
richTextLabel.Text = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void SetText(string text)
|
||||
{
|
||||
Text=text;
|
||||
}
|
||||
}
|
|
@ -33,6 +33,13 @@ public partial class UXService : Control, IUXService
|
|||
|
||||
public static void Open<T>() where T : IUXPanel
|
||||
{
|
||||
foreach (var x in Panels.Values)
|
||||
{
|
||||
if (x is not T value) continue;
|
||||
Open(value);
|
||||
return;
|
||||
}
|
||||
throw new KeyNotFoundException($"未找到类型为{typeof(T).FullName}的面板");
|
||||
}
|
||||
|
||||
public static void Return()
|
||||
|
@ -106,8 +113,6 @@ public partial class UXService : Control, IUXService
|
|||
if (InitializationState is InitializationState.Initialized)
|
||||
result.Exit();
|
||||
}
|
||||
|
||||
|
||||
if (!EnableQueue.TryPop(out var next)) return;
|
||||
if (InitializationState is InitializationState.None)
|
||||
{
|
||||
|
|
|
@ -4,11 +4,10 @@ using Godot.Collections;
|
|||
|
||||
namespace BITKit.UX
|
||||
{
|
||||
[Tool]
|
||||
public partial class UXTabViewService : Control
|
||||
{
|
||||
[ExportCategory(Constant.Header.Settings)]
|
||||
[Export(PropertyHint.Range, "0,100,1")]
|
||||
[Export(PropertyHint.Range, "0,100")]
|
||||
private int currentIndex
|
||||
{
|
||||
get=>_currentIndex;
|
||||
|
@ -51,7 +50,8 @@ namespace BITKit.UX
|
|||
|
||||
EnsureConfiguration();
|
||||
|
||||
value = Mathf.Clamp(value, 0, tabContainer.GetChildCount() -1 );
|
||||
var max = tabContainer.GetChildCount() - 1;
|
||||
value = Mathf.Clamp(value, 0, max < 0 ? 0 : max );
|
||||
|
||||
_currentIndex = value;
|
||||
tabContainer.CurrentTab = value;
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dtj7nda1ayopv"
|
||||
path="res://.godot/imported/icon00.6edd3f5c.png-a103df04914a246d9f20458f564e56b0.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Mods/工业数据采集与分析应用分享/Arts/Icons/icon00.6edd3f5c.png"
|
||||
dest_files=["res://.godot/imported/icon00.6edd3f5c.png-a103df04914a246d9f20458f564e56b0.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
|
|
@ -14,7 +14,7 @@ public partial class IDIS_GodotBasedService:EntityComponent
|
|||
{
|
||||
public override void BuildService(IServiceCollection serviceCollection)
|
||||
{
|
||||
serviceCollection.AddTransient<IDIS_Service, IDIS_Service_SQLite>();
|
||||
serviceCollection.AddTransient<IDIS_Service, IDIS_Service_SQLiteBased>();
|
||||
}
|
||||
|
||||
public override async void OnStart()
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using BITKit;
|
||||
using IDIS.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IDIS;
|
||||
|
||||
public partial class IDIS_GodotBasedTemplateService : EntityComponent
|
||||
{
|
||||
public override void BuildService(IServiceCollection serviceCollection)
|
||||
{
|
||||
serviceCollection.AddSingleton<IDIS_TemplateService, IDIS_TemplateService_JsonBased>();
|
||||
}
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
Entity.ServiceProvider.GetRequiredService<IDIS_TemplateService>();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using BITKit;
|
||||
using IDIS.Models;
|
||||
using IDIS.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IDIS;
|
||||
public partial class IDIS_Query : EntityComponent
|
||||
{
|
||||
[ExportCategory(nameof(UXContainer))]
|
||||
[Export] private UXContainer queryContainer;
|
||||
[Export] private UXContainer titleBarContainer;
|
||||
|
||||
[ExportCategory(nameof(Label))]
|
||||
[Export] private Label logLabel;
|
||||
|
||||
[ExportCategory(nameof(NodeBuilder))]
|
||||
[Export] private NodeBuilder contentBuilder;
|
||||
|
||||
//private IDIS_TemplateService _templateService;
|
||||
private IDIS_Service _service;
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
//_templateService = Entity.ServiceProvider.GetRequiredService<IDIS_TemplateService>();
|
||||
_service = Entity.ServiceProvider.GetRequiredService<IDIS_Service>();
|
||||
|
||||
queryContainer.button.Pressed += () =>
|
||||
{
|
||||
Query(queryContainer.lineEdit.Text);
|
||||
};
|
||||
|
||||
titleBarContainer.Hide();
|
||||
}
|
||||
|
||||
private async void Query(string handle)
|
||||
{
|
||||
try
|
||||
{
|
||||
titleBarContainer.Hide();
|
||||
var response = await _service.QueryAsync(handle);
|
||||
contentBuilder.Clear();
|
||||
await BITApp.SwitchToMainThread();
|
||||
if (response.TryAs<IDIS_Data>(out var data) is false)
|
||||
throw new InvalidOperationException(response.Message);
|
||||
|
||||
titleBarContainer.Show();
|
||||
|
||||
foreach (var x in data.IdData)
|
||||
{
|
||||
var container = contentBuilder.Build<HBoxContainer>();
|
||||
|
||||
var nameLabel = container.Create<Label>();
|
||||
var valueLabel = container.Create<Label>();
|
||||
|
||||
nameLabel.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
valueLabel.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
|
||||
nameLabel.Text = x.Name;
|
||||
valueLabel.Text = x.RealVal;
|
||||
}
|
||||
logLabel.Hide();
|
||||
|
||||
titleBarContainer.labels[0].Text = data.TitleBarInfo.Handle;
|
||||
titleBarContainer.labels[1].Text =$"查询次数:{data.TitleBarInfo.Count}次";
|
||||
}
|
||||
catch (InvalidOperationException e)
|
||||
{
|
||||
await BITApp.SwitchToMainThread();
|
||||
logLabel.Show();
|
||||
logLabel.Text = e.Message;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using BITKit;
|
||||
using IDIS.Models;
|
||||
using IDIS.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace IDIS;
|
||||
public partial class IDIS_Register : EntityComponent
|
||||
{
|
||||
[Export] private UXContainer handleContainer;
|
||||
[Export] private Button generateHandleButton;
|
||||
[Export] private Button registerButton;
|
||||
[Export] private Label logLabel;
|
||||
[ExportCategory("Builder")]
|
||||
[Export] private NodeBuilder headerBuilder;
|
||||
[Export] private NodeBuilder contentBuilder;
|
||||
|
||||
private IDIS_TemplateService _templateService;
|
||||
private IDIS_Service _service;
|
||||
|
||||
private ButtonGroup _buttonGroup;
|
||||
|
||||
private string[] _currentValues = Array.Empty<string>();
|
||||
|
||||
private IDIS_Template _currentTemplate;
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
_buttonGroup = new ButtonGroup();
|
||||
_templateService = Entity.ServiceProvider.GetRequiredService<IDIS_TemplateService>();
|
||||
_service = Entity.ServiceProvider.GetRequiredService<IDIS_Service>();
|
||||
|
||||
_templateService.OnTemplateCreated +=x=> Rebuild();
|
||||
_templateService.OnTemplateDeleted +=x=> Rebuild();
|
||||
|
||||
Rebuild();
|
||||
|
||||
generateHandleButton.Pressed += GenerateHandle;
|
||||
|
||||
registerButton.Pressed += Register;
|
||||
}
|
||||
|
||||
private void GenerateHandle()
|
||||
{
|
||||
handleContainer.lineEdits[0].Text = $"88.123.99/{DateTime.Now.Ticks}";
|
||||
}
|
||||
|
||||
private async void Rebuild()
|
||||
{
|
||||
_currentTemplate = null;
|
||||
headerBuilder.Clear();
|
||||
contentBuilder.Clear();
|
||||
_currentValues = Array.Empty<string>();
|
||||
|
||||
handleContainer.lineEdits[0].Text = string.Empty;
|
||||
|
||||
var response = await _templateService.ToArrayAsync();
|
||||
await BITApp.SwitchToMainThread();
|
||||
|
||||
if (response.TryAs<IDIS_Template[]>(out var templates) is false) return;
|
||||
|
||||
foreach (var x in templates)
|
||||
{
|
||||
var container = headerBuilder.Build<UXContainer>();
|
||||
container.buttons[0].Text = $"{x.Prefix} {x.Version}";
|
||||
container.buttons[0].Pressed += () => Entry(x);
|
||||
container.buttons[0].ButtonGroup = _buttonGroup;
|
||||
container.buttons[0].ToggleMode = true;
|
||||
|
||||
}
|
||||
}
|
||||
private void Entry(IDIS_Template template)
|
||||
{
|
||||
_currentTemplate = template;
|
||||
contentBuilder.Clear();
|
||||
_currentValues = new string[template.Items.Length];
|
||||
|
||||
for (var i = 0; i < template.Items.Length; i++)
|
||||
{
|
||||
var currentIndex = i;
|
||||
var x = template.Items[i];
|
||||
var container = contentBuilder.Build<PanelContainer>().Create<MarginContainer>().Create<HBoxContainer>();
|
||||
|
||||
var nameLabel = container.Create<Label>();
|
||||
var typeLabel = container.Create<Label>();
|
||||
var valueEdit = container.Create<LineEdit>();
|
||||
|
||||
nameLabel.Text = x.Name;
|
||||
typeLabel.Text = x.IdType;
|
||||
|
||||
nameLabel.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
typeLabel.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
valueEdit.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
|
||||
valueEdit.TextChanged += (value) =>
|
||||
{
|
||||
_currentValues[currentIndex] = value;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private async void Register()
|
||||
{
|
||||
registerButton.Disabled = true;
|
||||
try
|
||||
{
|
||||
if (_currentValues.Length is 0 || _currentTemplate is null)
|
||||
{
|
||||
throw new InvalidOperationException("请先选择模板");
|
||||
}
|
||||
|
||||
var handle = handleContainer.lineEdits[0].Text;
|
||||
if (Regex.IsMatch(handle, IDIS_Code.AddressRegex) is false)
|
||||
{
|
||||
throw new InvalidOperationException($"{handle} is not match {IDIS_Code.AddressRegex}");
|
||||
}
|
||||
|
||||
var dictionary = new Dictionary<string, object>();
|
||||
for (var i = 0; i < _currentTemplate.Items.Length; i++)
|
||||
{
|
||||
var item = _currentTemplate.Items[i];
|
||||
var value = _currentValues[i];
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
throw new InvalidOperationException($"{item.Name} value is empty");
|
||||
}
|
||||
|
||||
dictionary.Add(item.Name, value);
|
||||
}
|
||||
|
||||
var response = await _service.RegisterAsync(handle, _currentTemplate.Version, dictionary);
|
||||
await BITApp.SwitchToMainThread();
|
||||
logLabel.Text = response.Message;
|
||||
}
|
||||
catch (InvalidOperationException e)
|
||||
{
|
||||
logLabel.Text = e.Message;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
await BITApp.SwitchToMainThread();
|
||||
logLabel.Text = e.Message;
|
||||
throw;
|
||||
}
|
||||
await BITApp.SwitchToMainThread();
|
||||
registerButton.Disabled = false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,223 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using BITKit;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using IDIS.Models;
|
||||
using IDIS.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SQLitePCL;
|
||||
|
||||
// ReSharper disable UnusedMember.Local
|
||||
|
||||
namespace IDIS;
|
||||
public partial class IDIS_TemplateBuilder : EntityComponent
|
||||
{
|
||||
private enum TemplateFieldFormatType
|
||||
{
|
||||
String=0,
|
||||
Int=1,
|
||||
Float=2,
|
||||
DateTime=3,
|
||||
Guid=4,
|
||||
}
|
||||
private class IDIS_TemplateItem
|
||||
{
|
||||
public readonly LineEdit NameEdit;
|
||||
public readonly OptionButton TypeButton;
|
||||
public readonly Button RemoveButton;
|
||||
public IDIS_TemplateItem(LineEdit nameEdit, OptionButton typeButton, Button removeButton)
|
||||
{
|
||||
NameEdit = nameEdit;
|
||||
TypeButton = typeButton;
|
||||
RemoveButton = removeButton;
|
||||
}
|
||||
}
|
||||
|
||||
[Export] private UXContainer prefixEdit;
|
||||
[Export] private UXContainer versionEdit;
|
||||
[Export] private UXContainer descriptionEdit;
|
||||
[Export] private Button createButton;
|
||||
[Export] private Button createEmptyButton;
|
||||
[Export] private Button addItemButton;
|
||||
[Export] private Button deleteButton;
|
||||
[Export] private Label logLabel;
|
||||
|
||||
[ExportCategory("Builder ")]
|
||||
[Export] private NodeBuilder headerBuilder;
|
||||
[Export] private NodeBuilder contentBuilder;
|
||||
|
||||
private IDIS_TemplateService _templateService;
|
||||
private ButtonGroup _buttonGroup;
|
||||
private readonly List<IDIS_TemplateItem> _items = new();
|
||||
|
||||
private IDIS_Template _currentTemplate;
|
||||
|
||||
public override async void OnStart()
|
||||
{
|
||||
_buttonGroup = new ButtonGroup();
|
||||
_templateService = Entity.ServiceProvider.GetRequiredService<IDIS_TemplateService>();
|
||||
|
||||
createEmptyButton.Pressed += Clear;
|
||||
addItemButton.Pressed += ()=>CreateField();
|
||||
createButton.Pressed += CreateTemplate;
|
||||
deleteButton.Pressed += Delete;
|
||||
|
||||
_templateService.OnTemplateCreated +=x=> CreateHeader(x);
|
||||
_templateService.OnTemplateDeleted += OnTemplateDeleted;
|
||||
|
||||
await BITApp.SwitchToMainThread();
|
||||
|
||||
RebuildHeader();
|
||||
}
|
||||
|
||||
private void Clear()
|
||||
{
|
||||
contentBuilder.Clear();
|
||||
_items.Clear();
|
||||
prefixEdit.lineEdits[0].Text = string.Empty;
|
||||
versionEdit.lineEdits[0].Text = string.Empty;
|
||||
descriptionEdit.lineEdits[0].Text = string.Empty;
|
||||
}
|
||||
private void Entry(IDIS_Template template)
|
||||
{
|
||||
Clear();
|
||||
foreach (var x in template.Items)
|
||||
{
|
||||
var field = CreateField();
|
||||
field.NameEdit.Text = x.Name;
|
||||
field.TypeButton.Selected = (int)Enum.Parse<TemplateFieldFormatType>(x.IdType);
|
||||
}
|
||||
prefixEdit.lineEdits[0].Text = template.Prefix;
|
||||
versionEdit.lineEdits[0].Text = template.Version;
|
||||
descriptionEdit.lineEdits[0].Text = template.Description;
|
||||
|
||||
_currentTemplate = template;
|
||||
}
|
||||
private async void CreateTemplate()
|
||||
{
|
||||
var template = new IDIS_Template
|
||||
{
|
||||
Prefix = prefixEdit.lineEdits[0].Text,
|
||||
Version = versionEdit.lineEdits[0].Text,
|
||||
Description = descriptionEdit.lineEdits[0].Text,
|
||||
Items = _items.Select(x => new IDIS_Template_Item(x.NameEdit.Text, x.TypeButton.GetItemText(x.TypeButton.Selected))).ToArray()
|
||||
};
|
||||
if (string.IsNullOrEmpty(template.Prefix))
|
||||
{
|
||||
logLabel.Text = "前缀不能为空";
|
||||
return;
|
||||
}
|
||||
if(string.IsNullOrEmpty(template.Version))
|
||||
{
|
||||
logLabel.Text = "版本号不能为空";
|
||||
return;
|
||||
}
|
||||
if(_items.Count is 0)
|
||||
{
|
||||
logLabel.Text = "模板项不能为空";
|
||||
return;
|
||||
}
|
||||
if(_items.Any(x=>string.IsNullOrEmpty(x.NameEdit.Text) || x.TypeButton.Selected < 0))
|
||||
{
|
||||
logLabel.Text = "模板项不能为空";
|
||||
return;
|
||||
}
|
||||
|
||||
if (Regex.IsMatch(template.Prefix, IDIS_Code.Prefix) is false)
|
||||
{
|
||||
logLabel.Text = $"前缀格式不正确,${template.Prefix} is not match {IDIS_Code.Prefix},use 88.123.99 instead";
|
||||
return;
|
||||
}
|
||||
createButton.Disabled = true;
|
||||
logLabel.Text = "正在等待 模板服务 响应...";
|
||||
var response = await _templateService.SaveAsync(template);
|
||||
logLabel.Text = "正在等待 回到主线程...";
|
||||
await UniTask.SwitchToSynchronizationContext(BITApp.SynchronizationContext);
|
||||
logLabel.Text = response.Message;
|
||||
createButton.Disabled = false;
|
||||
|
||||
_currentTemplate = template;
|
||||
}
|
||||
private UXContainer CreateHeader(IDIS_Template template)
|
||||
{
|
||||
var container = headerBuilder.Build<UXContainer>();
|
||||
container.buttons[0].ButtonGroup = _buttonGroup;
|
||||
container.buttons[0].Text = $"{template.Prefix} {template.Version}";
|
||||
container.buttons[0].Pressed += () => Entry(template);
|
||||
return container;
|
||||
}
|
||||
private IDIS_TemplateItem CreateField()
|
||||
{
|
||||
var container = contentBuilder.Build<PanelContainer>().Create<MarginContainer>().Create<HBoxContainer>();
|
||||
|
||||
var field = new IDIS_TemplateItem(container.Create<LineEdit>(), container.Create<OptionButton>(),container.Create<Button>())
|
||||
{
|
||||
NameEdit =
|
||||
{
|
||||
PlaceholderText = "值名称",
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ExpandFill
|
||||
},
|
||||
TypeButton =
|
||||
{
|
||||
Selected = 0,
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ExpandFill
|
||||
}
|
||||
,
|
||||
RemoveButton =
|
||||
{
|
||||
Text = "移除",
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ExpandFill
|
||||
}
|
||||
};
|
||||
|
||||
_items.Add(field);
|
||||
|
||||
var index = 0;
|
||||
foreach (var name in Enum.GetNames<TemplateFieldFormatType>())
|
||||
{
|
||||
field.TypeButton.AddItem(name, index++);
|
||||
}
|
||||
|
||||
field.RemoveButton.Pressed += () =>
|
||||
{
|
||||
_items.Remove(field);
|
||||
container.GetParent().QueueFree();
|
||||
};
|
||||
return field;
|
||||
}
|
||||
|
||||
private void OnTemplateDeleted(IDIS_Template template)
|
||||
{
|
||||
_currentTemplate = null;
|
||||
Clear();
|
||||
RebuildHeader();
|
||||
}
|
||||
private async void Delete()
|
||||
{
|
||||
if (_currentTemplate is null)
|
||||
{
|
||||
logLabel.Text = "当前没有选中的模板";
|
||||
return;
|
||||
}
|
||||
var response = await _templateService.DeleteAsync(_currentTemplate.Prefix, _currentTemplate.Version);
|
||||
logLabel.Text = response.Message;
|
||||
}
|
||||
|
||||
private async void RebuildHeader()
|
||||
{
|
||||
var request = await _templateService.ToArrayAsync();
|
||||
|
||||
if (request.TryAs<IDIS_Template[]>(out var templates) is false) return;
|
||||
|
||||
headerBuilder.Clear();
|
||||
|
||||
foreach (var template in templates)
|
||||
{
|
||||
CreateHeader(template);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +1,11 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://bu5w3n4me3xj2"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://bu5w3n4me3xj2"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://6dpw3hl2gu10" path="res://Mods/工业数据采集与分析应用分享/Arts/Illustrations/Illustration_ABB_Rotbotic_Arm_Rendering_DWADWFF.jpg" id="1_uwo3j"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwdlewpjrt8pf" path="res://Mods/教育平台/Templates/选择课程.tscn" id="2_rvvu8"]
|
||||
[ext_resource type="Script" path="res://BITKit/Scripts/UX/UXPanel.cs" id="2_vgo47"]
|
||||
[ext_resource type="Theme" uid="uid://dokwscirps6nt" path="res://Artists/Themes/Factory_Theme.tres" id="3_t8g27"]
|
||||
[ext_resource type="Texture2D" uid="uid://be1o87ilc237s" path="res://Artists/Art/Logos/logo-intelli.png" id="3_wkkwb"]
|
||||
[ext_resource type="Texture2D" uid="uid://dxsds46xgtfds" path="res://Artists/Art/Logos/logo-caict.png" id="4_2c082"]
|
||||
[ext_resource type="PackedScene" uid="uid://cngf2h2a5ne4a" path="res://Mods/工业数据采集与分析应用分享/标识注册与解析.tscn" id="6_1g0h3"]
|
||||
[ext_resource type="Script" path="res://BITKit/Scripts/ECS/Core/Entity.cs" id="7_sk587"]
|
||||
[ext_resource type="Script" path="res://Mods/工业数据采集与分析应用分享/Scripts/IDIS_GodotBasedService.cs" id="8_egj5m"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0jsjw"]
|
||||
bg_color = Color(0, 0, 0, 0.501961)
|
||||
|
@ -16,10 +14,21 @@ corner_radius_top_right = 8
|
|||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
||||
[node name="教育平台主菜单" type="Node"]
|
||||
[node name="教育平台主菜单" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_vgo47")
|
||||
allowCursor = true
|
||||
allowInput = true
|
||||
isStartPanel = true
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
modulate = Color(0.278431, 0.278431, 0.278431, 0.666667)
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
@ -29,23 +38,19 @@ texture = ExtResource("1_uwo3j")
|
|||
expand_mode = 1
|
||||
stretch_mode = 6
|
||||
|
||||
[node name="UX TabView Service" type="VBoxContainer" parent="."]
|
||||
[node name="Panel" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_vgo47")
|
||||
isAnimate = null
|
||||
allowCursor = true
|
||||
allowInput = true
|
||||
isStartPanel = true
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="UX TabView Service"]
|
||||
[node name="ColorRect" type="ColorRect" parent="Panel"]
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabBar" type="TabBar" parent="UX TabView Service/ColorRect"]
|
||||
[node name="TabBar" type="TabBar" parent="Panel/ColorRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
|
@ -62,7 +67,7 @@ tab_0/title = "教程与实训"
|
|||
tab_1/title = "知识点"
|
||||
tab_2/title = "设置"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UX TabView Service/ColorRect"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/ColorRect"]
|
||||
layout_mode = 0
|
||||
offset_left = 189.0
|
||||
offset_right = 737.0
|
||||
|
@ -71,7 +76,7 @@ theme_override_constants/separation = 0
|
|||
alignment = 1
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="Label" type="Label" parent="UX TabView Service/ColorRect/VBoxContainer"]
|
||||
[node name="Label" type="Label" parent="Panel/ColorRect/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
theme_type_variation = &"HeaderMedium"
|
||||
|
@ -79,14 +84,14 @@ theme_override_colors/font_color = Color(0, 0, 0, 1)
|
|||
text = "虚拟仿真实训课程体系"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="UX TabView Service/ColorRect/VBoxContainer"]
|
||||
[node name="Label2" type="Label" parent="Panel/ColorRect/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_t8g27")
|
||||
theme_type_variation = &"HeaderSmall"
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "Virtual Simulation Training Course System"
|
||||
text = "中国信息通信院定制版"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="UX TabView Service/ColorRect"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/ColorRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 9
|
||||
anchor_bottom = 1.0
|
||||
|
@ -97,13 +102,13 @@ theme_override_constants/margin_top = 8
|
|||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="UX TabView Service/ColorRect/MarginContainer"]
|
||||
[node name="TextureRect" type="TextureRect" parent="Panel/ColorRect/MarginContainer"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_wkkwb")
|
||||
texture = ExtResource("4_2c082")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="ReferenceRect" type="MarginContainer" parent="UX TabView Service"]
|
||||
[node name="ReferenceRect" type="MarginContainer" parent="Panel"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 32
|
||||
|
@ -111,51 +116,51 @@ theme_override_constants/margin_top = 32
|
|||
theme_override_constants/margin_right = 32
|
||||
theme_override_constants/margin_bottom = 32
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="UX TabView Service/ReferenceRect"]
|
||||
[node name="TabContainer" type="TabContainer" parent="Panel/ReferenceRect"]
|
||||
layout_mode = 2
|
||||
tabs_visible = false
|
||||
|
||||
[node name="教程" type="HBoxContainer" parent="UX TabView Service/ReferenceRect/TabContainer"]
|
||||
[node name="教程" type="HBoxContainer" parent="Panel/ReferenceRect/TabContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 32
|
||||
|
||||
[node name="Layout" type="VBoxContainer" parent="UX TabView Service/ReferenceRect/TabContainer/教程"]
|
||||
[node name="Layout" type="VBoxContainer" parent="Panel/ReferenceRect/TabContainer/教程"]
|
||||
custom_minimum_size = Vector2(384, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout/HBoxContainer"]
|
||||
[node name="Label" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "CAICT定制版"
|
||||
|
||||
[node name="Label2" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout/HBoxContainer"]
|
||||
[node name="Label2" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderSmall"
|
||||
text = "仅包括1个课程"
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="HSeparator" type="HSeparator" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 32
|
||||
|
||||
[node name="Label3" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="Label3" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "教程与实训"
|
||||
|
||||
[node name="Label4" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="Label4" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderSmall"
|
||||
theme_override_colors/font_color = Color(0, 0.698039, 0.886275, 1)
|
||||
text = "导入链接(试用版未启用)"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="HSeparator2" type="HSeparator" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 32
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
bbcode_enabled = true
|
||||
text = "最后更新时间:
|
||||
|
@ -168,77 +173,77 @@ Powered By
|
|||
重庆市渝北区宝圣湖街道食品城大道18号重庆广告产业园15幢1单元2-3"
|
||||
fit_content = true
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout"]
|
||||
[node name="GridContainer" type="GridContainer" parent="Panel/ReferenceRect/TabContainer/教程/Layout"]
|
||||
layout_mode = 2
|
||||
columns = 2
|
||||
|
||||
[node name="Label" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
[node name="Label" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "联系人:"
|
||||
|
||||
[node name="Label2" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
[node name="Label2" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "王浩 15928031321"
|
||||
|
||||
[node name="Label3" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
[node name="Label3" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
layout_mode = 2
|
||||
text = "邮箱:"
|
||||
|
||||
[node name="Label4" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
[node name="Label4" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/Layout/GridContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "wanghao@cn-intelli.com"
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="UX TabView Service/ReferenceRect/TabContainer/教程"]
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/ReferenceRect/TabContainer/教程"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 16
|
||||
|
||||
[node name="Label2" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer"]
|
||||
[node name="Label2" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "工业互联网标识解析与注册"
|
||||
|
||||
[node name="NinePatchRect4" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer" instance=ExtResource("2_rvvu8")]
|
||||
[node name="NinePatchRect4" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer" instance=ExtResource("2_rvvu8")]
|
||||
layout_mode = 2
|
||||
CourseScene = ExtResource("6_1g0h3")
|
||||
CourseName = "标注解析与注册"
|
||||
|
||||
[node name="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer" index="0"]
|
||||
[node name="Label" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer" index="0"]
|
||||
text = "标识注册解析模拟系统"
|
||||
|
||||
[node name="Label2" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer" index="1"]
|
||||
[node name="Label2" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer" index="1"]
|
||||
text = "#371647"
|
||||
|
||||
[node name="Label2" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer2" index="1"]
|
||||
text = "5"
|
||||
[node name="Label2" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer2" index="1"]
|
||||
text = "3"
|
||||
|
||||
[node name="Label2" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer3" index="1"]
|
||||
[node name="Label2" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer3" index="1"]
|
||||
text = "0"
|
||||
|
||||
[node name="Label2" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer4" index="1"]
|
||||
text = "1"
|
||||
|
||||
[node name="Label2" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer4" index="1"]
|
||||
text = "1"
|
||||
|
||||
[node name="Label2" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer6" index="1"]
|
||||
[node name="Label2" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer6" index="1"]
|
||||
text = "40"
|
||||
|
||||
[node name="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer7" index="0"]
|
||||
[node name="Label" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer/VBoxContainer7" index="0"]
|
||||
text = "协作类型"
|
||||
|
||||
[node name="Label2" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2" index="2"]
|
||||
text = "2023年7月3日"
|
||||
[node name="Label2" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4/MarginContainer/HBoxContainer/MarginContainer/VBoxContainer2" index="2"]
|
||||
text = "2023年9月16日"
|
||||
|
||||
[node name="Label" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer"]
|
||||
[node name="Label" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderLarge"
|
||||
text = "更多实训"
|
||||
|
||||
[node name="Label3" type="Label" parent="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer"]
|
||||
[node name="Label3" type="Label" parent="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(0, 128)
|
||||
layout_mode = 2
|
||||
theme_type_variation = &"HeaderSmall"
|
||||
|
@ -248,20 +253,21 @@ text = "该版本为定制版,只有定制课程"
|
|||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="知识点" type="Container" parent="UX TabView Service/ReferenceRect/TabContainer"]
|
||||
[node name="知识点" type="Container" parent="Panel/ReferenceRect/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="设置" type="Container" parent="UX TabView Service/ReferenceRect/TabContainer"]
|
||||
[node name="设置" type="Container" parent="Panel/ReferenceRect/TabContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="UX TabView Service/ReferenceRect/TabContainer/设置"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/ReferenceRect/TabContainer/设置"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="UX TabView Service/ReferenceRect/TabContainer/设置/VBoxContainer"]
|
||||
[node name="OptionButton" type="OptionButton" parent="Panel/ReferenceRect/TabContainer/设置/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
item_count = 4
|
||||
selected = 0
|
||||
popup/item_0/text = "640x480"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "1024x768"
|
||||
|
@ -271,12 +277,6 @@ popup/item_2/id = 2
|
|||
popup/item_3/text = "2560x1440"
|
||||
popup/item_3/id = 3
|
||||
|
||||
[node name="Services Entity" type="Node" parent="."]
|
||||
script = ExtResource("7_sk587")
|
||||
[connection signal="tab_changed" from="Panel/ColorRect/TabBar" to="Panel/ReferenceRect/TabContainer" method="set_current_tab"]
|
||||
|
||||
[node name="IDIS Service" type="Node" parent="Services Entity"]
|
||||
script = ExtResource("8_egj5m")
|
||||
|
||||
[connection signal="tab_changed" from="UX TabView Service/ColorRect/TabBar" to="UX TabView Service/ReferenceRect/TabContainer" method="set_current_tab"]
|
||||
|
||||
[editable path="UX TabView Service/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4"]
|
||||
[editable path="Panel/ReferenceRect/TabContainer/教程/ScrollContainer/VBoxContainer/NinePatchRect4"]
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace BITKit;
|
||||
[Tool]
|
||||
public partial class CollectionTest : Node
|
||||
{
|
||||
[Export] private Array<Node> nodes;
|
||||
|
||||
[Export] private Dictionary<string, Node> Dictionary;
|
||||
|
||||
[Export] private ProgressBar progressBar;
|
||||
|
||||
[Export(PropertyHint.Range, "0,1")]
|
||||
private float progress
|
||||
{
|
||||
get => _progress;
|
||||
set
|
||||
{
|
||||
if (Engine.IsEditorHint())
|
||||
{
|
||||
RequestReady();
|
||||
}
|
||||
if (progressBar is null) return;
|
||||
_progress = value;
|
||||
var newProgress = Mathf.Lerp(progressBar.MinValue, progressBar.MaxValue, value);
|
||||
progressBar.Value = newProgress;
|
||||
}
|
||||
}
|
||||
private float _progress;
|
||||
|
||||
[Export] private Label label;
|
||||
|
||||
[Export]
|
||||
public string Text
|
||||
{
|
||||
get => label?.Text;
|
||||
set
|
||||
{
|
||||
if (label is not null)
|
||||
label.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
[Tool]
|
||||
public partial class GetNode2DThing : Sprite2D
|
||||
{
|
||||
[Export]
|
||||
private Vector2 size
|
||||
{
|
||||
get => _size;
|
||||
set=>OnSetSize(value);
|
||||
}
|
||||
|
||||
private Vector2 _size;
|
||||
|
||||
private void OnSetSize(Vector2 newSize)
|
||||
{
|
||||
_size = newSize;
|
||||
var newScale = newSize / Texture.GetSize();
|
||||
|
||||
Scale = newScale;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class ReadyDebug : Node
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
GD.Print("该节点已准备好");
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Net.WebSockets;
|
||||
|
||||
namespace BITKit;
|
||||
[Tool]
|
||||
public partial class ScriptableAnimation : Node
|
||||
{
|
||||
[Export(PropertyHint.Range,"0,1")]
|
||||
public float Value
|
||||
{
|
||||
get => _value;
|
||||
set => SetValue(value);
|
||||
}
|
||||
private float _value;
|
||||
[Export] protected bool autoPlay;
|
||||
private void SetValue(float newValue)
|
||||
{
|
||||
_value =Math.Clamp(newValue,0,1);
|
||||
OnSetValue(newValue);
|
||||
}
|
||||
protected virtual void OnSetValue(float newValue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (autoPlay)
|
||||
{
|
||||
Value = (Value + (float)delta)%1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
4.0.3.stable.mono
|
|
@ -1 +0,0 @@
|
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
4.0.3.stable.mono
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,6 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<LangVersion>11</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BITKit\BITKit.csproj" />
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Godot.NET.Sdk/4.1.1">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BITKit\BITKit.csproj" />
|
||||
<ProjectReference Include="..\IDIS_Models\IDIS_Models.csproj" />
|
||||
<ProjectReference Include="..\IDIS_Runtime\IDIS_Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
<Project Sdk="Godot.NET.Sdk/4.1.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<LangVersion>11</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BITKit\BITKit.csproj" />
|
||||
<ProjectReference Include="..\IDIS_Models\IDIS_Models.csproj" />
|
||||
<ProjectReference Include="..\IDIS_Runtime\IDIS_Runtime.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -14,6 +14,7 @@ config/name="iFactory"
|
|||
config/description="智慧工厂的映射与交互"
|
||||
run/main_scene="res://Mods/教育平台/教育平台主菜单.tscn"
|
||||
config/features=PackedStringArray("4.1", "C#", "Forward Plus")
|
||||
run/low_processor_mode=true
|
||||
boot_splash/bg_color=Color(0.00392157, 0, 0.00392157, 1)
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
|
Loading…
Reference in New Issue