Example #1
0
        private static void UpdateRemoveAndDepowerButton(MyGuiScreenAdminMenu menu, long entityId)
        {
            MyEntity entity;

            MyEntities.TryGetEntityById(entityId, out entity);
            menu.m_removeItemButton.Enabled = entity == null ? false : !(entity is MyCharacter);
            if (menu.m_depowerItemButton != null)
            {
                menu.m_depowerItemButton.Enabled = entity == null ? false : !(entity is MyCharacter);
            }
        }
 private static void UpdateRemoveAndDepowerButton(MyGuiScreenAdminMenu menu,long entityId)
 {
     MyEntity entity;
     MyEntities.TryGetEntityById(entityId, out entity);
     menu.m_removeItemButton.Enabled = entity == null ? false : !(entity is MyCharacter);
     if (menu.m_depowerItemButton != null)
     {
         menu.m_depowerItemButton.Enabled = entity == null ? false : !(entity is MyCharacter);
     }
 }