Beispiel #1
0
        private void Awake()
        {
            parent = GetComponentInParent <UIComponent>();
            var group15 = new UIHelperExtension(parent.GetComponentInChildren <UIScrollablePanel>());

            ((UIScrollablePanel)group15.Self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIScrollablePanel)group15.Self).wrapLayout          = true;
            ((UIScrollablePanel)group15.Self).width = 730;

            group15.AddLabel(Locale.Get("K45_TLM_AUTO_NAME_SETTINGS_PUBLIC_AREAS"));
            group15.AddSpace(1);
            group15.AddLabel(Locale.Get("K45_TLM_AUTO_NAME_SETTINGS_PUBLIC_TRANSPORT_DESC"));
            group15.AddSpace(15);

            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.extraAutoNameCategories)
            {
                UICheckBox checkbox       = TLMConfigOptions.instance.generateCheckboxConfig(group15, TLMConfigWarehouse.GetNameForServiceType(ci), TLMConfigWarehouse.ConfigIndex.USE_FOR_AUTO_NAMING_REF | ci, 200);
                UIPanel    textFieldPanel = TLMConfigOptions.instance.generateTextFieldConfig(group15, Locale.Get("K45_TLM_PREFIX_OPTIONAL"), TLMConfigWarehouse.ConfigIndex.AUTO_NAMING_REF_TEXT | ci).GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                UILabel title = textFieldPanel.GetComponentInChildren <UILabel>();
                title.textAlignment = UIHorizontalAlignment.Center;
                KlyteMonoUtils.LimitWidthAndBox(title, 220, true);
                textFieldPanel.AttachUIComponent(checkbox.gameObject);
                checkbox.eventVisibilityChanged += (x, y) =>
                {
                    if (x)
                    {
                        checkbox.zOrder = 0;
                    }
                };
                group15.AddSpace(2);
            }
        }