예제 #1
0
 protected int DoesAlreadyExist()
 {
     for (int i = 0; i < saves.ItemsCount(); i++)
     {
         if (saves.ItemsGetAt(i) == tb.Text)
         {
             return(i);
         }
     }
     return(-1);
 }
예제 #2
0
        public override void Draw(Renderer renderer)
        {
            base.Draw(renderer);

            renderer.Draw(tfolder, Position + new Vector2(26, 26), Color.White);
            renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X - 9, (int)Position.Y + 95, (int)Size.X + 9, 1), Color.White);
            renderer.Draw(GraphicsEngine.pixel, new Rectangle((int)Position.X - 10 + (int)Size.X + 9, (int)Position.Y + 95, 1, 5), Color.White);
            if (saves.ItemsCount() == 0)
            {
                var a = overlayFont.MeasureString("No save files found");
                renderer.DrawString(overlayFont, "No save files found",
                                    new Rectangle((int)saves.Position.X, (int)(saves.Position.Y + (saves.Size.Y - a.Y) / 2), (int)saves.Size.X, (int)a.Y),
                                    Color.Gray, Renderer.TextAlignment.Center);
            }
        }