breakpoint
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BITKit;
|
||||
|
||||
namespace BITFactory;
|
||||
@@ -13,6 +14,7 @@ public partial class IDIS_RegisterService : Node
|
||||
[Export] private Control container;
|
||||
[Export] private Button registerButton;
|
||||
[Export] private Label hints;
|
||||
private readonly Dictionary<int,KeyValuePair<string,string>> _currentValues = new();
|
||||
public override void _Ready()
|
||||
{
|
||||
templateList.Clear();
|
||||
@@ -45,16 +47,28 @@ public partial class IDIS_RegisterService : Node
|
||||
|
||||
container.AddChild(grid);
|
||||
|
||||
_currentValues.Clear();
|
||||
|
||||
var _dirIndex = 0;
|
||||
foreach (var x in template.Formats)
|
||||
{
|
||||
var label = new Label();
|
||||
var lineEdit = new LineEdit();
|
||||
|
||||
var myIndex = _dirIndex++;
|
||||
|
||||
label.Text = x.format;
|
||||
|
||||
lineEdit.PlaceholderText = x.hint;
|
||||
lineEdit.SizeFlagsHorizontal = Control.SizeFlags.ExpandFill;
|
||||
|
||||
_currentValues.Add(myIndex,new KeyValuePair<string, string>(x.format,x.hint));
|
||||
|
||||
lineEdit.TextChanged += (s) =>
|
||||
{
|
||||
_currentValues[myIndex] = new KeyValuePair<string, string>(x.format, s);
|
||||
};
|
||||
|
||||
grid.AddChild(label);
|
||||
grid.AddChild(lineEdit);
|
||||
}
|
||||
@@ -62,6 +76,13 @@ public partial class IDIS_RegisterService : Node
|
||||
|
||||
private void Register()
|
||||
{
|
||||
|
||||
var handle = handleEdit.Text;
|
||||
var json = JsonHelper.Get(_currentValues);
|
||||
BIT4Log.Log<IDIS_RegisterService>($"注册标识:{handle}");
|
||||
BIT4Log.Log<IDIS_RegisterService>($"\n{json}");
|
||||
foreach (var x in _currentValues)
|
||||
{
|
||||
service.Register(handle, x.Value.Key, x.Value.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user