示例#1
0
        private void DrawModuleTab(Rect inRect, ArmorModuleCategory selectCategory)
        {
            Rect scrollVertRectFact = new Rect(0, 0, inRect.x, DefDatabase <ArmorModuleDef> .AllDefsListForReading.Where(x => x.ModuleCategory == selectCategory).Count() * 35);

            GUI.color = MenuSectionBGBorderColor;
            Widgets.DrawLineVertical(245, inRect.y, 465);
            Widgets.DrawLineHorizontal(0, inRect.y, inRect.width);
            GUI.color = Color.white;

            Text.Anchor = TextAnchor.MiddleCenter;
            Rect rect2      = new Rect(inRect.x + 10, 0, 230, 30);
            Rect sliderRect = new Rect(inRect.x, inRect.y + 10, inRect.width, 410);

            Widgets.BeginScrollView(sliderRect, ref slider, scrollVertRectFact, false);
            foreach (var module in DefDatabase <ArmorModuleDef> .AllDefsListForReading.Where(x => x.ModuleCategory == selectCategory))
            {
                Color bColor = canUse.ContainsKey(module) ? Color.gray : Color.white;
                if (DrawCustomButton(rect2, module.LabelCap, bColor))
                {
                    currentModule = module;
                }
                rect2.y += 35;
            }
            Widgets.EndScrollView();
            Text.Anchor = TextAnchor.UpperLeft;

            Rect rect3 = new Rect(inRect.x + 240, inRect.y + 10, 470, 455);

            if (currentModule != null)
            {
                DrawModuleInfo(rect3, currentModule);
            }
        }
示例#2
0
        public ArmorModuleWindow(MKStationWindow mKStationWindow, ArmorModuleCategory category)
        {
            doCloseX = true;

            tab = category;

            mkStationWindow = mKStationWindow;

            canUse = new Dictionary <ArmorModuleDef, string>();
            foreach (var module in DefDatabase <ArmorModuleDef> .AllDefs)
            {
                if (!CanUseRightNow(module.Item, mkStationWindow.mkStation.Map, module, out string reason))
                {
                    canUse.Add(module, reason);
                }
            }
        }
示例#3
0
        public static string GetLabel(this ArmorModuleCategory category)
        {
            switch (category)
            {
            case ArmorModuleCategory.Body:
                return("ArmorModuleCategory_Body".Translate());

            case ArmorModuleCategory.General:
                return("ArmorModuleCategory_General".Translate());

            case ArmorModuleCategory.Head:
                return("ArmorModuleCategory_Head".Translate());

            case ArmorModuleCategory.Legs:
                return("ArmorModuleCategory_Legs".Translate());
            }

            return("");
        }
示例#4
0
        private ref Vector2 GetVector(ArmorModuleCategory category)
        {
            switch (category)
            {
            case ArmorModuleCategory.Body:
                return(ref bodyCategory);

            case ArmorModuleCategory.General:
                return(ref mainCategory);

            case ArmorModuleCategory.Head:
                return(ref headCategory);

            case ArmorModuleCategory.Legs:
                return(ref legsCategory);
            }

            return(ref empty);
        }