Add a coffee break

Every so often a mug appears at the cat's nose, it sits down, dips its head in
and takes a few slow sips while steam rises. M01, optional stop.

The mug lives in its own click-through window like the chip, or inside the
overlay on Wayland. It goes away as soon as the cat is petted, dragged, sent to
sleep or moves on to something else, so no mug is ever left standing.

Also renames OverlayWindow's mode flag, which shadowed QWindow::active.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
JulianandClaude Opus 5 committed 2026-09-10 23:00:22 +02:00
1 parent 0f1df75a1d
commit 403ac30b3a
14 files changed
+283 -18

No files matched your search

+12 -1
View File
@@ -30,9 +30,11 @@ class CatController : public QObject
Q_PROPERTY(bool chipVisible READ chipVisible NOTIFY chipVisibleChanged)
Q_PROPERTY(qreal chipX READ chipX NOTIFY chipXChanged)
Q_PROPERTY(int chipKick READ chipKick NOTIFY chipKickChanged)
Q_PROPERTY(bool cupVisible READ cupVisible NOTIFY cupVisibleChanged)
Q_PROPERTY(qreal cupX READ cupX NOTIFY cupXChanged)
public:
enum class Mood { Walking, Running, Sitting, Grooming, Stretching, Sleeping, Loving, Alert, Chasing, Batting };
enum class Mood { Walking, Running, Sitting, Grooming, Stretching, Sleeping, Loving, Alert, Chasing, Batting, Drinking };
Q_ENUM(Mood)
explicit CatController(AppSettings *settings, QObject *parent = nullptr);
@@ -67,10 +69,13 @@ public:
bool chipVisible() const { return m_chipVisible; }
qreal chipX() const { return m_chipX; }
int chipKick() const { return m_chipKick; }
bool cupVisible() const { return m_cupVisible; }
qreal cupX() const { return m_cupX; }
Q_INVOKABLE void pet();
Q_INVOKABLE void doTrick(Mood mood);
Q_INVOKABLE void tossChip();
Q_INVOKABLE void coffeeBreak();
signals:
void xChanged();
@@ -86,6 +91,8 @@ signals:
void chipVisibleChanged();
void chipXChanged();
void chipKickChanged();
void cupVisibleChanged();
void cupXChanged();
private:
void tick();
@@ -97,6 +104,7 @@ private:
void holdMood(Mood mood, int ms);
void batChip();
void endChase();
void endCoffee();
void scheduleChip();
qreal catNose() const;
@@ -124,4 +132,7 @@ private:
qreal m_chipX = 0;
int m_chipKick = 0;
int m_batsLeft = 0;
bool m_cupVisible = false;
qreal m_cupX = 0;
};