2012-03-15 00:53:11 +01:00
|
|
|
// ==============================================================
|
|
|
|
// This file is part of Glest (www.glest.org)
|
|
|
|
//
|
2012-10-30 07:48:12 +01:00
|
|
|
// Copyright (C) 2001-2008 Martiño Figueroa
|
2012-03-15 00:53:11 +01:00
|
|
|
//
|
|
|
|
// You can redistribute this code and/or modify it under
|
|
|
|
// the terms of the GNU General Public License as published
|
|
|
|
// by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version
|
|
|
|
// ==============================================================
|
|
|
|
|
|
|
|
#ifndef _GLEST_GAME_MENUSTATELOADGAME_H_
|
|
|
|
#define _GLEST_GAME_MENUSTATELOADGAME_H_
|
|
|
|
|
|
|
|
#include "main_menu.h"
|
|
|
|
#include "leak_dumper.h"
|
|
|
|
|
|
|
|
namespace Glest{ namespace Game{
|
|
|
|
|
|
|
|
// ===============================
|
|
|
|
// class MenuStateLoadGame
|
|
|
|
// ===============================
|
2012-03-16 02:10:32 +01:00
|
|
|
//typedef vector<GraphicButton*> SaveSlotButtons;
|
2012-03-15 00:53:11 +01:00
|
|
|
class MenuStateLoadGame: public MenuState{
|
|
|
|
private:
|
|
|
|
GraphicButton loadButton;
|
|
|
|
GraphicButton deleteButton;
|
|
|
|
GraphicButton abortButton;
|
2012-03-16 02:10:32 +01:00
|
|
|
vector<GraphicButton*> slots;
|
|
|
|
vector<GraphicComponent*> slotsGB;
|
|
|
|
vector<string> filenames;
|
2012-03-15 00:53:11 +01:00
|
|
|
GraphicScrollBar slotsScrollBar;
|
2012-03-16 02:10:32 +01:00
|
|
|
GraphicButton* selectedButton;
|
2012-03-15 00:53:11 +01:00
|
|
|
|
2012-03-17 02:32:18 +01:00
|
|
|
GraphicButton* buttonToDelete;
|
|
|
|
|
|
|
|
Texture2D *previewTexture;
|
|
|
|
Texture2D *needsToBeFreedTexture;
|
|
|
|
|
2012-03-15 00:53:11 +01:00
|
|
|
GraphicLabel headerLabel;
|
|
|
|
GraphicLabel noSavedGamesLabel;
|
|
|
|
GraphicLabel savedGamesLabel;
|
|
|
|
GraphicLabel infoHeaderLabel;
|
|
|
|
GraphicLabel infoTextLabel;
|
|
|
|
|
|
|
|
GraphicLine lines[2];
|
|
|
|
|
2013-05-25 10:02:07 +02:00
|
|
|
GraphicMessageBox mainMessageBox;
|
|
|
|
|
2012-03-16 02:10:32 +01:00
|
|
|
string saveGameDir;
|
2012-03-17 02:32:18 +01:00
|
|
|
int slotLinesYBase;
|
|
|
|
int slotsLineHeight;
|
2012-03-16 02:10:32 +01:00
|
|
|
|
2012-03-15 00:53:11 +01:00
|
|
|
public:
|
|
|
|
MenuStateLoadGame(Program *program, MainMenu *mainMenu);
|
|
|
|
~MenuStateLoadGame();
|
|
|
|
|
|
|
|
void mouseClick(int x, int y, MouseButton mouseButton);
|
2012-11-02 21:07:50 +01:00
|
|
|
void mouseUp(int x, int y, const MouseButton mouseButton);
|
2012-03-15 00:53:11 +01:00
|
|
|
void mouseMove(int x, int y, const MouseState *mouseState);
|
|
|
|
void update();
|
|
|
|
void render();
|
|
|
|
virtual void keyDown(SDL_KeyboardEvent key);
|
|
|
|
|
|
|
|
void reloadUI();
|
2013-05-25 10:02:07 +02:00
|
|
|
|
2012-03-15 00:53:11 +01:00
|
|
|
private:
|
2013-05-25 10:02:07 +02:00
|
|
|
|
2012-03-15 00:53:11 +01:00
|
|
|
void clearSlots();
|
2012-03-17 02:32:18 +01:00
|
|
|
void deleteSlot(int i);
|
2012-03-17 04:32:20 +01:00
|
|
|
void listFiles();
|
2013-05-25 10:02:07 +02:00
|
|
|
|
|
|
|
void showMessageBox(const string &text, const string &header, bool toggle);
|
2012-03-15 00:53:11 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}}//end namespace
|
|
|
|
|
|
|
|
#endif
|