mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Remove unnecessary includes from headers
This commit is contained in:
@@ -8,12 +8,13 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include "../../lib/mapping/CCampaignHandler.h"
|
||||
|
||||
#include "../windows/CWindowObject.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
class CCampaignState;
|
||||
struct CampaignRegions;
|
||||
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "../../CCallback.h"
|
||||
|
||||
#include "../CGameInfo.h"
|
||||
#include "../../lib/CModHandler.h"
|
||||
#include "../../lib/NetPacksLobby.h"
|
||||
#include "../../lib/CGeneralTextHandler.h"
|
||||
#include "../../lib/mapping/CMapInfo.h"
|
||||
@@ -134,7 +135,7 @@ void CLobbyScreen::startScenario(bool allowOnlyAI)
|
||||
{
|
||||
logGlobal->warn("Incompatibility exception during start scenario: %s", e.what());
|
||||
|
||||
auto errorMsg = VLC->generaltexth->translate("vcmi.server.errors.modsIncompatibility") + '\n';
|
||||
auto errorMsg = CGI->generaltexth->translate("vcmi.server.errors.modsIncompatibility") + '\n';
|
||||
errorMsg += e.what();
|
||||
|
||||
CInfoWindow::showInfoDialog(errorMsg, CInfoWindow::TCompsInfo(), PlayerColor(1));
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "../../lib/CGeneralTextHandler.h"
|
||||
#include "../../lib/StartInfo.h"
|
||||
#include "../../lib/mapping/CMapInfo.h"
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
|
||||
CScenarioInfoScreen::CScenarioInfoScreen()
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "../../lib/CThreadHelper.h"
|
||||
#include "../../lib/filesystem/Filesystem.h"
|
||||
#include "../../lib/mapping/CMapInfo.h"
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
#include "../../lib/serializer/Connection.h"
|
||||
|
||||
ISelectionScreenInfo::ISelectionScreenInfo(ESelectionScreen ScreenType)
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*
|
||||
*/
|
||||
#include "StdInc.h"
|
||||
#include "OptionsTab.h"
|
||||
|
||||
#include "CSelectionBase.h"
|
||||
#include "OptionsTab.h"
|
||||
|
||||
#include "../CGameInfo.h"
|
||||
#include "../CServerHandler.h"
|
||||
@@ -441,13 +441,15 @@ void OptionsTab::SelectedBox::clickRight(tribool down, bool previousState)
|
||||
}
|
||||
|
||||
OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, const OptionsTab & parent)
|
||||
: pi(SEL->getPlayerInfo(S.color.getNum())), s(S), parentTab(parent)
|
||||
: pi(std::make_unique<PlayerInfo>(SEL->getPlayerInfo(S.color.getNum())))
|
||||
, s(std::make_unique<PlayerSettings>(S))
|
||||
, parentTab(parent)
|
||||
{
|
||||
OBJ_CONSTRUCTION;
|
||||
defActions |= SHARE_POS;
|
||||
|
||||
int serial = 0;
|
||||
for(int g = 0; g < s.color.getNum(); ++g)
|
||||
for(int g = 0; g < s->color.getNum(); ++g)
|
||||
{
|
||||
auto itred = SEL->getPlayerInfo(g);
|
||||
if(itred.canComputerPlay || itred.canHumanPlay)
|
||||
@@ -458,7 +460,7 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
|
||||
pos.y += 122 + serial * 50;
|
||||
|
||||
assert(CSH->mi && CSH->mi->mapHeader);
|
||||
const PlayerInfo & p = SEL->getPlayerInfo(s.color.getNum());
|
||||
const PlayerInfo & p = SEL->getPlayerInfo(s->color.getNum());
|
||||
assert(p.canComputerPlay || p.canHumanPlay); //someone must be able to control this player
|
||||
if(p.canHumanPlay && p.canComputerPlay)
|
||||
whoCanPlay = HUMAN_OR_CPU;
|
||||
@@ -478,29 +480,29 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
|
||||
"ADOPOPNL.bmp", "ADOPPPNL.bmp", "ADOPTPNL.bmp", "ADOPSPNL.bmp"
|
||||
}};
|
||||
|
||||
background = std::make_shared<CPicture>(bgs[s.color.getNum()], 0, 0);
|
||||
labelPlayerName = std::make_shared<CLabel>(55, 10, EFonts::FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, s.name);
|
||||
background = std::make_shared<CPicture>(bgs[s->color.getNum()], 0, 0);
|
||||
labelPlayerName = std::make_shared<CLabel>(55, 10, EFonts::FONT_SMALL, ETextAlignment::CENTER, Colors::WHITE, s->name);
|
||||
labelWhoCanPlay = std::make_shared<CMultiLineLabel>(Rect(6, 23, 45, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->arraytxt[206 + whoCanPlay]);
|
||||
|
||||
if(SEL->screenType == ESelectionScreen::newGame)
|
||||
{
|
||||
buttonTownLeft = std::make_shared<CButton>(Point(107, 5), "ADOPLFA.DEF", CGI->generaltexth->zelp[132], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, -1, s.color));
|
||||
buttonTownRight = std::make_shared<CButton>(Point(168, 5), "ADOPRTA.DEF", CGI->generaltexth->zelp[133], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, +1, s.color));
|
||||
buttonHeroLeft = std::make_shared<CButton>(Point(183, 5), "ADOPLFA.DEF", CGI->generaltexth->zelp[148], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, -1, s.color));
|
||||
buttonHeroRight = std::make_shared<CButton>(Point(244, 5), "ADOPRTA.DEF", CGI->generaltexth->zelp[149], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, +1, s.color));
|
||||
buttonBonusLeft = std::make_shared<CButton>(Point(259, 5), "ADOPLFA.DEF", CGI->generaltexth->zelp[164], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, -1, s.color));
|
||||
buttonBonusRight = std::make_shared<CButton>(Point(320, 5), "ADOPRTA.DEF", CGI->generaltexth->zelp[165], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, +1, s.color));
|
||||
buttonTownLeft = std::make_shared<CButton>(Point(107, 5), "ADOPLFA.DEF", CGI->generaltexth->zelp[132], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, -1, s->color));
|
||||
buttonTownRight = std::make_shared<CButton>(Point(168, 5), "ADOPRTA.DEF", CGI->generaltexth->zelp[133], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::TOWN, +1, s->color));
|
||||
buttonHeroLeft = std::make_shared<CButton>(Point(183, 5), "ADOPLFA.DEF", CGI->generaltexth->zelp[148], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, -1, s->color));
|
||||
buttonHeroRight = std::make_shared<CButton>(Point(244, 5), "ADOPRTA.DEF", CGI->generaltexth->zelp[149], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::HERO, +1, s->color));
|
||||
buttonBonusLeft = std::make_shared<CButton>(Point(259, 5), "ADOPLFA.DEF", CGI->generaltexth->zelp[164], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, -1, s->color));
|
||||
buttonBonusRight = std::make_shared<CButton>(Point(320, 5), "ADOPRTA.DEF", CGI->generaltexth->zelp[165], std::bind(&IServerAPI::setPlayerOption, CSH, LobbyChangePlayerOption::BONUS, +1, s->color));
|
||||
}
|
||||
|
||||
hideUnavailableButtons();
|
||||
|
||||
if(SEL->screenType != ESelectionScreen::scenarioInfo && SEL->getPlayerInfo(s.color.getNum()).canHumanPlay)
|
||||
if(SEL->screenType != ESelectionScreen::scenarioInfo && SEL->getPlayerInfo(s->color.getNum()).canHumanPlay)
|
||||
{
|
||||
flag = std::make_shared<CButton>(
|
||||
Point(-43, 2),
|
||||
flags[s.color.getNum()],
|
||||
flags[s->color.getNum()],
|
||||
CGI->generaltexth->zelp[180],
|
||||
std::bind(&OptionsTab::onSetPlayerClicked, &parentTab, s)
|
||||
std::bind(&OptionsTab::onSetPlayerClicked, &parentTab, *s)
|
||||
);
|
||||
flag->hoverable = true;
|
||||
flag->block(CSH->isGuest());
|
||||
@@ -508,9 +510,9 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
|
||||
else
|
||||
flag = nullptr;
|
||||
|
||||
town = std::make_shared<SelectedBox>(Point(119, 2), s, TOWN);
|
||||
hero = std::make_shared<SelectedBox>(Point(195, 2), s, HERO);
|
||||
bonus = std::make_shared<SelectedBox>(Point(271, 2), s, BONUS);
|
||||
town = std::make_shared<SelectedBox>(Point(119, 2), *s, TOWN);
|
||||
hero = std::make_shared<SelectedBox>(Point(195, 2), *s, HERO);
|
||||
bonus = std::make_shared<SelectedBox>(Point(271, 2), *s, BONUS);
|
||||
}
|
||||
|
||||
void OptionsTab::onSetPlayerClicked(const PlayerSettings & ps) const
|
||||
@@ -524,9 +526,9 @@ void OptionsTab::PlayerOptionsEntry::hideUnavailableButtons()
|
||||
if(!buttonTownLeft)
|
||||
return;
|
||||
|
||||
const bool foreignPlayer = CSH->isGuest() && !CSH->isMyColor(s.color);
|
||||
const bool foreignPlayer = CSH->isGuest() && !CSH->isMyColor(s->color);
|
||||
|
||||
if((pi.allowedFactions.size() < 2 && !pi.isFactionRandom) || foreignPlayer)
|
||||
if((pi->allowedFactions.size() < 2 && !pi->isFactionRandom) || foreignPlayer)
|
||||
{
|
||||
buttonTownLeft->disable();
|
||||
buttonTownRight->disable();
|
||||
@@ -537,7 +539,7 @@ void OptionsTab::PlayerOptionsEntry::hideUnavailableButtons()
|
||||
buttonTownRight->enable();
|
||||
}
|
||||
|
||||
if((pi.defaultHero() != -1 || s.castle < 0) //fixed hero
|
||||
if((pi->defaultHero() != -1 || s->castle < 0) //fixed hero
|
||||
|| foreignPlayer) //or not our player
|
||||
{
|
||||
buttonHeroLeft->disable();
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../lib/StartInfo.h"
|
||||
#include "../../lib/mapping/CMap.h"
|
||||
#include "../windows/CWindowObject.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
struct PlayerSettings;
|
||||
struct PlayerInfo;
|
||||
VCMI_LIB_NAMESPACE_END
|
||||
|
||||
class CSlider;
|
||||
class CLabel;
|
||||
@@ -18,6 +22,9 @@ class CMultiLineLabel;
|
||||
class CFilledTexture;
|
||||
class CAnimImage;
|
||||
class CComponentBox;
|
||||
class CTextBox;
|
||||
class CButton;
|
||||
|
||||
/// The options tab which is shown at the map selection phase.
|
||||
class OptionsTab : public CIntObject
|
||||
{
|
||||
@@ -99,8 +106,8 @@ public:
|
||||
|
||||
struct PlayerOptionsEntry : public CIntObject
|
||||
{
|
||||
PlayerInfo pi;
|
||||
PlayerSettings s;
|
||||
std::unique_ptr<PlayerInfo> pi;
|
||||
std::unique_ptr<PlayerSettings> s;
|
||||
std::shared_ptr<CLabel> labelPlayerName;
|
||||
std::shared_ptr<CMultiLineLabel> labelWhoCanPlay;
|
||||
std::shared_ptr<CPicture> background;
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../CRandomGenerator.h"
|
||||
#include "CMapEditManager.h"
|
||||
#include "CMapOperation.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "../spells/CSpellHandler.h"
|
||||
#include "../CSkillHandler.h"
|
||||
#include "CMapEditManager.h"
|
||||
#include "CMapOperation.h"
|
||||
#include "../serializer/JsonSerializeFormat.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@@ -11,14 +11,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "../GameConstants.h"
|
||||
#include "CMapOperation.h"
|
||||
#include "../CRandomGenerator.h"
|
||||
#include "MapEditUtils.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
class CGObjectInstance;
|
||||
class CTerrainViewPatternConfig;
|
||||
struct TerrainViewPattern;
|
||||
class CMap;
|
||||
class CMapOperation;
|
||||
|
||||
/// The CMapUndoManager provides the functionality to save operations and undo/redo them.
|
||||
class DLL_LINKAGE CMapUndoManager : boost::noncopyable
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../int3.h"
|
||||
#include "../CRandomGenerator.h"
|
||||
#include "../GameConstants.h"
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
@@ -114,7 +114,7 @@ MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesWOG()
|
||||
MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesHOTA(uint32_t hotaVersion)
|
||||
{
|
||||
// even if changes are minimal, we might not be able to parse map header in map selection screen
|
||||
// throw exception - to be cached by map selection screen & excluded as invalid
|
||||
// throw exception - to be catched by map selection screen & excluded as invalid
|
||||
if(hotaVersion > 3)
|
||||
throw std::runtime_error("Invalid map format!");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user