mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-25 16:46:17 +00:00
Changed: Remove map landmark limit
--HG-- branch : develop
This commit is contained in:
parent
59cd6afdb5
commit
dda809d345
4 changed files with 4 additions and 23 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue