cirnogodot/Scripts/UI/KeyRemapping.cs
2025-03-26 18:47:17 +01:00

30 lines
765 B
C#

using Godot;
using System;
using Cirno.Scripts.UI;
using Godot.Collections;
public partial class KeyRemapping : Container
{
[Export] public Dictionary<StringName, StringName> KeysDict { get; private set; } = new();
[Export] public Container KeysContainer { get; private set; }
[Export] public PackedScene ItemPrefab { get; private set; }
public override void _Ready()
{
//var remap = GetNode("/root/Remap");
//InputEvent.
foreach (var element in KeysDict)
{
var item = ItemPrefab.Instantiate<KeyRemappingItem>();
item.KeyId = element.Key;
item.KeyName = element.Value;
KeysContainer.AddChild(item);
}
}
}