1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Separated battle control panel into new class, refactoring of

CGStatusBar to allow shared API with battle console
This commit is contained in:
Ivan Savenko
2022-11-18 17:54:10 +02:00
parent 3c5858f01e
commit 7a6ad671ab
20 changed files with 522 additions and 503 deletions

View File

@@ -15,6 +15,7 @@
#include "battle/CBattleInterface.h"
#include "battle/CBattleFieldController.h"
#include "battle/CBattleInterfaceClasses.h"
#include "battle/CBattleControlPanel.h"
#include "../CCallback.h"
#include "windows/CCastleInterface.h"
#include "gui/CCursorHandler.h"
@@ -1028,19 +1029,19 @@ void CPlayerInterface::battleAttack(const BattleAttack * ba)
if(ba->lucky()) //lucky hit
{
battleInt->console->addText(attacker->formatGeneralMessage(-45));
battleInt->controlPanel->console->addText(attacker->formatGeneralMessage(-45));
battleInt->displayEffect(18, attacker->getPosition());
CCS->soundh->playSound(soundBase::GOODLUCK);
}
if(ba->unlucky()) //unlucky hit
{
battleInt->console->addText(attacker->formatGeneralMessage(-44));
battleInt->controlPanel->console->addText(attacker->formatGeneralMessage(-44));
battleInt->displayEffect(48, attacker->getPosition());
CCS->soundh->playSound(soundBase::BADLUCK);
}
if(ba->deathBlow())
{
battleInt->console->addText(attacker->formatGeneralMessage(365));
battleInt->controlPanel->console->addText(attacker->formatGeneralMessage(365));
for(auto & elem : ba->bsa)
{
const CStack * attacked = cb->battleGetStackByID(elem.stackAttacked);