atrooney-online-2/aocharbutton.h
Cerapter f217c68f85 The charselect's "shadows" correctly update based on what chars are taken.
This was purely a graphical bug. The characters were correctly
recognised as taken by the client, but there was no way to update the
"taken-shadow" over their icons.
Which meant that they were locked into the way they were when the user
first joined the server.

As a result of this, a `CharsCheck` package from the server will
correctly display the taken characters to the client in the character
selection.
2018-12-12 19:22:34 +01:00

45 lines
739 B
C++

#ifndef AOCHARBUTTON_H
#define AOCHARBUTTON_H
#include "aoapplication.h"
#include "aoimage.h"
#include <QPushButton>
#include <QString>
#include <QWidget>
#include <QFile>
class AOCharButton : public QPushButton
{
Q_OBJECT
public:
AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken);
AOApplication *ao_app;
void refresh();
void reset();
void set_taken(bool is_taken);
void set_passworded();
void apply_taken_image();
void set_image(QString p_character);
private:
bool taken;
QWidget *m_parent;
AOImage *ui_taken;
AOImage *ui_passworded;
AOImage *ui_selector;
protected:
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
};
#endif // AOCHARBUTTON_H