Example #1
0
        public override void OnUpdate()
        {
            if (InputHelper.isKeyDown(KeyCode.F1))
            {
                uConsole.RunCommand("mc_setpickedtype");
            }

            if (InputHelper.isKeyDown(KeyCode.F2))
            {
                uConsole.RunCommand("mc_pick");
            }

            if (InputHelper.isKeyDown(KeyCode.F3))
            {
                MovableContainerManager.dropContainer();
            }
        }
Example #2
0
            static void PanelActionsRadial_ShowPlaceItemRadial_Postfix(Panel_ActionsRadial __instance)
            {
                if (!containerIconVisible)
                {
                    return;
                }

                if (__instance.m_RadialArms.FirstOrDefault(arm => arm.m_RadialInfo.m_RadialElement == Panel_ActionsRadial.RadialType.Shelter) is not RadialMenuArm arm)
                {
                    return;
                }

                Panel_ActionsRadial.RadialInfo info = new() { m_RadialElement = Panel_ActionsRadial.RadialType.Shelter };
                info.m_SpriteName      = info.m_SpriteNameHover = "icoMap_container";
                info.m_IconActiveColor = info.m_IconActiveHoverColor = shouldDisableRadialButton()? Color.gray: colorUI;

                Action action = shouldDisableRadialButton()
                                                                        ? new (() => GameUtils.showErrorMessage("Can't place container here"))
                                                                        : new (() => MovableContainerManager.dropContainer());

                arm.SetRadialInfo(info, action, false, false);
                arm.m_NameWhenHoveredOver = "place " + Localization.Get(MovableContainerManager.pickedContainerName);
            }
        }