private static void Postfix(Panel_CustomXPSetup __instance, ref int index)
            {
                GameObject setting = __instance.m_CustomXPMenuItemOrder[index];

                if (setting == null)
                {
                    return;
                }

                DescriptionHolder description = setting.GetComponent <DescriptionHolder>();

                if (description != null)
                {
                    __instance.m_TooltipLabel.text = description.Text;
                }
            }
Пример #2
0
        private GameObject CreateSetting(NameAttribute name, DescriptionAttribute description, GameObject prefab, string labelName)
        {
            GameObject setting = NGUITools.AddChild(uiGrid.gameObject, prefab);

            setting.name = "Custom Setting (" + name.Name + ")";

            Transform labelTransform = setting.transform.Find(labelName);

            SetLabelText(labelTransform, name.Name, name.Localize);

            DescriptionHolder descriptionHolder = setting.AddComponent <DescriptionHolder>();

            descriptionHolder.SetDescription(description?.Description ?? string.Empty, description?.Localize ?? false);

            menuItems.Add(setting);
            return(setting);
        }
Пример #3
0
        private void UpdateDescriptionLabel()
        {
            GameObject        setting     = currentTab.menuItems[selectedIndex];
            DescriptionHolder description = setting.GetComponent <DescriptionHolder>();

            if (description == null)
            {
                return;
            }

            UILabel descriptionLabel = InterfaceManager.m_Panel_OptionsMenu.m_OptionDescriptionLabel;

            descriptionLabel.text                    = description.Text;
            descriptionLabel.transform.parent        = setting.transform;
            descriptionLabel.transform.localPosition = new Vector3(655, 0);
            descriptionLabel.gameObject.SetActive(true);
        }