mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
More town hall code, started making building requirements.
This commit is contained in:
@@ -6,6 +6,30 @@
|
||||
#include "hch\CPreGameTextHandler.h"
|
||||
#include "hch/CTownHandler.h"
|
||||
#include "CLua.h"
|
||||
#include "CPlayerInterface.h"
|
||||
template <typename T=CAdvMapInt>
|
||||
class AdventureMapButton
|
||||
: public ClickableL, public ClickableR, public Hoverable, public KeyInterested, public CButtonBase
|
||||
{
|
||||
public:
|
||||
std::string name; //for status bar
|
||||
std::string helpBox; //for right-click help
|
||||
char key; //key shortcut
|
||||
T* owner;
|
||||
void (T::*function)(); //function in CAdvMapInt called when this button is pressed, different for each button
|
||||
bool colorChange;
|
||||
|
||||
void clickRight (tribool down);
|
||||
void clickLeft (tribool down);
|
||||
virtual void hover (bool on);
|
||||
void keyPressed (SDL_KeyboardEvent & key);
|
||||
void activate(); // makes button active
|
||||
void deactivate(); // makes button inactive (but doesn't delete)
|
||||
|
||||
AdventureMapButton(); //c-tor
|
||||
AdventureMapButton( std::string Name, std::string HelpBox, void(T::*Function)(), int x, int y, std::string defName, T* Owner, bool activ=false, std::vector<std::string> * add = NULL, bool playerColoredButton = true );//c-tor
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
AdventureMapButton<T>::AdventureMapButton ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user