merging to lirria
This commit is contained in:
commit
3fa275e64d
18 changed files with 121 additions and 137 deletions
|
@ -876,12 +876,8 @@ class CAHGuildSheetOpen : public IActionHandler
|
|||
rt.updateRyzomClock(rGuildMembers[i].EnterDate);
|
||||
ucstring str = toString("%03d", (sint)RT.getRyzomWeek()) + " ";
|
||||
str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - ";
|
||||
ucstring year = CI18N::get("uiYear");
|
||||
if (year.length() == 0) {
|
||||
str += toString("%04d", RT.getRyzomYear()) + " - ";
|
||||
} else {
|
||||
str += year + " - ";
|
||||
}
|
||||
ucstring year = RT.getRyzomYearStr();
|
||||
str += year + " - "
|
||||
str += CI18N::get("uiEon");
|
||||
pViewEnterDate->setText(str);
|
||||
}
|
||||
|
|
|
@ -1487,12 +1487,8 @@ void CInterfaceManager::updateFrameEvents()
|
|||
str += toString("%02d", (sint)RT.getRyzomTime()) + CI18N::get("uiMissionTimerHour") + " - ";
|
||||
str += toString("%d", (sint)RT.getRyzomWeek()) + " ";
|
||||
str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - ";
|
||||
ucstring year = CI18N::get("uiYear");
|
||||
if (year.length() == 0) {
|
||||
str += toString("%04d", RT.getRyzomYear()) + " - ";
|
||||
} else {
|
||||
str += year + " - ";
|
||||
}
|
||||
ucstring year = RT.getRyzomYearStr();
|
||||
str += year + " - ";
|
||||
str += CI18N::get("uiEon");
|
||||
|
||||
pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:time"));
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#define RY_TIME_AND_SEASON_H
|
||||
|
||||
#include "nel/misc/types_nl.h"
|
||||
#include "nel/misc/i18n.h"
|
||||
|
||||
const uint RYZOM_HOURS_IN_TICKS = 9000;
|
||||
const uint RYZOM_DAY_IN_HOUR = 24;
|
||||
|
@ -130,20 +131,20 @@ public:
|
|||
CRyzomTime()
|
||||
{
|
||||
_RyzomDay = 0;
|
||||
_RyzomTime = 0;
|
||||
_RyzomTime = 0.f;
|
||||
_LocalTime = 0.0;
|
||||
_TickOffset = 0;
|
||||
}
|
||||
|
||||
// Update ryzom clock when tick occurs, local time must be given if localUpdateRyzomClock() and getLocalRyzomTime() is used
|
||||
void updateRyzomClock( uint32 gameCyle, double localTime = 0 )
|
||||
{
|
||||
float time = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
|
||||
_RyzomDay = (uint32) ( time / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING;
|
||||
_RyzomTime = (float) fmod( time, RYZOM_DAY_IN_HOUR );
|
||||
float hours = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
|
||||
_RyzomDay = ( (uint)hours / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING;
|
||||
_RyzomTime = (float) fmod( hours, (float)RYZOM_DAY_IN_HOUR );
|
||||
_LocalTime = localTime;
|
||||
}
|
||||
|
||||
|
||||
// get ryzom time (synchronized with server)
|
||||
inline float getRyzomTime() const { return _RyzomTime; }
|
||||
|
||||
|
@ -153,6 +154,9 @@ public:
|
|||
// get ryzom Year
|
||||
inline uint32 getRyzomYear() const { return _RyzomDay / RYZOM_YEAR_IN_DAY + RYZOM_START_YEAR; }
|
||||
|
||||
// get ryzom Year as string
|
||||
inline ucstring getRyzomYearStr() const { return NLMISC::CI18N::get("uiYear").length()==0?NLMISC::toString(_RyzomDay / RYZOM_YEAR_IN_DAY + RYZOM_START_YEAR):NLMISC::CI18N::get("uiYear"); }
|
||||
|
||||
// get ryzom week
|
||||
inline uint32 getRyzomWeek() const { return (_RyzomDay % RYZOM_YEAR_IN_DAY) / RYZOM_WEEK_IN_DAY; }
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include "fx_entity_manager.h"
|
||||
#include "ai_script_data_manager.h"
|
||||
#include "commands.h"
|
||||
|
||||
#include "nel/misc/i18n.h"
|
||||
#include "ais_user_models.h"
|
||||
|
||||
extern bool GrpHistoryRecordLog;
|
||||
|
@ -1686,7 +1686,9 @@ NLMISC_COMMAND(getDatasetId,"get datasetid of bots with name matchiong the given
|
|||
FOREACH(itBot, vector<CBot*>, bots)
|
||||
{
|
||||
CBot* bot = *itBot;
|
||||
DatasetIds += bot->getSpawnObj()->dataSetRow().toString()+"|";
|
||||
CSpawnBot* spawnBot = bot->getSpawnObj();
|
||||
if (spawnBot!=NULL)
|
||||
DatasetIds += spawnBot->dataSetRow().toString()+"|";
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3065,19 +3067,13 @@ static void displayTime(const CRyzomTime &rt, NLMISC::CLog &log)
|
|||
log.displayNL(result.c_str());
|
||||
std::string week = toString("%03d", rt.getRyzomWeek());
|
||||
std::string dayName = CI18N::get("ui"+WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek())).toUtf8();
|
||||
std::string year;
|
||||
std::string year = rt.getRyzomYearStr().toUtf8();
|
||||
std::string eon = CI18N::get("uiEon").toUtf8();
|
||||
ucstring yearBool = CI18N::get("uiYear");
|
||||
if (yearBool.length() == 0) {
|
||||
year = toString("%04d", rt.getRyzomYear());
|
||||
} else {
|
||||
year = yearBool.toUtf8();
|
||||
}
|
||||
result = NLMISC::toString("week:day:year:eon = %s:%s:%s:%s",
|
||||
week,
|
||||
dayName,
|
||||
year,
|
||||
eon);
|
||||
week.c_str(),
|
||||
dayName.c_str(),
|
||||
year.c_str(),
|
||||
eon.c_str());
|
||||
log.displayNL(result.c_str());
|
||||
log.displayNL("day of year = %d/%d", (int) (rt.getRyzomDayOfYear() + 1), (int) RYZOM_YEAR_IN_DAY);
|
||||
log.displayNL("season = %d/4 (%s)", (int) rt.getRyzomSeason() + 1, EGSPD::CSeason::toString(rt.getRyzomSeason()).c_str());
|
||||
|
|
|
@ -3366,19 +3366,13 @@ void getRyzomDateStr__s(CStateInstance* entity, CScriptStack& stack)
|
|||
|
||||
std::string week = toString("%03d", rt.getRyzomWeek());
|
||||
std::string dayName = CI18N::get("ui"+WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek())).toUtf8();
|
||||
std::string year;
|
||||
std::string year = toString(rt.getRyzomYearStr());
|
||||
std::string eon = CI18N::get("uiEon").toUtf8();
|
||||
ucstring yearBool = CI18N::get("uiYear");
|
||||
if (yearBool.length() == 0) {
|
||||
year = toString("%04d", rt.getRyzomYear());
|
||||
} else {
|
||||
year = yearBool.toUtf8();
|
||||
}
|
||||
result += NLMISC::toString(" / %s %s - %s - %s",
|
||||
week,
|
||||
dayName,
|
||||
year,
|
||||
eon);
|
||||
week.c_str(),
|
||||
dayName.c_str(),
|
||||
year.c_str(),
|
||||
eon.c_str());
|
||||
|
||||
stack.push( result );
|
||||
}
|
||||
|
|
|
@ -376,17 +376,16 @@ inline
|
|||
float CStateInstance::getNelVar(std::string const& varId)
|
||||
{
|
||||
TNelVarList::iterator it = _NelVar.find(varId);
|
||||
if (it==_NelVar.end())
|
||||
if (it != _NelVar.end()) return it->second->get();
|
||||
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return 0.f;
|
||||
}
|
||||
_NelVar[varId] = new NLMISC::CVariable<float>("StateInstance", varId.c_str(), "", 0.f);
|
||||
_NelVar[varId]->get();
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return 0.f;
|
||||
}
|
||||
return it->second->get();
|
||||
|
||||
_NelVar[varId] = new NLMISC::CVariable<float>("StateInstance", varId.c_str(), "", 0.f);
|
||||
return _NelVar[varId]->get();
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -424,17 +423,16 @@ inline
|
|||
std::string CStateInstance::getStrNelVar(std::string const& varId)
|
||||
{
|
||||
TStrNelVarList::iterator it = _StrNelVar.find(varId);
|
||||
if (it==_StrNelVar.end())
|
||||
if (it != _StrNelVar.end()) return it->second->get();
|
||||
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return "";
|
||||
}
|
||||
_StrNelVar[varId] = new NLMISC::CVariable<std::string>("StateInstanceVar", varId.c_str(), "", std::string());
|
||||
_NelVar[varId]->get();
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return "";
|
||||
}
|
||||
return it->second->get();
|
||||
|
||||
_StrNelVar[varId] = new NLMISC::CVariable<std::string>("StateInstanceStrVar", varId.c_str(), "", std::string());
|
||||
return _StrNelVar[varId]->get();
|
||||
}
|
||||
|
||||
inline
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue