Ejemplo n.º 1
0
        protected override void FillTreeView()
        {
            MyTexture2D icon     = null;
            MyTexture2D expand   = MyGuiManager.GetCollapseTexture();
            MyTexture2D collapse = MyGuiManager.GetExpandTexture();

            Vector2 smallIconSize  = Vector2.Zero;
            Vector2 expandIconSize = MyGuiConstants.CHECKBOX_SIZE;

            CategoryTypesEnum[] beamsCategories       = { CategoryTypesEnum.LARGE, CategoryTypesEnum.MEDIUM, CategoryTypesEnum.SMALL, CategoryTypesEnum.FRAME, CategoryTypesEnum.SHELVES };
            CategoryTypesEnum[] shellsCategories      = { CategoryTypesEnum.PANELS, CategoryTypesEnum.CHAMBERS, CategoryTypesEnum.ARMORS };
            CategoryTypesEnum[] modulesCategories     = { CategoryTypesEnum.FLIGHT, CategoryTypesEnum.SUPPLY, CategoryTypesEnum.LIFE_SUPPORT, CategoryTypesEnum.INDUSTRY, CategoryTypesEnum.WEAPONRY, CategoryTypesEnum.COMMUNICATIONS, CategoryTypesEnum.MANNED_OBJECTS };
            CategoryTypesEnum[] connectionsCategories = { CategoryTypesEnum.TUNNELS, CategoryTypesEnum.PIPES, CategoryTypesEnum.PASSAGES, CategoryTypesEnum.CABLES };
            CategoryTypesEnum[] detailssCategories    = { CategoryTypesEnum.LIGHTS, CategoryTypesEnum.BILLBOARDS, CategoryTypesEnum.SIGNS, CategoryTypesEnum.TRAFFIC_SIGNS, CategoryTypesEnum.BARRELS, CategoryTypesEnum.SOUNDS, CategoryTypesEnum.OTHER };

            foreach (MyMwcObjectBuilder_Prefab_AppearanceEnum factionTexture in MyGuiPrefabHelpers.MyMwcFactionTextureEnumValues)
            {
                var factionName = MyGuiPrefabHelpers.GetFactionName(factionTexture);
                var factionItem = m_addObjectTreeView.AddItem(factionName, icon, smallIconSize, expand, collapse, expandIconSize);
                factionItem.ToolTip = new MyToolTips(factionName);

                // BuildTypesEnum.BEAMS
                AddPrefabType(factionItem, factionTexture, MyTextsWrapperEnum.buildTypeBeam, BuildTypesEnum.BEAMS, beamsCategories, icon, smallIconSize, expand, collapse, expandIconSize);
                // BuildTypesEnum.SHELLS
                AddPrefabType(factionItem, factionTexture, MyTextsWrapperEnum.buildTypePanel, BuildTypesEnum.SHELLS, shellsCategories, icon, smallIconSize, expand, collapse, expandIconSize);
                // BuildTypesEnum.MODULES
                AddPrefabType(factionItem, factionTexture, MyTextsWrapperEnum.buildTypeModule, BuildTypesEnum.MODULES, modulesCategories, icon, smallIconSize, expand, collapse, expandIconSize);
                //BuildTypesEnum.CONNECTIONS
                AddPrefabType(factionItem, factionTexture, MyTextsWrapperEnum.buildTypeConnection, BuildTypesEnum.CONNECTIONS, connectionsCategories, icon, smallIconSize, expand, collapse, expandIconSize);
                //BuildTypesEnum.DETAILS
                AddPrefabType(factionItem, factionTexture, MyTextsWrapperEnum.buildTypeDetail, BuildTypesEnum.DETAILS, detailssCategories, icon, smallIconSize, expand, collapse, expandIconSize);
            }

            // SmallShipAmmo
            var smallShipAmmoItem = m_addObjectTreeView.AddItem(MyTextsWrapper.Get(MyTextsWrapperEnum.Ammo), icon, smallIconSize, expand, collapse, expandIconSize);

            AddSmallShipAmmoItems(smallShipAmmoItem);

            // SmallShipWeapons
            var smallShipWeaponsItem = m_addObjectTreeView.AddItem(MyTextsWrapper.Get(MyTextsWrapperEnum.Weapons), icon, smallIconSize, expand, collapse, expandIconSize);

            AddSmallShipWeaponsItems(smallShipWeaponsItem);
        }