2024-02-03 13:26:24 +02:00
|
|
|
/*
|
|
|
|
* CMarketWindow.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 "CTradeWindow.h"
|
|
|
|
#include "CAltarWindow.h"
|
|
|
|
|
2024-02-21 20:48:14 +02:00
|
|
|
class CArtifactsBuying;
|
2024-02-25 22:58:53 +02:00
|
|
|
class CArtifactsSelling;
|
2024-02-03 22:59:05 +02:00
|
|
|
class CFreelancerGuild;
|
2024-02-19 23:40:43 +02:00
|
|
|
class CMarketResources;
|
2024-02-21 20:48:14 +02:00
|
|
|
class CTransferResources;
|
2024-02-03 22:59:05 +02:00
|
|
|
|
|
|
|
class CMarketWindow : public CStatusbarWindow, public CAltarWindow // TODO remove CAltarWindow
|
2024-02-03 13:26:24 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMarketWindow(const IMarket * market, const CGHeroInstance * hero, const std::function<void()> & onWindowClosed, EMarketMode mode);
|
|
|
|
void resourceChanged();
|
|
|
|
void artifactsChanged();
|
2024-02-03 22:59:05 +02:00
|
|
|
void updateGarrisons() override;
|
2024-02-03 13:26:24 +02:00
|
|
|
void close() override;
|
|
|
|
const CGHeroInstance * getHero() const;
|
|
|
|
|
|
|
|
private:
|
2024-02-03 22:59:05 +02:00
|
|
|
void createChangeModeButtons(EMarketMode currentMode, const IMarket * market, const CGHeroInstance * hero);
|
2024-02-03 13:26:24 +02:00
|
|
|
void createInternals(EMarketMode mode, const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
|
|
|
|
void createArtifactsBuying(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createArtifactsSelling(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createMarketResources(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createFreelancersGuild(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createTransferResources(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createAltarArtifacts(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
void createAltarCreatures(const IMarket * market, const CGHeroInstance * hero);
|
|
|
|
|
|
|
|
const int buttonHeightWithMargin = 32 + 3;
|
|
|
|
const CGHeroInstance * hero;
|
|
|
|
std::vector<std::shared_ptr<CButton>> changeModeButtons;
|
|
|
|
std::shared_ptr<CButton> quitButton;
|
|
|
|
std::function<void()> windowClosedCallback;
|
|
|
|
const Point quitButtonPos = Point(516, 520);
|
|
|
|
|
|
|
|
std::shared_ptr<CMarketplaceWindow> market;
|
2024-02-03 22:59:05 +02:00
|
|
|
std::shared_ptr<CFreelancerGuild> guild;
|
2024-02-19 23:40:43 +02:00
|
|
|
std::shared_ptr<CMarketResources> resRes;
|
2024-02-21 20:48:14 +02:00
|
|
|
std::shared_ptr<CTransferResources> trRes;
|
|
|
|
std::shared_ptr<CArtifactsBuying> artsBuy;
|
2024-02-25 22:58:53 +02:00
|
|
|
std::shared_ptr<CArtifactsSelling> artsSel;
|
2024-02-03 22:59:05 +02:00
|
|
|
};
|