mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-04 13:51:34 +00:00
[Client] Update setting of time via WorldTime packets
The setting of time-related values was previously handled directly in OpenMW's World class. It is now handled in OpenMW's DateTimeManager class instead when the variable names passed to World's setGlobalInt() and setGlobalFloat() are time-related.
This commit is contained in:
parent
e5b1843089
commit
9f2408473f
3 changed files with 10 additions and 81 deletions
|
@ -20,25 +20,23 @@ namespace mwmp
|
|||
{
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
|
||||
/*
|
||||
if (worldstate.time.hour != -1)
|
||||
world->setHour(worldstate.time.hour);
|
||||
|
||||
world->setGlobalFloat("gamehour", worldstate.time.hour);
|
||||
|
||||
if (worldstate.time.day != -1)
|
||||
world->setDay(worldstate.time.day);
|
||||
|
||||
world->setGlobalInt("day", worldstate.time.day);
|
||||
|
||||
if (worldstate.time.month != -1)
|
||||
world->setMonth(worldstate.time.month);
|
||||
world->setGlobalInt("month", worldstate.time.month);
|
||||
|
||||
if (worldstate.time.year != -1)
|
||||
world->setYear(worldstate.time.year);
|
||||
|
||||
if (worldstate.time.daysPassed != -1)
|
||||
world->setDaysPassed(worldstate.time.daysPassed);
|
||||
world->setGlobalInt("year", worldstate.time.year);
|
||||
|
||||
if (worldstate.time.timeScale != -1)
|
||||
world->setTimeScale(worldstate.time.timeScale);
|
||||
*/
|
||||
world->setGlobalFloat("timescale", worldstate.time.timeScale);
|
||||
|
||||
if (worldstate.time.daysPassed != -1)
|
||||
world->setGlobalInt("dayspassed", worldstate.time.daysPassed);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -85,45 +85,6 @@ namespace MWWorld
|
|||
mMonth = month;
|
||||
}
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Make it possible to set the year from elsewhere
|
||||
*/
|
||||
void DateTimeManager::setYear(int year)
|
||||
{
|
||||
mYear = year;
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Make it possible to set the number of days passed from elsewhere
|
||||
*/
|
||||
void DateTimeManager::setDaysPassed(int days)
|
||||
{
|
||||
mDaysPassed = days;
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Make it possible to set a custom timeScale from elsewhere
|
||||
*/
|
||||
void DateTimeManager::setTimeScale(float timeScale)
|
||||
{
|
||||
mTimeScale = timeScale;
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
TimeStamp DateTimeManager::getTimeStamp() const
|
||||
{
|
||||
return TimeStamp(mGameHour, mDaysPassed);
|
||||
|
|
|
@ -26,36 +26,6 @@ namespace MWWorld
|
|||
void setDay(int day);
|
||||
void setMonth(int month);
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Make it possible to set the year from elsewhere
|
||||
*/
|
||||
void setYear(int year);
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Make it possible to set the number of days passed from elsewhere
|
||||
*/
|
||||
void setDaysPassed(int daysPassed);
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
Make it possible to set a custom timeScale from elsewhere
|
||||
*/
|
||||
void setTimeScale(float timeScale);
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
public:
|
||||
std::string getMonthName(int month) const;
|
||||
TimeStamp getTimeStamp() const;
|
||||
|
|
Loading…
Reference in a new issue