GWF_PowerUpInjector/splashscreen.h

59 lines
1.6 KiB
C
Raw Normal View History

#ifndef SPLASHSCREEN_H
#define SPLASHSCREEN_H
#include <QSplashScreen>
#include <QTimer>
#include <QColor>
#include <QMouseEvent>
#include <QKeyEvent>
class SplashScreen : public QSplashScreen
{
Q_OBJECT
public:
explicit SplashScreen(QWidget *parent = nullptr);
~SplashScreen();
void setStatus(const QString &message);
void setProgress(int value, int max = 100);
void startAnimation();
void stopAnimation();
void finish(QWidget *mainWindow);
protected:
void drawContents(QPainter *painter) override;
void mousePressEvent(QMouseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
private slots:
void onAnimationTick();
private:
void drawBackground(QPainter *painter);
void drawGolfBall(QPainter *painter, int x, int y, int radius);
void drawPowerupIcons(QPainter *painter);
void drawTitle(QPainter *painter);
void drawProgressBar(QPainter *painter);
void drawStatusText(QPainter *painter);
QString mStatus;
int mProgress = 0;
int mProgressMax = 100;
QTimer *mAnimationTimer;
float mAnimationPhase = 0.0f; // For bouncing golf ball animation
// Theme colors - golf course green theme
QColor mGreenLight = QColor("#4CAF50"); // Light green
QColor mGreenDark = QColor("#2E7D32"); // Dark green
QColor mGold = QColor("#FFD700"); // Golden yellow for progress
QColor mWhite = QColor("#FFFFFF"); // White text
QColor mLightGray = QColor("#E0E0E0"); // Light gray for muted text
static constexpr int WIDTH = 480;
static constexpr int HEIGHT = 300;
};
#endif // SPLASHSCREEN_H