| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /*
- * 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"
- #include "../../lib/constants/EntityIdentifiers.h"
- class FilledTexturePlayerColored;
- class CButton;
- class CPicture;
- class CLabel;
- class CGHeroInstance;
- class CCreatureSet;
- class EditorCallback;
- class CMap;
- class BattleOnlyModeWindow;
- class CAnimImage;
- class GraphicalPrimitiveCanvas;
- class CTextInput;
- class TransparentFilledRectangle;
- class BattleOnlyMode
- {
- public:
- static void openBattleWindow();
- };
- class NumberInputWindow : public CWindowObject
- {
- std::shared_ptr<FilledTexturePlayerColored> backgroundTexture;
- std::shared_ptr<TransparentFilledRectangle> backgroundOverlay;
- std::shared_ptr<CButton> buttonOk;
- std::shared_ptr<CTextInput> input;
- public:
- NumberInputWindow(int initialValue, std::function<void(int)> onValueSelected);
- };
- 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;
- std::vector<std::shared_ptr<CLabel>> creatureImageLabel;
- void setHeroIcon();
- void setCreatureIcons();
- public:
- std::vector<std::shared_ptr<CAnimImage>> primSkills;
- std::vector<std::shared_ptr<GraphicalPrimitiveCanvas>> primSkillsBorder;
- std::vector<std::shared_ptr<CTextInput>> primSkillsInput;
- std::shared_ptr<CGHeroInstance> selectedHero;
- std::shared_ptr<CCreatureSet> selectedArmy;
- BattleOnlyModeHeroSelector(BattleOnlyModeWindow& parent, Point position);
- };
- class BattleOnlyModeWindow : public CWindowObject
- {
- friend class BattleOnlyModeHeroSelector;
- private:
- std::unique_ptr<CMap> map;
- std::shared_ptr<EditorCallback> cb;
- std::shared_ptr<FilledTexturePlayerColored> backgroundTexture;
- std::shared_ptr<CButton> buttonOk;
- std::shared_ptr<CButton> buttonAbort;
- std::shared_ptr<CLabel> title;
- std::shared_ptr<CButton> battlegroundSelector;
- std::shared_ptr<BattleOnlyModeHeroSelector> heroSelector1;
- std::shared_ptr<BattleOnlyModeHeroSelector> heroSelector2;
- TerrainId selectedTerrain;
- FactionID selectedTown;
- void init();
- void setTerrainButtonText();
- void setOkButtonEnabled();
- void startBattle();
- public:
- BattleOnlyModeWindow();
- };
|