예제 #1
0
 private void OnRefreshUserMenu(object data)
 {
     if ((UnityEngine.Object)base.gameObject != (UnityEngine.Object)null && smi != null)
     {
         StateMachine.BaseState currentState = smi.GetCurrentState();
         if (currentState == smi.sm.forbidden)
         {
             UserMenu      userMenu    = Game.Instance.userMenu;
             GameObject    gameObject  = base.gameObject;
             string        iconName    = "action_repair";
             string        text        = STRINGS.BUILDINGS.REPAIRABLE.ENABLE_AUTOREPAIR.NAME;
             System.Action on_click    = AllowRepair;
             string        tooltipText = STRINGS.BUILDINGS.REPAIRABLE.ENABLE_AUTOREPAIR.TOOLTIP;
             userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true), 1f);
         }
         else
         {
             UserMenu      userMenu2   = Game.Instance.userMenu;
             GameObject    gameObject2 = base.gameObject;
             string        tooltipText = "action_repair";
             string        text        = STRINGS.BUILDINGS.REPAIRABLE.DISABLE_AUTOREPAIR.NAME;
             System.Action on_click    = CancelRepair;
             string        iconName    = STRINGS.BUILDINGS.REPAIRABLE.DISABLE_AUTOREPAIR.TOOLTIP;
             userMenu2.AddButton(gameObject2, new KIconButtonMenu.ButtonInfo(tooltipText, text, on_click, Action.NumActions, null, null, null, iconName, true), 1f);
         }
     }
 }
예제 #2
0
    private void RefreshUserMenu(object data = null)
    {
        UserMenu   userMenu   = Game.Instance.userMenu;
        GameObject gameObject = base.gameObject;
        string     iconName   = "action_follow_cam";
        string     text       = UI.USERMENUACTIONS.READLORE.NAME;

        System.Action on_click    = OnClickRead;
        string        tooltipText = UI.USERMENUACTIONS.READLORE.TOOLTIP;

        userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true), 1f);
    }
        private void OnRefreshUserMenu(object data)
        {
            UserMenu   userMenu   = Game.Instance.userMenu;
            GameObject gameObject = base.gameObject;
            string     iconName   = "action_control";
            string     text       = UI.USERMENUACTIONS.MOVETOLOCATION.NAME;

            System.Action on_click    = OnClickMoveToLocation;
            string        tooltipText = UI.USERMENUACTIONS.MOVETOLOCATION.TOOLTIP;

            userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, global::Action.NumActions, null, null, null, tooltipText, true), 0.2f);
        }
    private void OnRefreshUserMenu(object data)
    {
        UserMenu   userMenu   = Game.Instance.userMenu;
        GameObject gameObject = base.gameObject;
        string     iconName   = "icon_cancel";
        string     text       = UI.USERMENUACTIONS.CANCELMOP.NAME;

        System.Action on_click    = OnCancel;
        string        tooltipText = UI.USERMENUACTIONS.CANCELMOP.TOOLTIP;

        userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true), 1f);
    }
    private void OnRefreshUserMenu(object data)
    {
        UserMenu   userMenu   = Game.Instance.userMenu;
        GameObject gameObject = base.gameObject;
        string     iconName   = "action_mirror";
        string     text       = UI.USERMENUACTIONS.COPY_BUILDING_SETTINGS.NAME;

        System.Action on_click    = ActivateCopyTool;
        Action        shortcutKey = Action.BuildingUtility1;
        string        tooltipText = UI.USERMENUACTIONS.COPY_BUILDING_SETTINGS.TOOLTIP;

        userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, shortcutKey, null, null, null, tooltipText, true), 1f);
    }
예제 #6
0
    private void OnRefreshUserMenu(object data)
    {
        int           num           = (int)(1 + allowedDirection) % directionInfos.Length;
        DirectionInfo directionInfo = directionInfos[num];
        UserMenu      userMenu      = Game.Instance.userMenu;
        GameObject    gameObject    = base.gameObject;
        string        iconName      = directionInfo.iconName;
        string        name          = directionInfo.name;

        System.Action on_click = OnChangeWorkableDirection;
        string        tooltip  = directionInfo.tooltip;

        userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, name, on_click, Action.NumActions, null, null, null, tooltip, true), 0f);
    }
 private void OnRefreshUserMenu(object data)
 {
     if (base.smi.GetCurrentState() != base.smi.sm.full && base.smi.HasSalt && base.smi.emptyChore == null)
     {
         UserMenu      userMenu   = Game.Instance.userMenu;
         GameObject    gameObject = base.gameObject;
         string        iconName   = "status_item_desalinator_needs_emptying";
         string        text       = UI.USERMENUACTIONS.EMPTYDESALINATOR.NAME;
         System.Action on_click   = delegate
         {
             base.smi.GoTo(base.smi.sm.earlyEmpty);
         };
         string tooltipText = UI.USERMENUACTIONS.CLEANTOILET.TOOLTIP;
         userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true), 1f);
     }
 }
 private void OnRefreshUserMenu(object data)
 {
     if (!base.gameObject.HasTag(GameTags.Dead))
     {
         object        buttonInfo;
         string        iconName;
         string        text;
         System.Action on_click;
         string        tooltipText;
         if ((UnityEngine.Object)NavPathDrawer.Instance.GetNavigator() != (UnityEngine.Object) this)
         {
             iconName    = "action_navigable_regions";
             text        = UI.USERMENUACTIONS.DRAWPATHS.NAME;
             on_click    = OnDrawPaths;
             tooltipText = UI.USERMENUACTIONS.DRAWPATHS.TOOLTIP;
             buttonInfo  = new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true);
         }
         else
         {
             tooltipText = "action_navigable_regions";
             text        = UI.USERMENUACTIONS.DRAWPATHS.NAME_OFF;
             on_click    = OnDrawPaths;
             iconName    = UI.USERMENUACTIONS.DRAWPATHS.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, 0.1f);
         UserMenu   userMenu   = Game.Instance.userMenu;
         GameObject gameObject = base.gameObject;
         iconName    = "action_follow_cam";
         text        = UI.USERMENUACTIONS.FOLLOWCAM.NAME;
         on_click    = OnFollowCam;
         tooltipText = UI.USERMENUACTIONS.FOLLOWCAM.TOOLTIP;
         userMenu.AddButton(gameObject, new KIconButtonMenu.ButtonInfo(iconName, text, on_click, Action.NumActions, null, null, null, tooltipText, true), 0.3f);
     }
 }