Пример #1
0
 //Update the button displayed as appropriate
 private void OnRefreshUserMenu(object data)
 {
     if (!CanInsulate)
     {
         return;
     }
     KIconButtonMenu.ButtonInfo button;
     if (gameObject.GetComponent <PrimaryElement>().ElementID != SimHashes.SuperInsulator)
     {
         if (chore == null && fetchList == null)
         {
             button = new KIconButtonMenu.ButtonInfo("action_move_to_storage", "Insulate", OnInsulate, Action.NumActions, null, null, null, $"Add {UI.FormatAsLink("Insulation", "SUPERINSULATOR")} to the pipe.\n\nPrevents contents from transferring heat to the pipe and its surroundings.\nUses {MassToInsulate.ToString("0")}KG of solid {UI.FormatAsLink("Insulation", "SUPERINSULATOR")}.", true);
         }
         else
         {
             button = new KIconButtonMenu.ButtonInfo("action_move_to_storage", "Cancel Insulate", OnCancel, Action.NumActions, null, null, null, "Cancel this order to Insulate", true);
         }
     }
     else
     {
         if (chore == null && fetchList == null)
         {
             button = new KIconButtonMenu.ButtonInfo("action_deconstruct", "Remove Insultation", OnRemoveInsulate, Action.NumActions, null, null, null, $"Remove {UI.FormatAsLink("Insulation", "SUPERINSULATOR")} from this pipe.\nWill return Insulation that was used in this pipe.");
         }
         else
         {
             button = new KIconButtonMenu.ButtonInfo("action_deconstruct", "Cancel Deinsulation", OnCancel, Action.NumActions, null, null, null, "Cancel this order to remove Insulation", true);
         }
     }
     Game.Instance.userMenu.AddButton(gameObject, button, 2f);
 }
 private void OnRefreshUserMenu(object data)
 {
     if (showCmd)
     {
         object buttonInfo;
         if (chore == null)
         {
             string        iconName    = "action_empty_contents";
             string        text        = UI.USERMENUACTIONS.EMPTYSTORAGE.NAME;
             System.Action on_click    = DropAll;
             string        tooltipText = UI.USERMENUACTIONS.EMPTYSTORAGE.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_empty_contents";
             string        text        = UI.USERMENUACTIONS.EMPTYSTORAGE.NAME_OFF;
             System.Action on_click    = DropAll;
             string        iconName    = UI.USERMENUACTIONS.EMPTYSTORAGE.TOOLTIP_OFF;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
 private void OnRefreshUserMenu(object data)
 {
     if (IsCapturable())
     {
         object buttonInfo;
         if (!markedForCapture)
         {
             string        iconName = "action_capture";
             string        text     = UI.USERMENUACTIONS.CAPTURE.NAME;
             System.Action on_click = delegate
             {
                 MarkForCapture(true);
             };
             string tooltipText = UI.USERMENUACTIONS.CAPTURE.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_capture";
             string        text        = UI.USERMENUACTIONS.CANCELCAPTURE.NAME;
             System.Action on_click    = delegate
             {
                 MarkForCapture(false);
             };
             string iconName = UI.USERMENUACTIONS.CANCELCAPTURE.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
Пример #4
0
 public virtual void OnRefreshUserMenu(object data)
 {
     if (showUserMenuButtons)
     {
         object buttonInfo;
         if (harvestWhenReady)
         {
             string        iconName = "action_harvest";
             string        text     = UI.USERMENUACTIONS.CANCEL_HARVEST_WHEN_READY.NAME;
             System.Action on_click = delegate
             {
                 OnClickCancelHarvestWhenReady();
                 PopFXManager.Instance.SpawnFX(PopFXManager.Instance.sprite_Negative, UI.GAMEOBJECTEFFECTS.PLANT_DO_NOT_HARVEST, base.transform, 1.5f, false);
             };
             string tooltipText = UI.USERMENUACTIONS.CANCEL_HARVEST_WHEN_READY.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_harvest";
             string        text        = UI.USERMENUACTIONS.HARVEST_WHEN_READY.NAME;
             System.Action on_click    = delegate
             {
                 OnClickHarvestWhenReady();
                 PopFXManager.Instance.SpawnFX(PopFXManager.Instance.sprite_Plus, UI.GAMEOBJECTEFFECTS.PLANT_MARK_FOR_HARVEST, base.transform, 1.5f, false);
             };
             string iconName = UI.USERMENUACTIONS.HARVEST_WHEN_READY.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
Пример #5
0
    private void OnRefreshUserMenu(object data)
    {
        bool isEnabled = IsEnabled;
        bool flag      = Toggleable.IsToggleQueued(ToggleIdx);

        KIconButtonMenu.ButtonInfo buttonInfo = null;
        if ((isEnabled && !flag) || (!isEnabled && flag))
        {
            string        iconName    = "action_building_disabled";
            string        text        = UI.USERMENUACTIONS.ENABLEBUILDING.NAME;
            System.Action on_click    = OnMenuToggle;
            Action        shortcutKey = Action.ToggleEnabled;
            string        tooltipText = UI.USERMENUACTIONS.ENABLEBUILDING.TOOLTIP;
            buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, shortcutKey, null, null, null, tooltipText, true);
        }
        else
        {
            string        tooltipText = "action_building_disabled";
            string        text        = UI.USERMENUACTIONS.ENABLEBUILDING.NAME_OFF;
            System.Action on_click    = OnMenuToggle;
            Action        shortcutKey = Action.ToggleEnabled;
            string        iconName    = UI.USERMENUACTIONS.ENABLEBUILDING.TOOLTIP_OFF;
            buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, shortcutKey, null, null, null, iconName, true);
        }
        Game.Instance.userMenu.AddButton(base.gameObject, buttonInfo, 1f);
    }
Пример #6
0
 private void OnRefreshUserMenu(object data)
 {
     if (Alignment != 0 && IsAlignmentActive())
     {
         object buttonInfo;
         if (!targeted)
         {
             string        iconName = "action_attack";
             string        text     = UI.USERMENUACTIONS.ATTACK.NAME;
             System.Action on_click = delegate
             {
                 SetPlayerTargeted(true);
             };
             string tooltipText = UI.USERMENUACTIONS.ATTACK.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_attack";
             string        text        = UI.USERMENUACTIONS.CANCELATTACK.NAME;
             System.Action on_click    = delegate
             {
                 SetPlayerTargeted(false);
             };
             string iconName = UI.USERMENUACTIONS.CANCELATTACK.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
Пример #7
0
 private void OnRefreshUserMenu(object data)
 {
     KIconButtonMenu.ButtonInfo button = (!this.blocked) ?
                                         new KIconButtonMenu.ButtonInfo("action_building_disabled", Strings.Get("STRINGS.UI.USERMENUACTIONS.STAIRSBLOCK.NAME"), new System.Action(this.OnBlock), Action.NumActions, null, null, null, Strings.Get("STRINGS.UI.USERMENUACTIONS.STAIRSBLOCK.TOOLTIP"), true) :
                                         new KIconButtonMenu.ButtonInfo("action_direction_both", Strings.Get("STRINGS.UI.USERMENUACTIONS.STAIRSBLOCK.NAME_OFF"), new System.Action(this.OnResume), Action.NumActions, null, null, null, Strings.Get("STRINGS.UI.USERMENUACTIONS.STAIRSBLOCK.TOOLTIP_OFF"), true);
     Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
 }
 private void OnRefreshUserMenu(object data)
 {
     if (allowPause)
     {
         object buttonInfo;
         if (!paused)
         {
             string        iconName    = "action_move_to_storage";
             string        text        = UI.USERMENUACTIONS.MANUAL_DELIVERY.NAME;
             System.Action on_click    = OnPause;
             string        tooltipText = UI.USERMENUACTIONS.MANUAL_DELIVERY.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_move_to_storage";
             string        text        = UI.USERMENUACTIONS.MANUAL_DELIVERY.NAME_OFF;
             System.Action on_click    = OnResume;
             string        iconName    = UI.USERMENUACTIONS.MANUAL_DELIVERY.TOOLTIP_OFF;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
 private void OnRefreshUserMenu(object data)
 {
     if (!this.HasTag(GameTags.Stored))
     {
         object buttonInfo;
         if (isMarkedForDumping)
         {
             string        iconName    = "action_empty_contents";
             string        text        = UI.USERMENUACTIONS.DUMP.NAME_OFF;
             System.Action on_click    = ToggleDumping;
             string        tooltipText = UI.USERMENUACTIONS.DUMP.TOOLTIP_OFF;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_empty_contents";
             string        text        = UI.USERMENUACTIONS.DUMP.NAME;
             System.Action on_click    = ToggleDumping;
             string        iconName    = UI.USERMENUACTIONS.DUMP.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
 private void OnRefreshUserMenu(object data)
 {
     if (!this.allowPause)
     {
         return;
     }
     KIconButtonMenu.ButtonInfo arg_96_0;
     if (!this.paused)
     {
         string        text     = "action_move_to_storage";
         string        text2    = UI.USERMENUACTIONS.MANUAL_DELIVERY.NAME;
         System.Action on_click = new System.Action(this.OnPause);
         string        text3    = UI.USERMENUACTIONS.MANUAL_DELIVERY.TOOLTIP;
         arg_96_0 = new KIconButtonMenu.ButtonInfo(text, text2, on_click, global::Action.NumActions, null, null, null, text3, true);
     }
     else
     {
         string        text3    = "action_move_to_storage";
         string        text2    = UI.USERMENUACTIONS.MANUAL_DELIVERY.NAME_OFF;
         System.Action on_click = new System.Action(this.OnResume);
         string        text     = UI.USERMENUACTIONS.MANUAL_DELIVERY.TOOLTIP_OFF;
         arg_96_0 = new KIconButtonMenu.ButtonInfo(text3, text2, on_click, global::Action.NumActions, null, null, null, text, true);
     }
     KIconButtonMenu.ButtonInfo button = arg_96_0;
     Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
 }
 private void OnRefreshUserMenu(object data)
 {
     if (isClearable && !((UnityEngine.Object)GetComponent <Health>() != (UnityEngine.Object)null) && !this.HasTag(GameTags.Stored))
     {
         object buttonInfo;
         if (isMarkedForClear)
         {
             string        iconName    = "action_move_to_storage";
             string        text        = UI.USERMENUACTIONS.CLEAR.NAME_OFF;
             System.Action on_click    = OnClickCancel;
             string        tooltipText = UI.USERMENUACTIONS.CLEAR.TOOLTIP_OFF;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_move_to_storage";
             string        text        = UI.USERMENUACTIONS.CLEAR.NAME;
             System.Action on_click    = OnClickClear;
             string        iconName    = UI.USERMENUACTIONS.CLEAR.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
 private void OnRefreshUserMenu(object data)
 {
     if (allowDeconstruction)
     {
         object buttonInfo;
         if (chore == null)
         {
             string        iconName    = "action_deconstruct";
             string        text        = UI.USERMENUACTIONS.DEMOLISH.NAME;
             System.Action on_click    = OnDeconstruct;
             string        tooltipText = UI.USERMENUACTIONS.DEMOLISH.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_deconstruct";
             string        text        = UI.USERMENUACTIONS.DEMOLISH.NAME_OFF;
             System.Action on_click    = OnDeconstruct;
             string        iconName    = UI.USERMENUACTIONS.DEMOLISH.TOOLTIP_OFF;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
Пример #13
0
        /// <summary>
        /// Called when the info screen for the decor item is refreshed.
        /// </summary>
        private void OnRefreshUserMenu(object _)
        {
            var um = Game.Instance?.userMenu;

            if (artable != null && artable.CurrentStatus != Artable.Status.Ready && um != null)
            {
                string text = ButtonText, icon = ButtonIcon;
                // Set default name if not set
                if (string.IsNullOrEmpty(text))
                {
                    text = ResculptStrings.RESCULPT_BUTTON;
                }
                if (string.IsNullOrEmpty(icon))
                {
                    icon = ResculptStrings.RESCULPT_SPRITE;
                }
                var button = new KIconButtonMenu.ButtonInfo(icon, text, OnResculpt,
                                                            PAction.MaxAction, null, null, null, ResculptStrings.RESCULPT_TOOLTIP);
                um.AddButton(gameObject, button);

                if (gameObject.GetComponent <Rotatable>() != null)
                {
                    var rotationButton = new KIconButtonMenu.ButtonInfo(ResculptStrings.
                                                                        ROTATE_SPRITE, ResculptStrings.ROTATE_BUTTON, OnRotateClicked,
                                                                        Action.BuildMenuKeyO, tooltipText: ResculptStrings.ROTATE_TOOLTIP);
                    um.AddButton(gameObject, rotationButton);
                }
            }
        }
Пример #14
0
 private void OnRefreshUserMenu(object data)
 {
     if (base.smi.IsInsideState(base.smi.sm.closed) && !used)
     {
         object buttonInfo;
         if (chore != null)
         {
             string        iconName    = "action_empty_contents";
             string        text        = UI.USERMENUACTIONS.OPENPOI.NAME_OFF;
             System.Action on_click    = OnClickCancel;
             string        tooltipText = UI.USERMENUACTIONS.OPENPOI.TOOLTIP_OFF;
             buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             string        tooltipText = "action_empty_contents";
             string        text        = UI.USERMENUACTIONS.OPENPOI.NAME;
             System.Action on_click    = OnClickOpen;
             string        iconName    = UI.USERMENUACTIONS.OPENPOI.TOOLTIP;
             buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
         }
         KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
Пример #15
0
 private void OnRefreshUserMenu(object data)
 {
     if (readyToButcher)
     {
         KIconButtonMenu.ButtonInfo button = (chore == null) ? new KIconButtonMenu.ButtonInfo("action_harvest", "Meatify", OnClickButcher, Action.NumActions, null, null, null, string.Empty, true) : new KIconButtonMenu.ButtonInfo("action_harvest", "Cancel Meatify", OnClickCancel, Action.NumActions, null, null, null, string.Empty, true);
         Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
     }
 }
Пример #16
0
        // Token: 0x06000007 RID: 7 RVA: 0x00002204 File Offset: 0x00000404
        public void OnRefresh(object _)
        {
            var text        = this.AutoDrop ? "Disable Auto-Drop" : "Enable Auto-Drop";
            var tooltipText = this.AutoDrop ? "Disable automatic dropping of bottles when full" : "Enable automatic dropping of bottles when full";
            var button      = new KIconButtonMenu.ButtonInfo("action_building_disabled", text, this.OnChangeAutoDrop, Action.CinemaZoomSpeedMinus, null, null, null, tooltipText);

            Game.Instance.userMenu.AddButton(this.gameObject, button);
        }
Пример #17
0
        private void OnRefreshUserMenu(object data)
        {
            KIconButtonMenu.ButtonInfo info = null;
            string iconName = "action_building_disabled";
            string text     = "Example";

            System.Action onClick     = OnMenuToggle;
            Action        shortcutKey = Action.ToggleEnabled;
            string        tooltip     = "This is an example button";

            info = new KIconButtonMenu.ButtonInfo(iconName, text, onClick, shortcutKey, null, null, null, tooltip);
            Game.Instance.userMenu.AddButton(base.gameObject, info);
        }
Пример #18
0
    private void OnRefreshUserMenu(object data)
    {
        string iconName = "action_empty_contents";
        string text     = UI.USERMENUACTIONS.EMPTYSTORAGE.NAME;

        System.Action on_click = delegate
        {
            storage.DropAll(false, false, default(Vector3), true);
        };
        string tooltipText = UI.USERMENUACTIONS.EMPTYSTORAGE.TOOLTIP;

        KIconButtonMenu.ButtonInfo button = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
        Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
    }
Пример #19
0
        private void OnRefreshUserMenu(object data)
        {
            bool isEnabled = this.IsEnabled;

            KIconButtonMenu.ButtonInfo button;
            if (isEnabled)
            {
                button = new KIconButtonMenu.ButtonInfo("action_building_disabled", UI.USERMENUACTIONS.ENABLEBUILDING.NAME, new System.Action(this.OnMenuToggle), Action.ToggleEnabled, null, null, null, UI.USERMENUACTIONS.ENABLEBUILDING.TOOLTIP, true);
            }
            else
            {
                button = new KIconButtonMenu.ButtonInfo("action_building_disabled", UI.USERMENUACTIONS.ENABLEBUILDING.NAME_OFF, new System.Action(this.OnMenuToggle), Action.ToggleEnabled, null, null, null, UI.USERMENUACTIONS.ENABLEBUILDING.TOOLTIP_OFF, true);
            }
            Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
        }
Пример #20
0
 /// <summary>
 /// Called when the info screen for the decor item is refreshed.
 /// </summary>
 private void OnRefreshUserMenu()
 {
     if (artable != null && artable.CurrentStatus != Artable.Status.Ready)
     {
         string text = ButtonText;
         // Set default name if not set
         if (string.IsNullOrEmpty(text))
         {
             text = ResculptStrings.RESCULPT_BUTTON;
         }
         var button = new KIconButtonMenu.ButtonInfo("action_control", text, OnResculpt,
                                                     PAction.MaxAction, null, null, null, ResculptStrings.RESCULPT_TOOLTIP);
         Game.Instance?.userMenu?.AddButton(gameObject, button);
     }
 }
Пример #21
0
 private void RefreshUserMenu(object data = null)
 {
     KIconButtonMenu.ButtonInfo info;
     info = new KIconButtonMenu
            .ButtonInfo("action_repair",
                        (string)STRINGS.ZTRANSPORT.SETTINGS_BUTTON,
                        new System.Action(this.PressItBaby),
                        Action.NumActions,
                        (System.Action <GameObject>)null,
                        (System.Action <KIconButtonMenu.ButtonInfo>)null,
                        (Texture)null,
                        (string)STRINGS.ZTRANSPORT.SETTINGS_TOOLTIP,
                        true);
     Game.Instance.userMenu.AddButton(this.gameObject, info, 1000f);
 }
Пример #22
0
 // добавляем кнопки
 // мутатор - для оригинального раснения или любых семян
 // исследование - для неизвестных мутаций
 private static void OnRefreshUserMenu(MutantPlant mutant)
 {
     if (Game.Instance.SandboxModeActive && mutant != null)
     {
         if (mutant.IsOriginal || mutant.HasTag(GameTags.Seed) || mutant.HasTag(GameTags.CropSeed))
         {
             var binfo = new KIconButtonMenu.ButtonInfo("action_select_research", MUTATOR.NAME, new System.Action(mutant.Mutator), Action.NumActions, null, null, null, MUTATOR.TOOLTIP, true);
             Game.Instance.userMenu.AddButton(mutant.gameObject, binfo, 1f);
         }
         if (!mutant.IsOriginal && !mutant.IsIdentified)
         {
             var binfo = new KIconButtonMenu.ButtonInfo("action_select_research", IDENTIFY_MUTATION.NAME, new System.Action(mutant.IdentifyMutation), Action.NumActions, null, null, null, IDENTIFY_MUTATION.TOOLTIP, true);
             Game.Instance.userMenu.AddButton(mutant.gameObject, binfo, 1f);
         }
     }
 }
Пример #23
0
        public void OnUserMenuRefresh(object obj)
        {
            string text    = crackable.maxCracked ? "Cracking Complete" : (crackable.markedForCracking ? "Cancel Cracking" : "Start Cracking");
            string tooltip = crackable.maxCracked ? "This geyser cannot be improved further." : (crackable.markedForCracking ? "Cancel the existing job for improving this geyser." : "Start improving this geyser.");

            KIconButtonMenu.ButtonInfo info = new KIconButtonMenu.ButtonInfo(
                crackable.maxCracked ? "action_building_disabled" : "action_repair",
                text,
                OnToggleUserMenu,
                Action.NumActions,
                null,
                null,
                null,
                tooltip
                );
            Game.Instance.userMenu.AddButton(crackable.geyser.gameObject, info);
            Debug.Log($"[Geyser Cracking] Adding button: {text}");
        }
Пример #24
0
        public void OnRefresh(object _)
        {
            string buttonTitle   = TrashcansStrings.UserMenuButtonTitle;
            string buttonTooltip = TrashcansStrings.UserMenuButtonTooltip;

            KIconButtonMenu.ButtonInfo buttonInfo = new KIconButtonMenu.ButtonInfo(
                "action_building_disabled",
                buttonTitle,
                DropItems,
                Action.NumActions,
                null,
                null,
                null,
                buttonTooltip
                );

            Game.Instance.userMenu.AddButton(gameObject, buttonInfo);
        }
Пример #25
0
 private void OnRefreshUserMenu(object data)
 {
     KIconButtonMenu.ButtonInfo buttonInfo = null;
     if (!isMarkedForCompost)
     {
         string        iconName    = "action_compost";
         string        text        = UI.USERMENUACTIONS.COMPOST.NAME;
         System.Action on_click    = OnToggleCompost;
         string        tooltipText = UI.USERMENUACTIONS.COMPOST.TOOLTIP;
         buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
     }
     else
     {
         string        tooltipText = "action_compost";
         string        text        = UI.USERMENUACTIONS.COMPOST.NAME_OFF;
         System.Action on_click    = OnToggleCompost;
         string        iconName    = UI.USERMENUACTIONS.COMPOST.TOOLTIP_OFF;
         buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
     }
     Game.Instance.userMenu.AddButton(base.gameObject, buttonInfo, 1f);
 }
 private void OnRefreshUserMenu(object data)
 {
     KIconButtonMenu.ButtonInfo buttonInfo = null;
     if (!enableAutoDisinfect)
     {
         string        iconName    = "action_disinfect";
         string        text        = STRINGS.BUILDINGS.AUTODISINFECTABLE.ENABLE_AUTODISINFECT.NAME;
         System.Action on_click    = EnableAutoDisinfect;
         string        tooltipText = STRINGS.BUILDINGS.AUTODISINFECTABLE.ENABLE_AUTODISINFECT.TOOLTIP;
         buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
     }
     else
     {
         string        tooltipText = "action_disinfect";
         string        text        = STRINGS.BUILDINGS.AUTODISINFECTABLE.DISABLE_AUTODISINFECT.NAME;
         System.Action on_click    = DisableAutoDisinfect;
         string        iconName    = STRINGS.BUILDINGS.AUTODISINFECTABLE.DISABLE_AUTODISINFECT.TOOLTIP;
         buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
     }
     Game.Instance.userMenu.AddButton(base.gameObject, buttonInfo, 10f);
 }
        public void OnRefresh(object _)
        {
            // If we are currently showing, display hide strings
            var showContentsStr = showContents ? STRINGS.UI.SHOWHIDE_CONTENTS.HIDE : STRINGS.UI.SHOWHIDE_CONTENTS.SHOW;

            var showContentsTooltip = showContents
                                                          ? STRINGS.UI.SHOWHIDE_CONTENTS.HIDE_TOOLTIP
                                                          : STRINGS.UI.SHOWHIDE_CONTENTS.SHOW_TOOLTIP;

            var buttonInfo = new KIconButtonMenu.ButtonInfo(
                "action_building_disabled",
                showContentsStr,
                OnChangeShowContents,
                Action.NumActions,
                null,
                null,
                null,
                showContentsTooltip
                );

            Game.Instance.userMenu.AddButton(gameObject, buttonInfo);
        }
Пример #28
0
        private void OnRefreshUserMenu(object obj)
        {
            if (!((UnityEngine.Object) this.artable != (UnityEngine.Object)null) || this.artable.CurrentStatus == Artable.Status.Ready)
            {
                return;
            }
            string nextIcon   = "action_direction_right";
            string rotateIcon = "action_direction_both";

            Artable.Status status = artable.stages.Find(s => s.id == artable.CurrentStage).statusItem;
            int            count  = artable.stages.Where(s => s.statusItem == status).ToList().Count;

            if (count > 1)
            {
                Game.Instance?.userMenu?.AddButton(this.gameObject, new KIconButtonMenu.ButtonInfo(nextIcon, STRINGS.NEXT_ART_BUTTON.TEXT, new System.Action(this.OnNextArtClicked), Action.BuildMenuKeyQ, tooltipText: ((string)STRINGS.NEXT_ART_BUTTON.TOOLTIP)));
            }
            if (this.gameObject.GetComponent <Rotatable>() != null)
            {
                var rotationButton = new KIconButtonMenu.ButtonInfo(rotateIcon, STRINGS.ROTATE_ART_BUTTON.TEXT, new System.Action(this.OnRotateClicked), Action.BuildMenuKeyO, tooltipText: ((string)STRINGS.ROTATE_ART_BUTTON.TOOLTIP));
                Game.Instance?.userMenu?.AddButton(this.gameObject, rotationButton);
            }
        }
Пример #29
0
        //Update the button displayed as appropriate
        private void OnRefreshUserMenu(object data)
        {
            KIconButtonMenu.ButtonInfo button;
            string icon = "action_move_to_storage";
            string text;
            string tooltip;

            //If it is already marked for toggling, then the button should display a cancel option!
            if (!isMarkedForToggle)
            {
                if (!bufferMode)
                {
                    text    = "Set Buffer";
                    tooltip = "Change the valve mode to buffer. Buffer mode will hold flow until a full packet can be sent of at least the size specified by flow limit.\nCATUION: Valve only stores one element at a time, will dump conflicting elements and become damaged in mixed element environments.";
                }
                else
                {
                    text    = "Set Limit";
                    tooltip = "Change the valve mode to limit. Limit mode will behave as a standard valve, limitting the maximum flow.";
                }
            }
            else
            {
                if (!bufferMode)
                {
                    text    = "Cancel Set Buffer";
                    tooltip = "Cancel the task to set this valve to Buffer mode";
                }
                else
                {
                    text    = "Cancel Set Limit";
                    tooltip = "Cancel the task to set this valve to Limit mode";
                }
            }

            button = new KIconButtonMenu.ButtonInfo(icon, text, OnToggle, Action.NumActions, null, null, null, tooltip, true);
            Game.Instance.userMenu.AddButton(gameObject, button, 2f);
        }
    private void OnRefreshUserMenu(object data)
    {
        object buttonInfo;

        if (allowManualPumpingStationFetching)
        {
            string        iconName    = "action_bottler_delivery";
            string        text        = UI.USERMENUACTIONS.MANUAL_PUMP_DELIVERY.DENIED.NAME;
            System.Action on_click    = OnChangeAllowManualPumpingStationFetching;
            string        tooltipText = UI.USERMENUACTIONS.MANUAL_PUMP_DELIVERY.DENIED.TOOLTIP;
            buttonInfo = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
        }
        else
        {
            string        tooltipText = "action_bottler_delivery";
            string        text        = UI.USERMENUACTIONS.MANUAL_PUMP_DELIVERY.ALLOWED.NAME;
            System.Action on_click    = OnChangeAllowManualPumpingStationFetching;
            string        iconName    = UI.USERMENUACTIONS.MANUAL_PUMP_DELIVERY.ALLOWED.TOOLTIP;
            buttonInfo = new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true);
        }
        KIconButtonMenu.ButtonInfo button = (KIconButtonMenu.ButtonInfo)buttonInfo;
        Game.Instance.userMenu.AddButton(base.gameObject, button, 1f);
    }