public override bool AllowedInToolbarType(MyToolbarType type)
        {
            if (VRage.Input.MyInput.Static.ENABLE_DEVELOPER_KEYS || !MySession.Static.SurvivalMode || (MyMultiplayer.Static != null && MyMultiplayer.Static.IsAdmin(MySession.LocalHumanPlayer.Id.SteamId)))
            {
                return type == MyToolbarType.Character || type == MyToolbarType.Spectator;
            }

            return false;
        }
        public override bool AllowedInToolbarType(MyToolbarType type)
        {
            //So, this is not the way, because server is handling this...?
            //if (VRage.Input.MyInput.Static.ENABLE_DEVELOPER_KEYS || !MySession.Static.SurvivalMode || (MyMultiplayer.Static != null && MyMultiplayer.Static.IsAdmin(MySession.Static.LocalHumanPlayer.Id.SteamId)))
            {
                return type == MyToolbarType.Character || type == MyToolbarType.Spectator;
            }

            return false;
        }
        private ListReader<ITerminalAction> GetActions(MyToolbarType? type)
        {
            if (m_block == null) return ListReader<ITerminalAction>.Empty;

            m_tmpEnabledActions.Clear();
            foreach (var action in MyTerminalControls.Static.GetActions(m_block))
            {
                if (action.IsEnabled(m_block))
                {
                    if (type == null || action.IsValidForToolbarType(type.Value))
                    {
                        m_tmpEnabledActions.Add(action);
                    }
                }
            }

            return m_tmpEnabledActionsReader;
        }
 public override bool AllowedInToolbarType(MyToolbarType type)
 {
     return (type != MyToolbarType.Character && type != MyToolbarType.Spectator);
 }
 public override ListReader<ITerminalAction> PossibleActions (MyToolbarType toolbarType)
 {
     return AllActions;
 }
 public override bool AllowedInToolbarType(MyToolbarType type)
 {
     return (type == MyToolbarType.Character || type == MyToolbarType.Ship || type == MyToolbarType.Seat);
 }
Exemplo n.º 7
0
        public event Action<MyToolbar> Unselected; // Is raised when Unselect method is called

        #endregion

        #region Construction and serialization

        public MyToolbar(MyToolbarType type, int slotCount = DEF_SLOT_COUNT, int pageCount = DEF_PAGE_COUNT)
        {
            SlotCount = slotCount;
            PageCount = pageCount;
            m_items = new MyToolbarItem[SlotCount*PageCount];

            m_toolbarType = type;
            Owner = null;
            SetDefaults();
        }
Exemplo n.º 8
0
 public override bool AllowedInToolbarType(MyToolbarType type)
 {
     return true;
 }
Exemplo n.º 9
0
 public abstract ListReader<ITerminalAction> PossibleActions(MyToolbarType toolbarType);
 public override ListReader <ITerminalAction> PossibleActions(MyToolbarType toolbarType)
 {
     return(AllActions);
 }
 public override ListReader<ITerminalAction> PossibleActions(MyToolbarType type)
 {
     return GetActions(type);
 }
Exemplo n.º 12
0
 public static MyObjectBuilder_Toolbar GetObjectBuilder(MyToolbarType type)
 {
     var builder = m_instance.m_currentToolbar.GetObjectBuilder();
     Debug.Assert(type == builder.ToolbarType, string.Format("Toolbar type mismatch when saving. {0} != {1}", type, builder.ToolbarType));
     builder.ToolbarType = type;
     return builder;
 }
Exemplo n.º 13
0
 public static void InitToolbar(MyToolbarType type, MyObjectBuilder_Toolbar builder)
 {
     if (builder != null)
     {
         Debug.Assert(type == builder.ToolbarType, string.Format("Toolbar type mismatch during init. {0} != {1}", type, builder.ToolbarType));
         if (builder.ToolbarType != type)
             builder.ToolbarType = type;
     }
     m_instance.m_currentToolbar.Init(builder, null, true);
 }
 public override bool AllowedInToolbarType(MyToolbarType type)
 {
     return type == MyToolbarType.Character;
 }
Exemplo n.º 15
0
 public abstract bool AllowedInToolbarType(MyToolbarType type);
Exemplo n.º 16
0
 public override bool AllowedInToolbarType(MyToolbarType type)
 {
     return (type == MyToolbarType.Character || type == MyToolbarType.Spectator || type == MyToolbarType.BuildCockpit);
 }
 public override bool AllowedInToolbarType(MyToolbarType type)
 {
     return(type == MyToolbarType.Character || type == MyToolbarType.Spectator || type == MyToolbarType.BuildCockpit);
 }