mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-09 18:40:14 +00:00
Removed long int parameter
This commit is contained in:
parent
d91f197119
commit
61bb55aff4
@ -1,5 +1,6 @@
|
|||||||
#include "savegamedialog.hpp"
|
#include "savegamedialog.hpp"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
@ -312,12 +313,13 @@ namespace MWGui
|
|||||||
onSlotSelected(mSaveList, MyGUI::ITEM_NONE);
|
onSlotSelected(mSaveList, MyGUI::ITEM_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string formatTimeplayed(const long int timeInSeconds)
|
std::string formatTimeplayed(const double timeInSeconds)
|
||||||
{
|
{
|
||||||
int days = timeInSeconds / 60 / 60 / 24;
|
int timePlayed = (int)floor(timeInSeconds);
|
||||||
int hours = (timeInSeconds / 60 / 60) % 24;
|
int days = timePlayed / 60 / 60 / 24;
|
||||||
int minutes = (timeInSeconds / 60) % 60;
|
int hours = (timePlayed / 60 / 60) % 24;
|
||||||
int seconds = timeInSeconds % 60;
|
int minutes = (timePlayed / 60) % 60;
|
||||||
|
int seconds = timePlayed % 60;
|
||||||
|
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
stream << std::setfill('0') << std::setw(2) << days << ":";
|
stream << std::setfill('0') << std::setw(2) << days << ":";
|
||||||
@ -380,7 +382,7 @@ namespace MWGui
|
|||||||
|
|
||||||
if (Settings::Manager::getBool("timeplayed","Saves"))
|
if (Settings::Manager::getBool("timeplayed","Saves"))
|
||||||
{
|
{
|
||||||
text << "\n" << "Time played: " << formatTimeplayed((int)floor(mCurrentSlot->mProfile.mTimePlayed));
|
text << "\n" << "Time played: " << formatTimeplayed(mCurrentSlot->mProfile.mTimePlayed);
|
||||||
}
|
}
|
||||||
|
|
||||||
mInfoText->setCaptionWithReplacing(text.str());
|
mInfoText->setCaptionWithReplacing(text.str());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user