Allow disabling tips if empty (or no) tips.xml
This commit is contained in:
parent
a3e1732ac7
commit
10da6285fc
@ -1432,7 +1432,7 @@ namespace GUIEngine
|
|||||||
void renderLoading(bool clearIcons, bool launching, bool update_tips)
|
void renderLoading(bool clearIcons, bool launching, bool update_tips)
|
||||||
{
|
{
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
if (update_tips)
|
if (!TipsManager::get()->isEmpty() && update_tips)
|
||||||
{
|
{
|
||||||
core::stringw tip = TipsManager::get()->getTip("general");
|
core::stringw tip = TipsManager::get()->getTip("general");
|
||||||
//I18N: Tip shown in gui for giving player hints
|
//I18N: Tip shown in gui for giving player hints
|
||||||
|
@ -189,7 +189,8 @@ void RaceResultGUI::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SERVER_ONLY
|
#ifndef SERVER_ONLY
|
||||||
if (!human_win && !NetworkConfig::get()->isNetworking())
|
if (!human_win && !NetworkConfig::get()->isNetworking() &&
|
||||||
|
!TipsManager::get()->isEmpty())
|
||||||
{
|
{
|
||||||
std::string tipset = "race";
|
std::string tipset = "race";
|
||||||
if (RaceManager::get()->isSoccerMode())
|
if (RaceManager::get()->isSoccerMode())
|
||||||
|
@ -36,7 +36,11 @@ TipsManager* TipsManager::m_tips_manager = NULL;
|
|||||||
TipsManager::TipsManager()
|
TipsManager::TipsManager()
|
||||||
{
|
{
|
||||||
const std::string file_name = file_manager->getAsset("tips.xml");
|
const std::string file_name = file_manager->getAsset("tips.xml");
|
||||||
|
if (file_name.empty())
|
||||||
|
return;
|
||||||
const XMLNode *root = file_manager->createXMLTree(file_name);
|
const XMLNode *root = file_manager->createXMLTree(file_name);
|
||||||
|
if (!root)
|
||||||
|
return;
|
||||||
unsigned int num_nodes = root->getNumNodes();
|
unsigned int num_nodes = root->getNumNodes();
|
||||||
|
|
||||||
for (unsigned int i = 0; i < num_nodes; i++)
|
for (unsigned int i = 0; i < num_nodes; i++)
|
||||||
|
@ -70,6 +70,8 @@ public:
|
|||||||
/** Get a tip by ID. */
|
/** Get a tip by ID. */
|
||||||
const irr::core::stringw& getTip(const std::string& id) const;
|
const irr::core::stringw& getTip(const std::string& id) const;
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
bool isEmpty() const { return m_all_tip_sets.empty(); }
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
}; // class TipsManager
|
}; // class TipsManager
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user