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

◆ MakeSeparateListPanel()

static UIPanel Terraria.ModLoader.Config.UI.UIModConfig.MakeSeparateListPanel ( object item,
object subitem,
PropertyFieldWrapper memberInfo,
IList array,
int index,
Func< string > AbridgedTextDisplayFunction )
inlinestaticpackage

Definition at line 665 of file UIModConfig.cs.

666 {
667 //IL_002c: Unknown result type (might be due to invalid IL or missing references)
668 //IL_0031: Unknown result type (might be due to invalid IL or missing references)
669 //IL_0049: Unknown result type (might be due to invalid IL or missing references)
670 //IL_004e: Unknown result type (might be due to invalid IL or missing references)
671 //IL_0213: Unknown result type (might be due to invalid IL or missing references)
672 //IL_0219: Unknown result type (might be due to invalid IL or missing references)
673 //IL_021d: Unknown result type (might be due to invalid IL or missing references)
674 //IL_0223: Unknown result type (might be due to invalid IL or missing references)
675 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
676 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
677 //IL_0231: Unknown result type (might be due to invalid IL or missing references)
678 //IL_0237: Unknown result type (might be due to invalid IL or missing references)
679 UIPanel uIPanel = new UIPanel();
681 uIPanel.BackgroundColor = UICommon.MainPanelBackground;
682 BackgroundColorAttribute bca = ConfigManager.GetCustomAttributeFromMemberThenMemberType<BackgroundColorAttribute>(memberInfo, subitem, null);
683 if (bca != null)
684 {
685 uIPanel.BackgroundColor = bca.Color;
686 }
687 UIList separateList = new UIList();
688 separateList.CopyStyle(Interface.modConfig.mainConfigList);
689 separateList.Height.Set(-40f, 1f);
690 separateList.Top.Set(40f, 0f);
692 int top = 0;
694 uIScrollbar.SetView(100f, 1000f);
695 uIScrollbar.Height.Set(-40f, 1f);
696 uIScrollbar.Top.Set(40f, 0f);
697 uIScrollbar.HAlign = 1f;
699 separateList.SetScrollbar(uIScrollbar);
700 string name = ConfigManager.GetLocalizedLabel(memberInfo);
701 if (index != -1)
702 {
703 name = name + " #" + (index + 1);
704 }
705 Interface.modConfig.subPageStack.Push(name);
706 name = string.Join(" > ", Interface.modConfig.subPageStack.Reverse());
708 heading.HAlign = 0f;
709 heading.Top.Set(-6f, 0f);
710 heading.Height.Set(40f, 0f);
712 UITextPanel<string> back = new UITextPanel<string>(Language.GetTextValue("tModLoader.ModConfigBack"))
713 {
714 HAlign = 1f
715 };
716 back.Width.Set(50f, 0f);
717 back.Top.Set(-6f, 0f);
718 back.OnLeftClick += delegate
719 {
720 Interface.modConfig.uIElement.RemoveChild(uIPanel);
721 Interface.modConfig.configPanelStack.Pop();
722 Interface.modConfig.uIElement.Append(Interface.modConfig.configPanelStack.Peek());
723 };
724 back.WithFadedMouseOver();
725 uIPanel.Append(back);
726 int order = 0;
727 if (array != null)
728 {
729 _ = memberInfo.Type.GetGenericArguments()[0].GetMethod("ToString", new Type[0]).DeclaringType != typeof(object);
730 }
731 else
732 {
733 _ = memberInfo.Type.GetMethod("ToString", new Type[0]).DeclaringType != typeof(object);
734 }
735 if (AbridgedTextDisplayFunction != null)
736 {
737 UITextPanel<FuncStringWrapper> display = new UITextPanel<FuncStringWrapper>(new FuncStringWrapper(AbridgedTextDisplayFunction))
738 {
739 DrawPanel = true
740 };
741 display.Recalculate();
743 container.Height.Pixels = (int)display.GetOuterDimensions().Height;
745 }
746 foreach (PropertyFieldWrapper variable in ConfigManager.GetFieldsAndProperties(subitem))
747 {
748 if (!Attribute.IsDefined(variable.MemberInfo, typeof(JsonIgnoreAttribute)) || Attribute.IsDefined(variable.MemberInfo, typeof(ShowDespiteJsonIgnoreAttribute)))
749 {
751 WrapIt(separateList, ref top, variable, subitem, order++);
752 }
753 }
754 Interface.modConfig.subPageStack.Pop();
755 return uIPanel;
756 }
void SetView(float viewSize, float maxViewSize)
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
static UIElement GetContainer(UIElement containee, int sortid)
static void HandleHeader(UIElement parent, ref int top, ref int order, PropertyFieldWrapper variable)
static Tuple< UIElement, UIElement > WrapIt(UIElement parent, ref int top, PropertyFieldWrapper memberInfo, object item, int order, object list=null, Type arrayType=null, int index=-1)
static UIModConfig modConfig
Definition Interface.cs:83
static Color MainPanelBackground
Definition UICommon.cs:24
StyleDimension Height
Definition UIElement.cs:29
void Append(UIElement element)
Definition UIElement.cs:194
void CopyStyle(UIElement element)
Definition UIElement.cs:470
StyleDimension Top
Definition UIElement.cs:23
void Set(float pixels, float precent)

References Terraria.UI.UIElement.Append(), Terraria.UI.UIElement.CopyStyle(), Terraria.ModLoader.Config.UI.UIModConfig.GetContainer(), Terraria.ModLoader.Config.ConfigManager.GetFieldsAndProperties(), Terraria.ModLoader.Config.ConfigManager.GetLocalizedLabel(), Terraria.Localization.Language.GetTextValue(), Terraria.UI.UIElement.HAlign, Terraria.ModLoader.Config.UI.UIModConfig.HandleHeader(), Terraria.UI.UIElement.Height, Terraria.ModLoader.UI.UICommon.MainPanelBackground, Terraria.ModLoader.UI.Interface.modConfig, Terraria.UI.StyleDimension.Set(), Terraria.GameContent.UI.Elements.UIScrollbar.SetView(), Terraria.UI.UIElement.Top, Terraria.ModLoader.Config.UI.PropertyFieldWrapper.Type, Terraria.ModLoader.Config.UI.UIModConfig.uIPanel, Terraria.ModLoader.Config.UI.UIModConfig.uIScrollbar, and Terraria.ModLoader.Config.UI.UIModConfig.WrapIt().

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

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