Пример #1
0
 public ModToggleInput(TwoButtonToggleElement toggle, IModMenu menu) : base(toggle, menu)
 {
     Toggle             = toggle;
     YesButton          = new ModTitleButton(Toggle.GetValue <Button>("_buttonTrue"), menu);
     YesButton.OnClick += () => InvokeOnChange(true);
     NoButton           = new ModTitleButton(Toggle.GetValue <Button>("_buttonFalse"), menu);
     NoButton.OnClick  += () => InvokeOnChange(false);
 }
Пример #2
0
            private static void HandleTwoButtonToggleClick(TwoButtonToggleElement twoButtonToggle)
            {
                var selection = twoButtonToggle.GetValue();

                twoButtonToggle.SetValue("_selection", !selection);
                twoButtonToggle.Invoke("UpdateToggleColors");
            }
Пример #3
0
        protected ModPopupInput(TwoButtonToggleElement toggle, IModMenu menu) : base(toggle, menu)
        {
            ToggleElement = toggle;

            var noButton = ToggleElement.GetValue <Button>("_buttonFalse");

            noButton.transform.parent.gameObject.SetActive(false);

            var buttonParent = toggle.GetValue <Button>("_buttonTrue").transform.parent;
            var layoutGroup  = buttonParent.parent.GetComponent <HorizontalLayoutGroup>();

            layoutGroup.childControlWidth     = true;
            layoutGroup.childForceExpandWidth = true;

            buttonParent.GetComponent <LayoutElement>().preferredWidth = 100;

            SetupCommands();
        }
Пример #4
0
        protected ModInputField(TwoButtonToggleElement toggle, IModMenu menu, IModInputMenu inputMenu) : base(toggle, menu)
        {
            ToggleElement = toggle;
            InputMenu     = inputMenu;

            Button          = new ModButton(toggle.GetValue <Button>("_buttonTrue"), menu);
            Button.OnClick += Open;

            var noButton = ToggleElement.GetValue <Button>("_buttonFalse");

            noButton.transform.parent.gameObject.SetActive(false);

            var buttonParent = Button.Button.transform.parent;
            var layoutGroup  = buttonParent.parent.GetComponent <HorizontalLayoutGroup>();

            layoutGroup.childControlWidth     = true;
            layoutGroup.childForceExpandWidth = true;

            buttonParent.GetComponent <LayoutElement>().preferredWidth = 100;
        }
Пример #5
0
 protected ModFieldInput(TwoButtonToggleElement toggle, IModMenu menu, IModInputMenu inputMenu) : base(toggle, menu)
 {
     Button = new ModTitleButton(toggle.GetValue <Button>("_buttonTrue"), menu);
     Subscribe(Button);
     InputMenu = inputMenu;
 }