Пример #1
0
        private void OnFoundationFactoryInventoryContentChanged(MyInventory sender)
        {
            MyTreeViewItemUpdateStateFlag updateFlags = MyTreeViewItemUpdateStateFlag.BuildCountAndDragAndDrop | MyTreeViewItemUpdateStateFlag.CanBuildAndRequirements;

            UpdateTreeViewItemsState(updateFlags);
            FilterAddObjectTreePrivate(MyEditorGizmo.SelectedSnapPoint);
        }
Пример #2
0
        private void UpdateTreeViewItemsState(MyTreeViewItemUpdateStateFlag updateFlags)
        {
            int itemsCount = m_addObjectTreeView.GetItemCount();

            for (int i = 0; i < itemsCount; i++)
            {
                UpdateTreeViewItemsState(m_addObjectTreeView.GetItem(i), updateFlags);
            }
        }
Пример #3
0
        private void OnBuildingComplete(MyPrefabFoundationFactory sender, MyObjectToBuild buildObject)
        {
            MyTreeViewItemUpdateStateFlag updateFlags = MyTreeViewItemUpdateStateFlag.BuildCountAndDragAndDrop | MyTreeViewItemUpdateStateFlag.BuildingProgress;

            MyTreeViewItem treeViewItem = GetTreeViewItem(buildObject);

            UpdateTreeViewItemState(treeViewItem, updateFlags);

            if (sender.BuildingObject != null)
            {
                UpdateTreeViewItemState(GetTreeViewItem(sender.BuildingObject), MyTreeViewItemUpdateStateFlag.BuildingQueue);
            }
            FilterAddObjectTreePrivate(MyEditorGizmo.SelectedSnapPoint);
        }
Пример #4
0
        private void UpdateTreeViewItemsState(MyTreeViewItem treeViewItem, MyTreeViewItemUpdateStateFlag updateFlags)
        {
            int itemsCount = treeViewItem.GetItemCount();

            for (int i = 0; i < itemsCount; i++)
            {
                UpdateTreeViewItemsState(treeViewItem.GetItem(i), updateFlags);
            }

            if (treeViewItem.Tag != null && treeViewItem.Tag is MyObjectToBuild)
            {
                UpdateTreeViewItemState(treeViewItem, updateFlags);
            }
        }
Пример #5
0
        private void OnBuildingQueueChanged(MyObjectToBuild objectToBuild, bool added)
        {
            MyTreeViewItemUpdateStateFlag updateFlags = MyTreeViewItemUpdateStateFlag.BuildingQueue;

            if (!added)
            {
                updateFlags = updateFlags | MyTreeViewItemUpdateStateFlag.BuildingProgress;
            }

            MyTreeViewItem treeViewItem = GetTreeViewItem(objectToBuild);

            UpdateTreeViewItemState(treeViewItem, updateFlags);

            UpdateTreeViewItemsState(MyTreeViewItemUpdateStateFlag.CanBuildAndRequirements);
        }
Пример #6
0
 private void UpdateTreeViewItemState(MyTreeViewItem treeViewItem, MyTreeViewItemUpdateStateFlag updateFlags)
 {
     if ((updateFlags & MyTreeViewItemUpdateStateFlag.BuildCountAndDragAndDrop) != 0)
     {
         UpdateTreeViewItemStateBuildCount(treeViewItem);
     }
     if ((updateFlags & MyTreeViewItemUpdateStateFlag.BuildingQueue) != 0)
     {
         UpdateTreeViewItemStateBuildingQueue(treeViewItem);
     }
     if ((updateFlags & MyTreeViewItemUpdateStateFlag.BuildingProgress) != 0)
     {
         UpdateTreeViewItemStateBuildingProgress(treeViewItem);
     }
     if ((updateFlags & MyTreeViewItemUpdateStateFlag.CanBuildAndRequirements) != 0)
     {
         UpdateTreeViewItemStateCanBuild(treeViewItem);
     }
 }