2025-10-18 21:43:05 +02:00
|
|
|
/*
|
2025-11-06 22:27:14 +01:00
|
|
|
* BattleOnlyModeTab.h, part of VCMI engine
|
2025-10-18 21:43:05 +02:00
|
|
|
*
|
|
|
|
|
* 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-11-06 20:43:25 +01:00
|
|
|
#include "../../lib/mapping/CMap.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;
|
2025-11-06 20:43:25 +01:00
|
|
|
class CMultiLineLabel;
|
|
|
|
|
class BattleOnlyModeTab;
|
2025-10-19 15:10:43 +02:00
|
|
|
class CAnimImage;
|
|
|
|
|
class GraphicalPrimitiveCanvas;
|
|
|
|
|
class CTextInput;
|
|
|
|
|
class TransparentFilledRectangle;
|
2025-11-08 19:05:57 +01:00
|
|
|
class CToggleButton;
|
2025-10-18 21:43:05 +02:00
|
|
|
|
2025-10-19 15:10:43 +02:00
|
|
|
class BattleOnlyModeHeroSelector : public CIntObject
|
|
|
|
|
{
|
|
|
|
|
private:
|
2025-11-06 20:43:25 +01:00
|
|
|
BattleOnlyModeTab& parent;
|
2025-10-19 15:10:43 +02:00
|
|
|
|
|
|
|
|
std::shared_ptr<CPicture> backgroundImage;
|
|
|
|
|
std::shared_ptr<CPicture> heroImage;
|
|
|
|
|
std::shared_ptr<CLabel> heroLabel;
|
|
|
|
|
std::vector<std::shared_ptr<CPicture>> creatureImage;
|
2025-11-08 19:05:57 +01:00
|
|
|
std::vector<std::shared_ptr<CPicture>> secSkillImage;
|
|
|
|
|
std::vector<std::shared_ptr<CPicture>> artifactImage;
|
|
|
|
|
|
|
|
|
|
std::vector<std::shared_ptr<CPicture>> addIcon;
|
2025-10-25 19:06:28 +02:00
|
|
|
|
|
|
|
|
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-11-08 19:05:57 +01:00
|
|
|
std::vector<std::shared_ptr<CTextInput>> selectedSecSkillInput;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<CToggleButton> spellBook;
|
|
|
|
|
std::shared_ptr<CToggleButton> warMachines;
|
2025-10-19 15:10:43 +02:00
|
|
|
|
2025-10-25 00:20:24 +02:00
|
|
|
void setHeroIcon();
|
|
|
|
|
void setCreatureIcons();
|
2025-11-08 19:05:57 +01:00
|
|
|
void setSecSkillIcons();
|
|
|
|
|
void setArtifactIcons();
|
2025-11-06 20:43:25 +01:00
|
|
|
BattleOnlyModeHeroSelector(int id, BattleOnlyModeTab& parent, Point position);
|
2025-10-19 15:10:43 +02:00
|
|
|
};
|
|
|
|
|
|
2025-11-06 20:43:25 +01:00
|
|
|
class BattleOnlyModeTab : public CIntObject
|
2025-10-18 21:43:05 +02:00
|
|
|
{
|
2025-10-19 15:10:43 +02:00
|
|
|
friend class BattleOnlyModeHeroSelector;
|
2025-10-18 21:43:05 +02:00
|
|
|
private:
|
2025-10-25 19:06:28 +02:00
|
|
|
std::shared_ptr<BattleOnlyModeStartInfo> startInfo;
|
2025-10-19 15:10:43 +02:00
|
|
|
std::unique_ptr<CMap> map;
|
|
|
|
|
std::shared_ptr<EditorCallback> cb;
|
|
|
|
|
|
2025-11-06 20:43:25 +01:00
|
|
|
std::shared_ptr<CPicture> backgroundImage;
|
2025-10-19 15:10:43 +02:00
|
|
|
std::shared_ptr<CLabel> title;
|
2025-11-06 20:43:25 +01:00
|
|
|
std::shared_ptr<CMultiLineLabel> subTitle;
|
2025-10-19 15:10:43 +02:00
|
|
|
|
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();
|
2025-10-18 21:43:05 +02:00
|
|
|
public:
|
2025-11-06 20:43:25 +01:00
|
|
|
BattleOnlyModeTab();
|
2025-10-25 20:41:39 +02:00
|
|
|
void applyStartInfo(std::shared_ptr<BattleOnlyModeStartInfo> si);
|
2025-11-07 00:07:32 +01:00
|
|
|
void startBattle();
|
|
|
|
|
void setStartButtonEnabled();
|
2025-10-19 15:10:43 +02:00
|
|
|
};
|