From e4cb1430389185bb4538efe0f72a1c95bbe366c5 Mon Sep 17 00:00:00 2001 From: compil Date: Fri, 3 Nov 2017 23:07:35 +0100 Subject: [PATCH] correction du merge --- .../src/interface_v3/interface_manager.cpp | 17 +++++------- .../src/interface_v3/inventory_manager.cpp | 2 ++ .../time_weather_season/time_and_season.cpp | 2 ++ .../time_weather_season/time_and_season.h | 26 ++++++------------- code/ryzom/server/src/ai_service/ai_place.cpp | 10 ------- code/ryzom/server/src/ai_service/commands.cpp | 22 +++++++--------- .../src/ai_service/generic_logic_action.cpp | 4 +-- 7 files changed, 31 insertions(+), 52 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index d7ea3ba8c..483978d90 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -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(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(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(); - } // ------------------------------------------------------------------------------------------------ diff --git a/code/ryzom/client/src/interface_v3/inventory_manager.cpp b/code/ryzom/client/src/interface_v3/inventory_manager.cpp index 1ab8fe1f3..f3a6c688c 100644 --- a/code/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/code/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -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 diff --git a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.cpp b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.cpp index b42ddb398..541456859 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.cpp +++ b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.cpp @@ -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 diff --git a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h index 17085efd6..f74f37a8a 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h +++ b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h @@ -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; @@ -87,7 +86,7 @@ namespace WEEKDAY Reldei, Cibdei, Vondei, - + UNKNOWN, NUM_WEEKDAY = UNKNOWN }; @@ -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 ); } diff --git a/code/ryzom/server/src/ai_service/ai_place.cpp b/code/ryzom/server/src/ai_service/ai_place.cpp index e000fc4d5..4db05d0c4 100644 --- a/code/ryzom/server/src/ai_service/ai_place.cpp +++ b/code/ryzom/server/src/ai_service/ai_place.cpp @@ -127,7 +127,6 @@ bool CFaunaGenericPlace::getActive() const std::vector 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; diff --git a/code/ryzom/server/src/ai_service/commands.cpp b/code/ryzom/server/src/ai_service/commands.cpp index 0cea6f93c..9ddf5c4ac 100644 --- a/code/ryzom/server/src/ai_service/commands.cpp +++ b/code/ryzom/server/src/ai_service/commands.cpp @@ -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()); diff --git a/code/ryzom/server/src/ai_service/generic_logic_action.cpp b/code/ryzom/server/src/ai_service/generic_logic_action.cpp index a7c01d5ef..3cd78b506 100644 --- a/code/ryzom/server/src/ai_service/generic_logic_action.cpp +++ b/code/ryzom/server/src/ai_service/generic_logic_action.cpp @@ -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: