TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SetupList()

override void Terraria.ModLoader.Config.UI.DictionaryElement.SetupList ( )
inlineprotected

Definition at line 74 of file DictionaryElement.cs.

75 {
76 base.DataList.Clear();
77 int top = 0;
80 if (base.Data == null)
81 {
82 return;
83 }
84 ICollection keys = ((IDictionary)base.Data).Keys;
85 ICollection values = ((IDictionary)base.Data).Values;
86 IEnumerator keysEnumerator = keys.GetEnumerator();
87 IEnumerator valuesEnumerator = values.GetEnumerator();
88 int i = 0;
89 while (keysEnumerator.MoveNext())
90 {
91 valuesEnumerator.MoveNext();
92 IDictionaryElementWrapper proxy = (IDictionaryElementWrapper)Activator.CreateInstance(genericType, keysEnumerator.Current, valuesEnumerator.Current, (IDictionary)base.Data);
94 _ = base.MemberInfo.Type.GetGenericArguments()[0];
95 PropertyFieldWrapper wrappermemberInfo = ConfigManager.GetFieldsAndProperties(this).ToList()[0];
96 Tuple<UIElement, UIElement> tuple = UIModConfig.WrapIt(base.DataList, ref top, wrappermemberInfo, this, 0, dataWrapperList, genericType, i);
99 UIModConfigHoverImage deleteButton = new UIModConfigHoverImage(base.DeleteTexture, Language.GetTextValue("tModLoader.ModConfigRemove"))
100 {
101 VAlign = 0.5f
102 };
103 object o = keysEnumerator.Current;
105 {
106 ((IDictionary)base.Data).Remove(o);
107 SetupList();
108 Interface.modConfig.SetPendingChanges();
109 };
110 tuple.Item1.Append(deleteButton);
111 i++;
112 }
113 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
List< IDictionaryElementWrapper > dataWrapperList
static UIModConfig modConfig
Definition Interface.cs:83

References Terraria.ModLoader.Config.UI.DictionaryElement.dataWrapperList, Terraria.ModLoader.Config.UI.CollectionElement.deleteButton, Terraria.ModLoader.Config.ConfigManager.GetFieldsAndProperties(), Terraria.Localization.Language.GetTextValue(), Terraria.ModLoader.Config.UI.DictionaryElement.keyType, Terraria.ModLoader.Config.UI.ConfigElement< T >.List, Terraria.ModLoader.UI.Interface.modConfig, Terraria.ModLoader.Config.UI.DictionaryElement.SetupList(), Terraria.UI.UIElement.VAlign, Terraria.ModLoader.Config.UI.DictionaryElement.valueType, and Terraria.ModLoader.Config.UI.UIModConfig.WrapIt().

Referenced by Terraria.ModLoader.Config.UI.DictionaryElement.SetupList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: