1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Renamed BattleControlPanel -> BattleWindow

This commit is contained in:
Ivan Savenko 2022-12-21 17:06:47 +02:00
parent c835a84051
commit 541d98143b
11 changed files with 54 additions and 54 deletions

View File

@ -4,7 +4,6 @@ set(client_SRCS
battle/BattleActionsController.cpp
battle/BattleAnimationClasses.cpp
battle/BattleControlPanel.cpp
battle/BattleEffectsController.cpp
battle/BattleFieldController.cpp
battle/BattleInterfaceClasses.cpp
@ -14,6 +13,7 @@ set(client_SRCS
battle/BattleRenderer.cpp
battle/BattleSiegeController.cpp
battle/BattleStacksController.cpp
battle/BattleWindow.cpp
battle/CreatureAnimation.cpp
gui/CAnimation.cpp
@ -88,7 +88,6 @@ set(client_HEADERS
battle/BattleActionsController.h
battle/BattleAnimationClasses.h
battle/BattleControlPanel.h
battle/BattleEffectsController.h
battle/BattleFieldController.h
battle/BattleInterfaceClasses.h
@ -98,6 +97,7 @@ set(client_HEADERS
battle/BattleRenderer.h
battle/BattleSiegeController.h
battle/BattleStacksController.h
battle/BattleWindow.h
battle/CreatureAnimation.h
battle/BattleConstants.h

View File

@ -16,7 +16,7 @@
#include "battle/BattleEffectsController.h"
#include "battle/BattleFieldController.h"
#include "battle/BattleInterfaceClasses.h"
#include "battle/BattleControlPanel.h"
#include "battle/BattleWindow.h"
#include "../CCallback.h"
#include "windows/CCastleInterface.h"
#include "gui/CCursorHandler.h"

View File

@ -10,7 +10,7 @@
#include "StdInc.h"
#include "BattleActionsController.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "BattleStacksController.h"
#include "BattleInterface.h"
#include "BattleFieldController.h"

View File

@ -11,7 +11,7 @@
#include "BattleEffectsController.h"
#include "BattleAnimationClasses.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "BattleInterface.h"
#include "BattleInterfaceClasses.h"
#include "BattleFieldController.h"

View File

@ -19,7 +19,7 @@
#include "BattleObstacleController.h"
#include "BattleSiegeController.h"
#include "BattleFieldController.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "BattleStacksController.h"
#include "BattleRenderer.h"
@ -90,7 +90,7 @@ BattleInterface::BattleInterface(const CCreatureSet *army1, const CCreatureSet *
if(town && town->hasFort())
siegeController.reset(new BattleSiegeController(*this, town));
windowObject = std::make_shared<BattleControlPanel>(*this);
windowObject = std::make_shared<BattleWindow>(*this);
projectilesController.reset(new BattleProjectileController(*this));
stacksController.reset( new BattleStacksController(*this));
actionsController.reset( new BattleActionsController(*this));

View File

@ -48,7 +48,7 @@ class BattleSiegeController;
class BattleObstacleController;
class BattleFieldController;
class BattleRenderer;
class BattleControlPanel;
class BattleWindow;
class BattleStacksController;
class BattleActionsController;
class BattleEffectsController;
@ -91,7 +91,7 @@ struct StackAttackInfo
class BattleInterface
{
private:
std::shared_ptr<BattleControlPanel> windowObject;
std::shared_ptr<BattleWindow> windowObject;
std::shared_ptr<BattleConsole> console;
std::shared_ptr<CPlayerInterface> tacticianInterface; //used during tactics mode, points to the interface of player with higher tactics (can be either attacker or defender in hot-seat), valid onloy for human players
@ -240,7 +240,7 @@ public:
friend class BattleSiegeController;
friend class BattleObstacleController;
friend class BattleFieldController;
friend class BattleControlPanel;
friend class BattleWindow;
friend class BattleStacksController;
friend class BattleActionsController;
friend class BattleEffectsController;

View File

@ -16,7 +16,7 @@
#include "BattleSiegeController.h"
#include "BattleFieldController.h"
#include "BattleStacksController.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "../CGameInfo.h"
#include "../CMessage.h"

View File

@ -13,7 +13,7 @@
#include "BattleInterface.h"
#include "BattleInterfaceClasses.h"
#include "BattleEffectsController.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "BattleSiegeController.h"
#include "BattleStacksController.h"
#include "BattleObstacleController.h"

View File

@ -18,7 +18,7 @@
#include "BattleFieldController.h"
#include "BattleEffectsController.h"
#include "BattleProjectileController.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "BattleRenderer.h"
#include "CreatureAnimation.h"

View File

@ -1,5 +1,5 @@
/*
* BattleControlPanel.cpp, part of VCMI engine
* BattleWindow.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
@ -8,7 +8,7 @@
*
*/
#include "StdInc.h"
#include "BattleControlPanel.h"
#include "BattleWindow.h"
#include "BattleInterface.h"
#include "BattleInterfaceClasses.h"
@ -34,7 +34,7 @@
#include "../../lib/CStack.h"
#include "../../lib/CConfigHandler.h"
BattleControlPanel::BattleControlPanel(BattleInterface & owner):
BattleWindow::BattleWindow(BattleInterface & owner):
owner(owner)
{
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
@ -49,15 +49,15 @@ BattleControlPanel::BattleControlPanel(BattleInterface & owner):
menuBattle->colorize(owner.curInt->playerID);
//preparing buttons and console
bOptions = std::make_shared<CButton> (Point( 3, 5 + 556), "icm003.def", CGI->generaltexth->zelp[381], std::bind(&BattleControlPanel::bOptionsf,this), SDLK_o);
bSurrender = std::make_shared<CButton> (Point( 54, 5 + 556), "icm001.def", CGI->generaltexth->zelp[379], std::bind(&BattleControlPanel::bSurrenderf,this), SDLK_s);
bFlee = std::make_shared<CButton> (Point(105, 5 + 556), "icm002.def", CGI->generaltexth->zelp[380], std::bind(&BattleControlPanel::bFleef,this), SDLK_r);
bAutofight = std::make_shared<CButton> (Point(158, 5 + 556), "icm004.def", CGI->generaltexth->zelp[382], std::bind(&BattleControlPanel::bAutofightf,this), SDLK_a);
bSpell = std::make_shared<CButton> (Point(645, 5 + 556), "icm005.def", CGI->generaltexth->zelp[385], std::bind(&BattleControlPanel::bSpellf,this), SDLK_c);
bWait = std::make_shared<CButton> (Point(696, 5 + 556), "icm006.def", CGI->generaltexth->zelp[386], std::bind(&BattleControlPanel::bWaitf,this), SDLK_w);
bDefence = std::make_shared<CButton> (Point(747, 5 + 556), "icm007.def", CGI->generaltexth->zelp[387], std::bind(&BattleControlPanel::bDefencef,this), SDLK_d);
bConsoleUp = std::make_shared<CButton> (Point(624, 5 + 556), "ComSlide.def", std::make_pair("", ""), std::bind(&BattleControlPanel::bConsoleUpf,this), SDLK_UP);
bConsoleDown = std::make_shared<CButton>(Point(624, 24 + 556), "ComSlide.def", std::make_pair("", ""), std::bind(&BattleControlPanel::bConsoleDownf,this), SDLK_DOWN);
bOptions = std::make_shared<CButton> (Point( 3, 5 + 556), "icm003.def", CGI->generaltexth->zelp[381], std::bind(&BattleWindow::bOptionsf,this), SDLK_o);
bSurrender = std::make_shared<CButton> (Point( 54, 5 + 556), "icm001.def", CGI->generaltexth->zelp[379], std::bind(&BattleWindow::bSurrenderf,this), SDLK_s);
bFlee = std::make_shared<CButton> (Point(105, 5 + 556), "icm002.def", CGI->generaltexth->zelp[380], std::bind(&BattleWindow::bFleef,this), SDLK_r);
bAutofight = std::make_shared<CButton> (Point(158, 5 + 556), "icm004.def", CGI->generaltexth->zelp[382], std::bind(&BattleWindow::bAutofightf,this), SDLK_a);
bSpell = std::make_shared<CButton> (Point(645, 5 + 556), "icm005.def", CGI->generaltexth->zelp[385], std::bind(&BattleWindow::bSpellf,this), SDLK_c);
bWait = std::make_shared<CButton> (Point(696, 5 + 556), "icm006.def", CGI->generaltexth->zelp[386], std::bind(&BattleWindow::bWaitf,this), SDLK_w);
bDefence = std::make_shared<CButton> (Point(747, 5 + 556), "icm007.def", CGI->generaltexth->zelp[387], std::bind(&BattleWindow::bDefencef,this), SDLK_d);
bConsoleUp = std::make_shared<CButton> (Point(624, 5 + 556), "ComSlide.def", std::make_pair("", ""), std::bind(&BattleWindow::bConsoleUpf,this), SDLK_UP);
bConsoleDown = std::make_shared<CButton>(Point(624, 24 + 556), "ComSlide.def", std::make_pair("", ""), std::bind(&BattleWindow::bConsoleDownf,this), SDLK_DOWN);
bDefence->assignedKeys.insert(SDLK_SPACE);
bConsoleUp->setImageOrder(0, 1, 0, 0);
@ -99,7 +99,7 @@ BattleControlPanel::BattleControlPanel(BattleInterface & owner):
addUsedEvents(RCLICK | KEYBOARD);
}
void BattleControlPanel::hideQueue()
void BattleWindow::hideQueue()
{
Settings showQueue = settings.write["battle"]["showQueue"];
showQueue->Bool() = false;
@ -113,7 +113,7 @@ void BattleControlPanel::hideQueue()
}
}
void BattleControlPanel::showQueue()
void BattleWindow::showQueue()
{
Settings showQueue = settings.write["battle"]["showQueue"];
showQueue->Bool() = true;
@ -127,24 +127,24 @@ void BattleControlPanel::showQueue()
}
}
void BattleControlPanel::updateQueue()
void BattleWindow::updateQueue()
{
queue->update();
}
void BattleControlPanel::activate()
void BattleWindow::activate()
{
CIntObject::activate();
LOCPLINT->cingconsole->activate();
}
void BattleControlPanel::deactivate()
void BattleWindow::deactivate()
{
CIntObject::deactivate();
LOCPLINT->cingconsole->deactivate();
}
void BattleControlPanel::keyPressed(const SDL_KeyboardEvent & key)
void BattleWindow::keyPressed(const SDL_KeyboardEvent & key)
{
if(key.keysym.sym == SDLK_q && key.state == SDL_PRESSED)
{
@ -167,13 +167,13 @@ void BattleControlPanel::keyPressed(const SDL_KeyboardEvent & key)
}
}
void BattleControlPanel::clickRight(tribool down, bool previousState)
void BattleWindow::clickRight(tribool down, bool previousState)
{
if (!down)
owner.actionsController->endCastingSpell();
}
void BattleControlPanel::tacticPhaseStarted()
void BattleWindow::tacticPhaseStarted()
{
menuBattle->disable();
console->disable();
@ -183,7 +183,7 @@ void BattleControlPanel::tacticPhaseStarted()
btactEnd->enable();
}
void BattleControlPanel::tacticPhaseEnded()
void BattleWindow::tacticPhaseEnded()
{
menuBattle->enable();
console->enable();
@ -193,7 +193,7 @@ void BattleControlPanel::tacticPhaseEnded()
btactEnd->disable();
}
void BattleControlPanel::bOptionsf()
void BattleWindow::bOptionsf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -203,7 +203,7 @@ void BattleControlPanel::bOptionsf()
GH.pushIntT<BattleOptionsWindow>(owner);
}
void BattleControlPanel::bSurrenderf()
void BattleWindow::bSurrenderf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -223,14 +223,14 @@ void BattleControlPanel::bSurrenderf()
}
}
void BattleControlPanel::bFleef()
void BattleWindow::bFleef()
{
if (owner.actionsController->spellcastingModeActive())
return;
if ( owner.curInt->cb->battleCanFlee() )
{
CFunctionList<void()> ony = std::bind(&BattleControlPanel::reallyFlee,this);
CFunctionList<void()> ony = std::bind(&BattleWindow::reallyFlee,this);
owner.curInt->showYesNoDialog(CGI->generaltexth->allTexts[28], ony, nullptr); //Are you sure you want to retreat?
}
else
@ -252,13 +252,13 @@ void BattleControlPanel::bFleef()
}
}
void BattleControlPanel::reallyFlee()
void BattleWindow::reallyFlee()
{
owner.giveCommand(EActionType::RETREAT);
CCS->curh->set(Cursor::Map::POINTER);
}
void BattleControlPanel::reallySurrender()
void BattleWindow::reallySurrender()
{
if (owner.curInt->cb->getResourceAmount(Res::GOLD) < owner.curInt->cb->battleGetSurrenderCost())
{
@ -271,7 +271,7 @@ void BattleControlPanel::reallySurrender()
}
}
void BattleControlPanel::bAutofightf()
void BattleWindow::bAutofightf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -298,7 +298,7 @@ void BattleControlPanel::bAutofightf()
}
}
void BattleControlPanel::bSpellf()
void BattleWindow::bSpellf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -340,7 +340,7 @@ void BattleControlPanel::bSpellf()
}
}
void BattleControlPanel::bWaitf()
void BattleWindow::bWaitf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -349,7 +349,7 @@ void BattleControlPanel::bWaitf()
owner.giveCommand(EActionType::WAIT);
}
void BattleControlPanel::bDefencef()
void BattleWindow::bDefencef()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -358,7 +358,7 @@ void BattleControlPanel::bDefencef()
owner.giveCommand(EActionType::DEFEND);
}
void BattleControlPanel::bConsoleUpf()
void BattleWindow::bConsoleUpf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -366,7 +366,7 @@ void BattleControlPanel::bConsoleUpf()
console->scrollUp();
}
void BattleControlPanel::bConsoleDownf()
void BattleWindow::bConsoleDownf()
{
if (owner.actionsController->spellcastingModeActive())
return;
@ -374,17 +374,17 @@ void BattleControlPanel::bConsoleDownf()
console->scrollDown();
}
void BattleControlPanel::bTacticNextStack()
void BattleWindow::bTacticNextStack()
{
owner.tacticNextStack(nullptr);
}
void BattleControlPanel::bTacticPhaseEnd()
void BattleWindow::bTacticPhaseEnd()
{
owner.tacticPhaseEnd();
}
void BattleControlPanel::blockUI(bool on)
void BattleWindow::blockUI(bool on)
{
bool canCastSpells = false;
auto hero = owner.curInt->cb->battleGetMyHero();
@ -424,7 +424,7 @@ void BattleControlPanel::blockUI(bool on)
bDefence->block(on || owner.tacticsMode);
}
void BattleControlPanel::showAll(SDL_Surface *to)
void BattleWindow::showAll(SDL_Surface *to)
{
CIntObject::showAll(to);
@ -432,7 +432,7 @@ void BattleControlPanel::showAll(SDL_Surface *to)
CMessage::drawBorder(owner.curInt->playerID, to, pos.w+28, pos.h+29, pos.x-14, pos.y-15);
}
void BattleControlPanel::show(SDL_Surface *to)
void BattleWindow::show(SDL_Surface *to)
{
CIntObject::show(to);
LOCPLINT->cingconsole->show(to);

View File

@ -1,5 +1,5 @@
/*
* BattleControlPanel.h, part of VCMI engine
* BattleWindow.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
@ -23,7 +23,7 @@ class BattleRenderer;
class StackQueue;
/// GUI object that handles functionality of panel at the bottom of combat screen
class BattleControlPanel : public WindowBase
class BattleWindow : public WindowBase
{
BattleInterface & owner;
@ -68,7 +68,7 @@ class BattleControlPanel : public WindowBase
void showQueue();
public:
BattleControlPanel(BattleInterface & owner );
BattleWindow(BattleInterface & owner );
/// Closes window once battle finished (explicit declaration to move into public visibility)
using WindowBase::close;