Split project

This commit is contained in:
h z
2024-06-29 06:35:23 +08:00
parent b26404abd2
commit 117835b503
45 changed files with 1972 additions and 26 deletions

View File

@@ -0,0 +1,45 @@
using Enigmos.Modules.Extensions;
using Godot;
using Nocturnis.Communicators;
using Nocturnis.Enigmos.ModuleManuals;
using Nocturnis.Enigmos.Modules;
namespace Enigmos.Manual;
public partial class CommunicatorPairTab : Panel, IModuleManualTab
{
private bool InitFlag { get; set; }
public string FullName() => "Pair";
public void Init(ICommunicateModule module)
{
Module = module;
InitFlag = true;
}
public ICommunicateModule Module { get; set; }
private OptionButton CommunicatorOptions { get; set; }
public override void _Ready()
{
if (!InitFlag)
throw new Exception("TODO - NEED INIT FIRST");
CommunicatorOptions = GetNode<OptionButton>("CommunicatorOptions");
IBaseCommunicator[] options = Module.CompatibleCommunicators();
for(int idx = 0; idx < options.Length; idx ++ )
{
CommunicatorOptions.AddIconItem
(
options[idx].IconTexture,
$"{options[idx].CustomName} " + (options[idx].Paired ? "(Already Paired)" : ""),
idx
);
}
Name = "Pair";
base._Ready();
}
private void SelectHandler(int idx)
{
Module.Pair(Module.CompatibleCommunicators()[idx]);
}
}