correction du merge

This commit is contained in:
compil 2017-11-03 23:07:35 +01:00
parent 675bcee591
commit e4cb143038
7 changed files with 31 additions and 52 deletions

View file

@ -130,7 +130,6 @@ using namespace NLGUI;
#include "../global.h"
#include "user_agent.h"
#include "../item_group_manager.h"
using namespace NLMISC;
@ -1499,7 +1498,6 @@ void CInterfaceManager::updateFrameEvents()
toString(", %d", (uint)(roundWeatherValue(WeatherManager.getWeatherValue()) * 100.f)) + "% " +CI18N::get("uiHumidity");
CViewText *pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:weather"));
if (pVT != NULL)
pVT->setText(str);
@ -1513,6 +1511,7 @@ void CInterfaceManager::updateFrameEvents()
pTooltip->setDefaultContextHelp(tt);
}
// The date feature is temporarily disabled
str.clear();
@ -1526,13 +1525,13 @@ void CInterfaceManager::updateFrameEvents()
// literal version
// str = CI18N::get("uiDate");
str += toString("%02d", (sint)RT.getRyzomTime()) + " - ";
uint minutes = ((RT.getRyzomTime() - (sint)RT.getRyzomTime()) * (float) RYZOM_HOUR_IN_MINUTES);
str += toString("%02d:%02d", (sint)RT.getRyzomTime(), minutes) + " - ";
str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + ", ";
str += CI18N::get("ui"+MONTH::toString( (MONTH::EMonth)RT.getRyzomMonthInCurrentCycle() )) + " ";
str += toString("%02d", RT.getRyzomDayOfMonth()+1) + ", ";
str += CI18N::get("uiAtysianCycle" + toString(RT.getRyzomCycle()+1) + "Ordinal") + " " + CI18N::get("uiAtysianCycle") + " ";
str += toString("%04d", RT.getRyzomYear());
str += toString("%d:%d", (sint)RT.getRyzomWeek(), minutes) + " ";
str += CI18N::get("ui"+WEEKDAY::toString( (WEEKDAY::EWeekDay)RT.getRyzomDayOfWeek() )) + " - ";
ucstring year = RT.getRyzomYearStr();
str += year + " - ";
str += CI18N::get("uiEon");
pVT = dynamic_cast<CViewText*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:map:content:map_content:time"));
if (pVT != NULL)
@ -1572,8 +1571,6 @@ void CInterfaceManager::updateFrameEvents()
CBGDownloaderAccess::getInstance().update();
CItemGroupManager::getInstance()->update();
}
// ------------------------------------------------------------------------------------------------

View file

