1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00
Files
vcmi/client/lobby/BattleOnlyMode.h

93 lines
2.2 KiB
C++
Raw Normal View History

2025-10-18 21:43:05 +02:00
/*
* BattleOnlyMode.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../windows/CWindowObject.h"
2025-10-19 15:10:43 +02:00
#include "../../lib/constants/EntityIdentifiers.h"
2025-10-18 21:43:05 +02:00
2025-10-24 01:15:43 +02:00
VCMI_LIB_NAMESPACE_BEGIN
class CGHeroInstance;
class CCreatureSet;
class CMap;
class EditorCallback;
2025-10-25 20:41:39 +02:00
class BattleOnlyModeStartInfo;
2025-10-24 01:15:43 +02:00
VCMI_LIB_NAMESPACE_END
2025-10-18 21:43:05 +02:00
class FilledTexturePlayerColored;
class CButton;
2025-10-19 15:10:43 +02:00
class CPicture;
class CLabel;
class BattleOnlyModeWindow;
class CAnimImage;
class GraphicalPrimitiveCanvas;
class CTextInput;
class TransparentFilledRectangle;
2025-10-18 21:43:05 +02:00
class BattleOnlyMode
{
public:
static void openBattleWindow();
};
2025-10-19 15:10:43 +02:00
class BattleOnlyModeHeroSelector : public CIntObject
{
private:
BattleOnlyModeWindow& parent;
std::shared_ptr<CPicture> backgroundImage;
std::shared_ptr<CPicture> heroImage;
std::shared_ptr<CLabel> heroLabel;
std::vector<std::shared_ptr<CPicture>> creatureImage;
int id;
2025-10-19 15:10:43 +02:00
public:
std::vector<std::shared_ptr<CAnimImage>> primSkills;
std::vector<std::shared_ptr<GraphicalPrimitiveCanvas>> primSkillsBorder;
std::vector<std::shared_ptr<CTextInput>> primSkillsInput;
2025-10-25 00:20:24 +02:00
std::vector<std::shared_ptr<CTextInput>> selectedArmyInput;
2025-10-19 15:10:43 +02:00
2025-10-25 00:20:24 +02:00
void setHeroIcon();
void setCreatureIcons();
BattleOnlyModeHeroSelector(int id, BattleOnlyModeWindow& parent, Point position);
2025-10-19 15:10:43 +02:00
};
2025-10-18 21:43:05 +02:00
class BattleOnlyModeWindow : public CWindowObject
{
2025-10-19 15:10:43 +02:00
friend class BattleOnlyModeHeroSelector;
2025-10-18 21:43:05 +02:00
private:
std::shared_ptr<BattleOnlyModeStartInfo> startInfo;
2025-10-19 15:10:43 +02:00
std::unique_ptr<CMap> map;
std::shared_ptr<EditorCallback> cb;
2025-10-18 21:43:05 +02:00
std::shared_ptr<FilledTexturePlayerColored> backgroundTexture;
std::shared_ptr<CButton> buttonOk;
std::shared_ptr<CButton> buttonAbort;
2025-10-19 15:10:43 +02:00
std::shared_ptr<CLabel> title;
2025-10-25 13:21:58 +02:00
std::shared_ptr<CButton> battlefieldSelector;
2025-10-25 00:20:24 +02:00
std::shared_ptr<CButton> buttonReset;
2025-10-19 15:10:43 +02:00
std::shared_ptr<BattleOnlyModeHeroSelector> heroSelector1;
std::shared_ptr<BattleOnlyModeHeroSelector> heroSelector2;
2025-10-18 21:43:05 +02:00
2025-10-26 01:02:51 +02:00
ColorRGBA disabledColor;
2025-10-19 15:10:43 +02:00
void init();
2025-10-25 20:41:39 +02:00
void onChange();
2025-10-25 21:44:13 +02:00
void update();
2025-10-19 15:10:43 +02:00
void setTerrainButtonText();
void setOkButtonEnabled();
2025-10-18 21:43:05 +02:00
void startBattle();
public:
BattleOnlyModeWindow();
2025-10-25 20:41:39 +02:00
void applyStartInfo(std::shared_ptr<BattleOnlyModeStartInfo> si);
2025-10-19 15:10:43 +02:00
};