mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
30 lines
765 B
C#
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);
|
|
}
|
|
|
|
}
|
|
}
|