mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 12:35:46 +00:00
Replaced ifs/elseifs with switch
This commit is contained in:
parent
13c33c1613
commit
89cba3cf45
@ -95,31 +95,46 @@ namespace MWGui
|
|||||||
// http://www.uesp.net/wiki/Lore:Calendar
|
// http://www.uesp.net/wiki/Lore:Calendar
|
||||||
std::string month;
|
std::string month;
|
||||||
int m = MWBase::Environment::get().getWorld ()->getMonth ();
|
int m = MWBase::Environment::get().getWorld ()->getMonth ();
|
||||||
if (m == 0)
|
switch (m) {
|
||||||
|
case 0:
|
||||||
month = "#{sMonthMorningstar}";
|
month = "#{sMonthMorningstar}";
|
||||||
else if (m == 1)
|
break;
|
||||||
|
case 1:
|
||||||
month = "#{sMonthSunsdawn}";
|
month = "#{sMonthSunsdawn}";
|
||||||
else if (m == 2)
|
break;
|
||||||
|
case 2:
|
||||||
month = "#{sMonthFirstseed}";
|
month = "#{sMonthFirstseed}";
|
||||||
else if (m == 3)
|
break;
|
||||||
|
case 3:
|
||||||
month = "#{sMonthRainshand}";
|
month = "#{sMonthRainshand}";
|
||||||
else if (m == 4)
|
break;
|
||||||
|
case 4:
|
||||||
month = "#{sMonthSecondseed}";
|
month = "#{sMonthSecondseed}";
|
||||||
else if (m == 5)
|
break;
|
||||||
|
case 5:
|
||||||
month = "#{sMonthMidyear}";
|
month = "#{sMonthMidyear}";
|
||||||
else if (m == 6)
|
break;
|
||||||
|
case 6:
|
||||||
month = "#{sMonthSunsheight}";
|
month = "#{sMonthSunsheight}";
|
||||||
else if (m == 7)
|
break;
|
||||||
|
case 7:
|
||||||
month = "#{sMonthLastseed}";
|
month = "#{sMonthLastseed}";
|
||||||
else if (m == 8)
|
break;
|
||||||
|
case 8:
|
||||||
month = "#{sMonthHeartfire}";
|
month = "#{sMonthHeartfire}";
|
||||||
else if (m == 9)
|
break;
|
||||||
|
case 9:
|
||||||
month = "#{sMonthFrostfall}";
|
month = "#{sMonthFrostfall}";
|
||||||
else if (m == 10)
|
break;
|
||||||
|
case 10:
|
||||||
month = "#{sMonthSunsdusk}";
|
month = "#{sMonthSunsdusk}";
|
||||||
else if (m == 11)
|
break;
|
||||||
|
case 11:
|
||||||
month = "#{sMonthEveningstar}";
|
month = "#{sMonthEveningstar}";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
int hour = MWBase::Environment::get().getWorld ()->getTimeStamp ().getHour ();
|
int hour = MWBase::Environment::get().getWorld ()->getTimeStamp ().getHour ();
|
||||||
bool pm = hour >= 12;
|
bool pm = hour >= 12;
|
||||||
if (hour >= 13) hour -= 12;
|
if (hour >= 13) hour -= 12;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user