|
@@ -27,6 +27,7 @@
|
|
#include "../gui/WindowHandler.h"
|
|
#include "../gui/WindowHandler.h"
|
|
|
|
|
|
#include "../../CCallback.h"
|
|
#include "../../CCallback.h"
|
|
|
|
+#include "../../lib/CConfigHandler.h"
|
|
#include "../../lib/CGeneralTextHandler.h"
|
|
#include "../../lib/CGeneralTextHandler.h"
|
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
|
#include "../../lib/mapObjects/CGHeroInstance.h"
|
|
#include "../../lib/mapObjects/CGTownInstance.h"
|
|
#include "../../lib/mapObjects/CGTownInstance.h"
|
|
@@ -52,7 +53,7 @@ CInfoBar::VisibleHeroInfo::VisibleHeroInfo(const CGHeroInstance * hero)
|
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
|
background = std::make_shared<CPicture>("ADSTATHR");
|
|
background = std::make_shared<CPicture>("ADSTATHR");
|
|
|
|
|
|
- if(settings["gameTweaks"]["infoBoxCreatureManagement"].Bool())
|
|
|
|
|
|
+ if(settings["gameTweaks"]["infoBarCreatureManagement"].Bool())
|
|
heroTooltip = std::make_shared<CInteractableHeroTooltip>(Point(0,0), hero);
|
|
heroTooltip = std::make_shared<CInteractableHeroTooltip>(Point(0,0), hero);
|
|
else
|
|
else
|
|
heroTooltip = std::make_shared<CHeroTooltip>(Point(0,0), hero);
|
|
heroTooltip = std::make_shared<CHeroTooltip>(Point(0,0), hero);
|
|
@@ -63,7 +64,7 @@ CInfoBar::VisibleTownInfo::VisibleTownInfo(const CGTownInstance * town)
|
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
|
background = std::make_shared<CPicture>("ADSTATCS");
|
|
background = std::make_shared<CPicture>("ADSTATCS");
|
|
|
|
|
|
- if(settings["gameTweaks"]["infoBoxCreatureManagement"].Bool())
|
|
|
|
|
|
+ if(settings["gameTweaks"]["infoBarCreatureManagement"].Bool())
|
|
townTooltip = std::make_shared<CInteractableTownTooltip>(Point(0,0), town);
|
|
townTooltip = std::make_shared<CInteractableTownTooltip>(Point(0,0), town);
|
|
else
|
|
else
|
|
townTooltip = std::make_shared<CTownTooltip>(Point(0,0), town);
|
|
townTooltip = std::make_shared<CTownTooltip>(Point(0,0), town);
|
|
@@ -286,7 +287,7 @@ void CInfoBar::clickReleased(const Point & cursorPosition)
|
|
|
|
|
|
if(state == HERO || state == TOWN)
|
|
if(state == HERO || state == TOWN)
|
|
{
|
|
{
|
|
- if(settings["gameTweaks"]["infoBoxCreatureManagement"].Bool())
|
|
|
|
|
|
+ if(settings["gameTweaks"]["infoBarCreatureManagement"].Bool())
|
|
return;
|
|
return;
|
|
|
|
|
|
showGameStatus();
|
|
showGameStatus();
|
|
@@ -313,11 +314,13 @@ void CInfoBar::hover(bool on)
|
|
CInfoBar::CInfoBar(const Rect & position)
|
|
CInfoBar::CInfoBar(const Rect & position)
|
|
: CIntObject(LCLICK | SHOW_POPUP | HOVER, position.topLeft()),
|
|
: CIntObject(LCLICK | SHOW_POPUP | HOVER, position.topLeft()),
|
|
timerCounter(0),
|
|
timerCounter(0),
|
|
- state(EMPTY)
|
|
|
|
|
|
+ state(EMPTY),
|
|
|
|
+ listener(settings.listen["gameTweaks"]["infoBarCreatureManagement"])
|
|
{
|
|
{
|
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
|
OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE);
|
|
pos.w = position.w;
|
|
pos.w = position.w;
|
|
pos.h = position.h;
|
|
pos.h = position.h;
|
|
|
|
+ listener(std::bind(&CInfoBar::OnInfoBarCreatureManagementChanged, this));
|
|
reset();
|
|
reset();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -325,6 +328,10 @@ CInfoBar::CInfoBar(const Point & position): CInfoBar(Rect(position.x, position.y
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void CInfoBar::OnInfoBarCreatureManagementChanged()
|
|
|
|
+{
|
|
|
|
+ showSelection();
|
|
|
|
+}
|
|
|
|
|
|
void CInfoBar::setTimer(uint32_t msToTrigger)
|
|
void CInfoBar::setTimer(uint32_t msToTrigger)
|
|
{
|
|
{
|