Example #1
0
        public static CharacterIcon Create(CharacterEntity character)
        {
            CharacterIcon icon = (CharacterIcon)template.Instance();

            icon.SetCharacter(character);
            return(icon);
        }
 public void Link()
 {
     if (linked)
     {
         return;
     }
     character = GetNode <Visual.Icons.CharacterIcon>("CharacterButton/Icon");
     popup     = GetNode <UI.CharacterSelectorPopup>("CharacterSelectorPopup");
     GetNode <Button>("CharacterButton").Connect("pressed", popup, "popup");
     popup.Connect(nameof(UI.CharacterSelectorPopup.selected), this, nameof(on_Selected));
     popup.Connect("about_to_show", this, nameof(on_Open));
     linked = true;
 }