|
@@ -126,9 +126,11 @@ CBonusSelection::CBonusSelection()
|
|
for(auto scenarioID : getCampaign()->allScenarios())
|
|
for(auto scenarioID : getCampaign()->allScenarios())
|
|
{
|
|
{
|
|
if(getCampaign()->isAvailable(scenarioID))
|
|
if(getCampaign()->isAvailable(scenarioID))
|
|
- regions.push_back(std::make_shared<CRegion>(scenarioID, true, true, getCampaign()->getRegions()));
|
|
|
|
|
|
+ regions.push_back(std::make_shared<CRegion>(scenarioID, true, true, false, getCampaign()->getRegions()));
|
|
else if(getCampaign()->isConquered(scenarioID)) //display as striped
|
|
else if(getCampaign()->isConquered(scenarioID)) //display as striped
|
|
- regions.push_back(std::make_shared<CRegion>(scenarioID, false, false, getCampaign()->getRegions()));
|
|
|
|
|
|
+ regions.push_back(std::make_shared<CRegion>(scenarioID, false, false, false, getCampaign()->getRegions()));
|
|
|
|
+ else
|
|
|
|
+ regions.push_back(std::make_shared<CRegion>(scenarioID, false, false, true, getCampaign()->getRegions()));
|
|
}
|
|
}
|
|
|
|
|
|
if (!getCampaign()->getMusic().empty())
|
|
if (!getCampaign()->getMusic().empty())
|
|
@@ -476,8 +478,8 @@ void CBonusSelection::decreaseDifficulty()
|
|
CSH->setDifficulty(CSH->si->difficulty - 1);
|
|
CSH->setDifficulty(CSH->si->difficulty - 1);
|
|
}
|
|
}
|
|
|
|
|
|
-CBonusSelection::CRegion::CRegion(CampaignScenarioID id, bool accessible, bool selectable, const CampaignRegions & campDsc)
|
|
|
|
- : CIntObject(LCLICK | SHOW_POPUP), idOfMapAndRegion(id), accessible(accessible), selectable(selectable)
|
|
|
|
|
|
+CBonusSelection::CRegion::CRegion(CampaignScenarioID id, bool accessible, bool selectable, bool labelOnly, const CampaignRegions & campDsc)
|
|
|
|
+ : CIntObject(LCLICK | SHOW_POPUP), idOfMapAndRegion(id), accessible(accessible), selectable(selectable), labelOnly(labelOnly)
|
|
{
|
|
{
|
|
OBJECT_CONSTRUCTION;
|
|
OBJECT_CONSTRUCTION;
|
|
|
|
|
|
@@ -493,10 +495,17 @@ CBonusSelection::CRegion::CRegion(CampaignScenarioID id, bool accessible, bool s
|
|
graphicsStriped->disable();
|
|
graphicsStriped->disable();
|
|
pos.w = graphicsNotSelected->pos.w;
|
|
pos.w = graphicsNotSelected->pos.w;
|
|
pos.h = graphicsNotSelected->pos.h;
|
|
pos.h = graphicsNotSelected->pos.h;
|
|
|
|
+
|
|
|
|
+ auto labelPos = campDsc.getLabelPosition(id);
|
|
|
|
+ if(labelPos)
|
|
|
|
+ label = std::make_shared<CLabel>((*labelPos).x, (*labelPos).y, FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, CSH->si->campState->scenario(idOfMapAndRegion).scenarioName.toString());
|
|
}
|
|
}
|
|
|
|
|
|
void CBonusSelection::CRegion::updateState()
|
|
void CBonusSelection::CRegion::updateState()
|
|
{
|
|
{
|
|
|
|
+ if(labelOnly)
|
|
|
|
+ return;
|
|
|
|
+
|
|
if(!accessible)
|
|
if(!accessible)
|
|
{
|
|
{
|
|
graphicsNotSelected->disable();
|
|
graphicsNotSelected->disable();
|
|
@@ -519,7 +528,7 @@ void CBonusSelection::CRegion::updateState()
|
|
|
|
|
|
void CBonusSelection::CRegion::clickReleased(const Point & cursorPosition)
|
|
void CBonusSelection::CRegion::clickReleased(const Point & cursorPosition)
|
|
{
|
|
{
|
|
- if(selectable && !graphicsNotSelected->getSurface()->isTransparent(cursorPosition - pos.topLeft()))
|
|
|
|
|
|
+ if(!labelOnly && selectable && !graphicsNotSelected->getSurface()->isTransparent(cursorPosition - pos.topLeft()))
|
|
{
|
|
{
|
|
CSH->setCampaignMap(idOfMapAndRegion);
|
|
CSH->setCampaignMap(idOfMapAndRegion);
|
|
}
|
|
}
|
|
@@ -529,7 +538,7 @@ void CBonusSelection::CRegion::showPopupWindow(const Point & cursorPosition)
|
|
{
|
|
{
|
|
// FIXME: For some reason "down" is only ever contain indeterminate_value
|
|
// FIXME: For some reason "down" is only ever contain indeterminate_value
|
|
auto & text = CSH->si->campState->scenario(idOfMapAndRegion).regionText;
|
|
auto & text = CSH->si->campState->scenario(idOfMapAndRegion).regionText;
|
|
- if(!graphicsNotSelected->getSurface()->isTransparent(cursorPosition - pos.topLeft()) && !text.empty())
|
|
|
|
|
|
+ if(!labelOnly && !graphicsNotSelected->getSurface()->isTransparent(cursorPosition - pos.topLeft()) && !text.empty())
|
|
{
|
|
{
|
|
CRClickPopup::createAndPush(text.toString());
|
|
CRClickPopup::createAndPush(text.toString());
|
|
}
|
|
}
|