@ -2120,6 +2120,7 @@ bool SBagOptions::canDisplay(CDBCtrlSheet *pCS) const
const CItemSheet *pIS = pCS->asItemSheet();
if (pIS != NULL)
{
if (SearchFilter.size() > 0)
{
bool match = true;
@ -2548,6 +2549,7 @@ class CHandlerInvSetSearch : public IActionHandler
};
REGISTER_ACTION_HANDLER( CHandlerInvSetSearch, "inv_set_search" );
// ***************************************************************************
// COMMON INVENTORIES Test if we can drop an item to a slot or a list
class CHandlerInvCanDropTo : public IActionHandler

View file

@ -83,9 +83,11 @@ namespace WEEKDAY
void CRyzomTime::updateRyzomClock(uint32 gameCyle)
{
static const uint32 ticksPerDay = (RYZOM_DAY_IN_HOUR * RYZOM_HOURS_IN_TICKS);
static const float ticksPerHour = (float)RYZOM_HOURS_IN_TICKS;
uint32 totalTicks = gameCyle + _TickOffset;
uint32 days = totalTicks / RYZOM_DAY_IN_TICKS;
uint32 dayCycle = totalTicks - (days * RYZOM_DAY_IN_TICKS);
// Avoid rollover for low amount of days

View file

@ -20,17 +20,16 @@
#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;
const uint RYZOM_HOUR_IN_MINUTES = 60;
const uint RYZOM_DAY_IN_TICKS = RYZOM_HOURS_IN_TICKS * RYZOM_DAY_IN_HOUR;
const uint RYZOM_SEASON_IN_DAY = 90;
const uint RYZOM_MONTH_IN_DAY = 30;
const uint RYZOM_YEAR_IN_MONTH = 48;
const uint RYZOM_WEEK_IN_DAY = 6;
const uint RYZOM_YEAR_IN_DAY = RYZOM_MONTH_IN_DAY*RYZOM_YEAR_IN_MONTH;
const uint RYZOM_CYCLE_IN_MONTH = 12;
const uint RYZOM_YEAR_IN_WEEK = 120;
const uint RYZOM_WEEK_IN_DAY = 4;
const uint RYZOM_YEAR_IN_DAY = RYZOM_WEEK_IN_DAY*RYZOM_YEAR_IN_WEEK;
const uint RYZOM_START_YEAR = 0;
const uint RYZOM_START_SPRING = 0;
@ -149,6 +148,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; }
@ -158,21 +160,9 @@ public:
// get Season
static inline ESeason getSeasonByDay(uint32 day) { return (ESeason) ( ( ( day % RYZOM_YEAR_IN_DAY ) / RYZOM_SEASON_IN_DAY ) % (EGSPD::CSeason::Invalid) ); }
// get ryzom month
inline uint getRyzomMonth() const { return ( _RyzomDay % RYZOM_YEAR_IN_DAY ) / RYZOM_MONTH_IN_DAY ; }
// get ryzom month in cycle
inline MONTH::EMonth getRyzomMonthInCurrentCycle() const { return (MONTH::EMonth) ( getRyzomMonth() % RYZOM_CYCLE_IN_MONTH ); }
// get ryzom cycle
inline uint32 getRyzomCycle() const { return getRyzomMonth() / RYZOM_CYCLE_IN_MONTH; }
// get ryzom day of week
inline WEEKDAY::EWeekDay getRyzomDayOfWeek() const { return (WEEKDAY::EWeekDay) ( _RyzomDay % RYZOM_WEEK_IN_DAY ); }
// get ryzom day of month
inline uint32 getRyzomDayOfMonth() const { return ( _RyzomDay % RYZOM_MONTH_IN_DAY ); }
// get ryzom day of season
inline uint32 getRyzomDayOfSeason() const { return ( _RyzomDay % RYZOM_SEASON_IN_DAY ); }

View file

@ -127,7 +127,6 @@ bool CFaunaGenericPlace::getActive() const
std::vector<std::string> dayIntervals;
NLMISC::explode(_DayInterval, std::string(","), dayIntervals, true);
std::string season = EGSPD::CSeason::toString(rt.getRyzomSeason());
std::string month = MONTH::toString((MONTH::EMonth) rt.getRyzomMonth());
std::string weekday = WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDay());
bool found = false;
for (uint k = 0; k < dayIntervals.size(); ++k)
@ -147,15 +146,6 @@ bool CFaunaGenericPlace::getActive() const
{
goodToken = true;
}
if (NLMISC::nlstricmp(dayIntervals[k], month) == 0)
{
found = true;
break;
}
if (MONTH::toMonth(dayIntervals[k]) != MONTH::UNKNOWN)
{
goodToken = true;
}
if (NLMISC::nlstricmp(dayIntervals[k], weekday) == 0)
{
found = true;

View file

@ -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;
@ -3065,17 +3065,15 @@ static void displayTime(const CRyzomTime &rt, NLMISC::CLog &log)
std::string result;
result = NLMISC::toString("hh:mm = %d:%d; ", (int) floorf(rt.getRyzomTime()) , (int) floorf(60.f * fmodf(rt.getRyzomTime(), 1.f)));
log.displayNL(result.c_str());
uint32 month = rt.getRyzomMonth();
MONTH::EMonth monthInCycle = rt.getRyzomMonthInCurrentCycle();
std::string monthName = MONTH::toString((MONTH::EMonth) monthInCycle);
uint32 dayOfMonth = rt.getRyzomDayOfMonth();
std::string dayName = WEEKDAY::toString((WEEKDAY::EWeekDay) rt.getRyzomDayOfWeek());
result = NLMISC::toString("mm:dd:yy = %d:%d:%d (%s:%s)",
(int) (month + 1),
(int) (dayOfMonth + 1),
(int) rt.getRyzomYear(),
monthName.c_str(),
dayName.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 = rt.getRyzomYearStr().toUtf8();
std::string eon = CI18N::get("uiEon").toUtf8();
result = NLMISC::toString("week:day:year:eon = %s:%s:%s:%s",
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());

View file

@ -830,11 +830,11 @@ public:
break;
case tm_monthday:
{
uint32 dom = CTimeInterface::getRyzomTime().getRyzomDayOfMonth();
/*uint32 dom = CTimeInterface::getRyzomTime().getRyzomDayOfMonth();
while (dom < _DayNumber)
dom += RYZOM_MONTH_IN_DAY;
_Min = _Max = timeTicks + dom * RYZOM_DAY_IN_TICKS;
_Min = _Max = timeTicks + dom * RYZOM_DAY_IN_TICKS;*/
}
break;
case tm_seasonday: