1
0
Fork 0

Rotate through tips based on execution count.

This commit is contained in:
Stuart Buchanan 2017-03-23 21:11:46 +00:00
parent 2096d704be
commit 43a2b6fdac

View file

@ -521,11 +521,7 @@ void SplashScreen::updateText()
_haveSetStartupTip = true; _haveSetStartupTip = true;
FGLocale* locale = globals->get_locale(); FGLocale* locale = globals->get_locale();
const int tipCount = locale->getLocalizedStringCount("tip", "tips"); const int tipCount = locale->getLocalizedStringCount("tip", "tips");
int tipIndex = globals->get_props()->getIntValue("/sim/session",0) % tipCount;
time_t now;
::time(&now);
struct tm* currentTime = ::localtime(&now);
int tipIndex = currentTime->tm_yday % tipCount;
std::string tipText = locale->getLocalizedStringWithIndex("tip", "tips", tipIndex); std::string tipText = locale->getLocalizedStringWithIndex("tip", "tips", tipIndex);