initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "Cevo/CevoButtonBase.h"
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
enum {
|
||||
eotBlinkOff = -1,
|
||||
eotCancel = 0,
|
||||
eotGray = 1,
|
||||
eotBlinkOn = 2,
|
||||
eotBackToNego = 3,
|
||||
};
|
||||
|
||||
// TEOTButton equivalent: the End-Of-Turn button, animated by swapping
|
||||
// ButtonIndex between the eot* states above.
|
||||
class EOTButton : public ButtonBase {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EOTButton(QWidget *parent = nullptr);
|
||||
|
||||
Dpi::Bitmap *tmpl() const { return m_template; }
|
||||
void setTemplate(Dpi::Bitmap *value) { m_template = value; }
|
||||
int buttonIndex() const { return m_index; }
|
||||
void setButtonIndex(int value);
|
||||
// Immediately repaints (bypassing the event queue) if the index changed,
|
||||
// mirroring SetButtonIndexFast's use during time-critical animation.
|
||||
void setButtonIndexFast(int value);
|
||||
void setBack(Dpi::Canvas &canvas, int x, int y);
|
||||
|
||||
protected:
|
||||
void paint(Dpi::Canvas &canvas) override;
|
||||
|
||||
private:
|
||||
Dpi::Bitmap *m_template = nullptr;
|
||||
int m_index = -1;
|
||||
Dpi::Bitmap m_buffer;
|
||||
Dpi::Bitmap m_back;
|
||||
};
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user