Ejemplo n.º 1
0
        private static void DisplayList(SpriteBatch spriteBatch, String tag, List <ShipPart> partList, Vector2 startPosition, float deltaY, int slot = 0)
        {
            spriteBatch.DrawString(FontManager.GetFontStatic(fontSize), tag, startPosition, FontManager.FontColorStatic);

            int pos = 1;

            foreach (ShipPart part in partList)
            {
                string name  = part.Name;
                Color  color = Color.White;

                if (!part.Kind.ToLower().Equals("primary") &&
                    ShipInventoryManager.IsEquipped(part))
                {
                    name += " [equipped]";
                }

                else if (part.Kind.ToLower().Equals("primary") &&
                         ShipInventoryManager.IsEquippedAt(part, slot))
                {
                    name += " [equipped]";
                }

                if (layer == 2 &&
                    layer2pos == partList.IndexOf(part))
                {
                    color = FontManager.FontSelectColor1;
                }

                spriteBatch.DrawString(FontManager.GetFontStatic(fontSize), name, new Vector2(startPosition.X + 20, startPosition.Y + pos * deltaY), color);
                pos++;
            }

            if (layer == 2)
            {
                Color color = Color.White;
                if (layer2pos == partList.Count)
                {
                    color = FontManager.FontSelectColor1;
                }

                spriteBatch.DrawString(FontManager.GetFontStatic(fontSize), "Back", new Vector2(startPosition.X + 20, startPosition.Y + pos * deltaY), color);
            }
        }