[game_config]: new keys for logo

remove hardcoded path for logo image
add 'game_logo' & 'game_logo_background' keys in [game_config]
this allows [core] authors to define their own game logo to appear on the title screen
this does not (yet) affect the loadscreen
This commit is contained in:
dorng 2016-06-16 00:15:53 +02:00
parent 2642c104d3
commit c67538f93d
5 changed files with 14 additions and 4 deletions

View file

@ -57,6 +57,8 @@
[images]
game_title="maps/titlescreen.png"
game_title_background="maps/background.jpg"
game_logo="misc/logo.png"
game_logo_background="misc/logo-bg.png"
orb="misc/orb.png"
energy="misc/bar-energy.png"

View file

@ -319,7 +319,7 @@
[image]
id = "logo-bg"
label = "misc/logo-bg.png"
definition = "default"
[/image]
[/column]

View file

@ -83,6 +83,8 @@ namespace game_config
namespace images {
std::string game_title,
game_title_background,
game_logo,
game_logo_background,
// orbs and hp/xp bar
orb,
energy,
@ -225,6 +227,8 @@ namespace game_config
using namespace game_config::images;
game_title = i["game_title"].str();
game_title_background = i["game_title_background"].str();
game_logo = i["game_logo"].str();
game_logo_background = i["game_logo_background"].str();
orb = i["orb"].str();
energy = i["energy"].str();

View file

@ -85,6 +85,8 @@ namespace game_config
namespace images {
extern std::string game_title,
game_title_background,
game_logo,
game_logo_background,
// orbs and hp/xp bar
orb,
energy,

View file

@ -110,8 +110,8 @@ namespace gui2
* previous_tip & & button & m &
* The button show the previous tip of the day. $
*
* logo & & progress_bar & o &
* A progress bar to "animate" the Wesnoth logo. $
* logo & & image & o &
* The Wesnoth logo. $
*
* revision_number & & control & o &
* A widget to show the version number when the version number is
@ -336,7 +336,9 @@ void ttitle_screen::pre_show(twindow& window)
}
/***** Logo *****/
find_widget<timage>(&window, "logo", false).set_image("misc/logo.png");
find_widget<timage>(&window, "logo-bg", false).set_image(game_config::images::game_logo_background);
find_widget<timage>(&window, "logo", false).set_image(game_config::images::game_logo);
/***** About dialog button *****/
tbutton& about = find_widget<tbutton>(&window, "about", false);