cirnogodot/Scripts/UI/KeyRemapping.cs

30 lines
765 B
C#
Raw Normal View History

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