23 #include "../Savegame/Soldier.h" 30 class InteractiveSurface;
33 class SavedBattleGame;
50 std::vector<Surface*> _surfaces;
56 SDL_Color _palette[256];
68 void add(
Surface *surface,
const std::string &
id,
const std::string &category,
Surface *parent = 0);
92 const LocalizedText &
tr(
const std::string &
id, SoldierGender gender)
const;
106 void setPalette(SDL_Color *colors,
int firstcolor = 0,
int ncolors = 256,
bool immediately =
true);
108 void setPalette(
const std::string &palette,
int backpals = -1);
112 virtual void resize(
int &dX,
int &dY);
114 virtual void recenter(
int dX,
int dY);
void setModal(InteractiveSurface *surface)
Sets a modal surface.
Definition: State.cpp:455
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void centerAllSurfaces()
center all surfaces relative to the screen.
Definition: State.cpp:382
virtual void recenter(int dX, int dY)
Re-orients all the surfaces in the state.
Definition: State.cpp:544
State()
Creates a new state linked to a game.
Definition: State.cpp:51
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Timer used to run code in fixed intervals.
Definition: Timer.h:35
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
void hideAll()
Hides all the state surfaces.
Definition: State.cpp:312
bool isScreen() const
Gets whether the state is a full-screen.
Definition: State.cpp:217
const LocalizedText & tr(const std::string &id) const
Get the localized text.
Definition: State.cpp:350
virtual void think()
Runs state functionality every cycle.
Definition: State.cpp:271
Definition: RuleInterface.h:35
static Game * _game
Initializes static member.
Definition: State.h:49
void showAll()
Shws all the state surfaces.
Definition: State.cpp:321
A string that is already translated.
Definition: LocalizedText.h:43
void toggleScreen()
Toggles whether the state is a full-screen.
Definition: State.cpp:227
void applyBattlescapeTheme()
switch the colours to use the battlescape palette.
Definition: State.cpp:405
SDL_Color * getPalette()
Gets the state's 8bpp palette.
Definition: State.cpp:523
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256, bool immediately=true)
Changes a set of colors on the state's 8bpp palette.
Definition: State.cpp:467
void resetAll()
Resets all the state surfaces.
Definition: State.cpp:331
static void setGamePtr(Game *game)
Sets game object pointer.
Definition: State.cpp:553
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
virtual void init()
Initializes the state.
Definition: State.cpp:240
void setInterface(const std::string &s, bool alterPal=false, SavedBattleGame *battleGame=0)
Set interface rules.
Definition: State.cpp:75
virtual void blit()
Blits the state to the screen.
Definition: State.cpp:303
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:47
virtual void handle(Action *action)
Handles any events.
Definition: State.cpp:282
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:41
virtual void resize(int &dX, int &dY)
Let the state know the window has been resized.
Definition: State.cpp:534
void lowerAllSurfaces()
lower all surfaces by half the screen height.
Definition: State.cpp:394
void add(Surface *surface)
Adds a child element to the state.
Definition: State.cpp:131
Definition: BaseInfoState.cpp:40
void redrawText()
redraw all the text-type surfaces.
Definition: State.cpp:433
virtual ~State()
Cleans up the state.
Definition: State.cpp:61