From 084be3599a5ef0acba7c341bfd14a4e9801423a2 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 15 Feb 2013 21:13:53 +0200 Subject: Get menu background image from selected game --- src/subgame.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/subgame.cpp') diff --git a/src/subgame.cpp b/src/subgame.cpp index 19ad4e636..a17b16234 100644 --- a/src/subgame.cpp +++ b/src/subgame.cpp @@ -22,6 +22,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "filesys.h" #include "settings.h" #include "log.h" +#ifndef SERVER +#include "tile.h" // getImagePath +#endif #include "util/string.h" bool getGameMinetestConfig(const std::string &game_path, Settings &conf) @@ -94,7 +97,16 @@ SubgameSpec findSubgame(const std::string &id) std::string game_name = getGameName(game_path); if(game_name == "") game_name = id; - return SubgameSpec(id, game_path, gamemod_path, mods_paths, game_name); + std::string menubackground_path; + std::string menuoverlay_path; + std::string menuicon_path; +#ifndef SERVER + menubackground_path = getImagePath(game_path + DIR_DELIM + "menu/background.png"); + menuoverlay_path = getImagePath(game_path + DIR_DELIM + "menu/overlay.png"); + menuicon_path = getImagePath(game_path + DIR_DELIM + "menu/icon.png"); +#endif + return SubgameSpec(id, game_path, gamemod_path, mods_paths, game_name, + menubackground_path, menuoverlay_path, menuicon_path); } SubgameSpec findWorldSubgame(const std::string &world_path) -- cgit v1.2.3 From 0deb68d81cd5ebbd24671702be940e1c871e43f2 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Thu, 2 May 2013 23:08:59 +0200 Subject: Use DIR_DELIM instead of / in file paths --- src/subgame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/subgame.cpp') diff --git a/src/subgame.cpp b/src/subgame.cpp index a17b16234..1bee630b2 100644 --- a/src/subgame.cpp +++ b/src/subgame.cpp @@ -101,9 +101,9 @@ SubgameSpec findSubgame(const std::string &id) std::string menuoverlay_path; std::string menuicon_path; #ifndef SERVER - menubackground_path = getImagePath(game_path + DIR_DELIM + "menu/background.png"); - menuoverlay_path = getImagePath(game_path + DIR_DELIM + "menu/overlay.png"); - menuicon_path = getImagePath(game_path + DIR_DELIM + "menu/icon.png"); + menubackground_path = getImagePath(game_path + DIR_DELIM + "menu" + DIR_DELIM + "background.png"); + menuoverlay_path = getImagePath(game_path + DIR_DELIM + "menu" + DIR_DELIM + "overlay.png"); + menuicon_path = getImagePath(game_path + DIR_DELIM + "menu" + DIR_DELIM + "icon.png"); #endif return SubgameSpec(id, game_path, gamemod_path, mods_paths, game_name, menubackground_path, menuoverlay_path, menuicon_path); -- cgit v1.2.3 From a888b232fe1315e4922c541f30b214647511bb93 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 4 May 2013 10:03:56 +0300 Subject: Add header.png and footer.png support for games, and support texture packs via _menu_.png --- src/subgame.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/subgame.cpp') diff --git a/src/subgame.cpp b/src/subgame.cpp index 1bee630b2..cdb546619 100644 --- a/src/subgame.cpp +++ b/src/subgame.cpp @@ -97,16 +97,12 @@ SubgameSpec findSubgame(const std::string &id) std::string game_name = getGameName(game_path); if(game_name == "") game_name = id; - std::string menubackground_path; - std::string menuoverlay_path; std::string menuicon_path; #ifndef SERVER - menubackground_path = getImagePath(game_path + DIR_DELIM + "menu" + DIR_DELIM + "background.png"); - menuoverlay_path = getImagePath(game_path + DIR_DELIM + "menu" + DIR_DELIM + "overlay.png"); menuicon_path = getImagePath(game_path + DIR_DELIM + "menu" + DIR_DELIM + "icon.png"); #endif return SubgameSpec(id, game_path, gamemod_path, mods_paths, game_name, - menubackground_path, menuoverlay_path, menuicon_path); + menuicon_path); } SubgameSpec findWorldSubgame(const std::string &world_path) -- cgit v1.2.3