Changed: Remove map landmark limit

--HG--
branch : develop
This commit is contained in:
Nimetu 2017-04-07 12:43:33 +03:00
parent 59cd6afdb5
commit dda809d345
4 changed files with 4 additions and 23 deletions

View file

@ -1384,10 +1384,3 @@ void CContinent::releaseSky()
CurrentSky.release();
}
//=========================================================================
/*static*/ uint CContinent::getMaxNbUserLandMarks()
{
uint nbBonusLandmarks = (uint)IngameDbMngr.getProp( "INTERFACES:NB_BONUS_LANDMARKS" );
return STANDARD_NUM_USER_LANDMARKS + nbBonusLandmarks;
}

View file

@ -133,9 +133,6 @@ public:
};
const uint STANDARD_NUM_USER_LANDMARKS = 256; // not counting bonus landmarks
/**
* Class to manage the fog of war over a continent
* \author Matthieu 'Trap' Besson

View file

@ -851,14 +851,13 @@ void CGroupCompasMenu::setActive (bool state)
{
landMarkSubMenu->addSeparatorAtIndex(contLandMarkIndex++);
}
// User landmarks
uint nbUserLandMarks = std::min( uint(currCont->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks() );
// User landmarks
// Sort the landmarks
std::vector<CUserLandMark> sortedLandmarks(currCont->UserLandMarks);
std::sort(sortedLandmarks.begin(), sortedLandmarks.end(), UserLandMarksSortPredicate);
for(k = 0; k < nbUserLandMarks; ++k)
for(k = 0; k < sortedLandmarks.size(); ++k)
{
if (sortedLandmarks[k].Type < CUserLandMark::UserLandMarkTypeCount)
{

View file

@ -2391,9 +2391,8 @@ void CGroupMap::createContinentLandMarks()
// Continent Landmarks
createLMWidgets(_CurContinent->ContLandMarks);
uint nbUserLandMarks = std::min( uint(_CurContinent->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks());
// User Landmarks
for(k = 0; k < nbUserLandMarks; ++k)
for(k = 0; k < _CurContinent->UserLandMarks.size(); ++k)
{
NLMISC::CVector2f mapPos;
worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos);
@ -2431,8 +2430,7 @@ void CGroupMap::updateUserLandMarks()
removeLandMarks(_UserLM);
// Re create User Landmarks
uint nbUserLandMarks = std::min( uint(_CurContinent->UserLandMarks.size()), CContinent::getMaxNbUserLandMarks());
for(k = 0; k < nbUserLandMarks; ++k)
for(k = 0; k < _CurContinent->UserLandMarks.size(); ++k)
{
NLMISC::CVector2f mapPos;
worldToMap(mapPos, _CurContinent->UserLandMarks[k].Pos);
@ -3263,12 +3261,6 @@ void createUserLandMark(CCtrlBase * /* pCaller */, const string &/* params */)
// pop the rename dialog
LastClickedMap = dynamic_cast<CGroupMap *>(CWidgetManager::getInstance()->getCtrlLaunchingModal());
if (LastClickedMap->isInDeathMode()) return;
if (LastClickedMap->getNumUserLandMarks() >= CContinent::getMaxNbUserLandMarks() )
{
// too many landmark, can't create
im->displaySystemInfo(CI18N::get("uiNoMoreLandMarks"), "CHK");
return;
}
LastSelectedLandMark = NULL;
popupLandMarkNameDialog();
}