Beispiel #1
0
        /// <summary>
        /// Removes an item from the <see cref="E:TextHandlerMenu"/>
        /// </summary>
        /// <param name="item">The <see cref="ObjectText"/>'s component to be removed</param>
        public static void RemoveItem(ObjectTextEntry item)
        {
            // Menu.Remove($"text_{item.Id}"); TODO

            Entries.RemoveAt(Entries.FindIndex(i => i.Id == item.Id));
        }
Beispiel #2
0
        /// <summary>
        /// Adds an item to the <see cref="E:TextHandlerMenu"/>
        /// </summary>
        /// <param name="item">The <see cref="ObjectText"/>'s component to be added</param>
        public static void AddItem(ObjectTextEntry item)
        {
            Menu.Add($"text_{item.Id}", new MenuItem($"Enable \"{item.MenuText}\"", item.OnByDefault));

            Entries.Add(item);
        }