added version number to title screen
This commit is contained in:
parent
28e1c483aa
commit
d3440e6e8c
4 changed files with 20 additions and 0 deletions
|
@ -56,6 +56,7 @@ language="English"
|
|||
[/hotkey]
|
||||
|
||||
game_title="The Battle for Wesnoth"
|
||||
version="Version"
|
||||
|
||||
difficulty_level="Select difficulty level:"
|
||||
EASY="Fighter (easy)"
|
||||
|
|
|
@ -121,6 +121,12 @@ int display::x() const { return screen_.getx(); }
|
|||
int display::mapx() const { return x() - 140; }
|
||||
int display::y() const { return screen_.gety(); }
|
||||
|
||||
SDL_Rect display::screen_area() const
|
||||
{
|
||||
const SDL_Rect res = {0,0,x(),y()};
|
||||
return res;
|
||||
}
|
||||
|
||||
void display::select_hex(gamemap::location hex)
|
||||
{
|
||||
invalidate(selectedHex_);
|
||||
|
|
|
@ -55,6 +55,7 @@ public:
|
|||
int x() const;
|
||||
int mapx() const;
|
||||
int y() const;
|
||||
SDL_Rect screen_area() const;
|
||||
|
||||
void select_hex(gamemap::location hex);
|
||||
void highlight_hex(gamemap::location hex);
|
||||
|
|
12
src/menu.cpp
12
src/menu.cpp
|
@ -813,6 +813,18 @@ TITLE_RESULT show_title(display& screen)
|
|||
return QUIT_GAME;
|
||||
}
|
||||
|
||||
const std::string& version_str = string_table["version"] + " " +
|
||||
game_config::version;
|
||||
|
||||
const SDL_Rect version_area = draw_text(NULL,screen.screen_area(),10,
|
||||
font::NORMAL_COLOUR,version_str,0,0);
|
||||
const size_t versiony = screen.y() - version_area.h;
|
||||
|
||||
if(versiony < size_t(screen.y())) {
|
||||
draw_text(&screen,screen.screen_area(),10,font::NORMAL_COLOUR,
|
||||
version_str,0,versiony);
|
||||
}
|
||||
|
||||
const int x = screen.x()/2 - title_surface->w/2;
|
||||
const int y = 100;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue