diff options
| -rw-r--r-- | desktop/companion/Companion.qml | 28 | ||||
| -rw-r--r-- | desktop/companion/Lines.js | 1 |
2 files changed, 27 insertions, 2 deletions
diff --git a/desktop/companion/Companion.qml b/desktop/companion/Companion.qml index 683eb4a..51dfea9 100644 --- a/desktop/companion/Companion.qml +++ b/desktop/companion/Companion.qml @@ -82,6 +82,7 @@ PanelWindow { property double typingAt: 0 property double pulseAt: 0 property double wakeAt: 0 + property double admireAt: 0 property double lastLineAt: 0 property double lastMonologueAt: 0 property bool monologue: false @@ -171,9 +172,10 @@ PanelWindow { const cls = event.data.split(",")[0].trim().toLowerCase(); if (cls !== "" && cls !== root.appClass && Math.random() < 1 / 3) root.say("app:" + cls); root.appClass = cls; - } else if (["fullscreen", "activewindowv2", "workspacev2"].includes(event.name)) { + } else if (["fullscreen", "activewindowv2", "workspacev2", "closewindow"].includes(event.name)) { Hyprland.refreshToplevels(); fsSettle.restart(); + admireSettle.restart(); } } } @@ -186,6 +188,28 @@ PanelWindow { } } + // A listed wallpaper on an empty workspace: she turns to it and blushes. + // Checked after the events above (switching to an empty workspace, + // closing its last window) and whenever she stops being away: shown, + // back from a remap, a hop, a dodge or fullscreen. Toplevels settle a + // moment after the event, as fullscreen does. + onAwayChanged: if (!root.away) admireSettle.restart() + Timer { + id: admireSettle + interval: 100 + onTriggered: { + const t = Date.now(); + if (root.away || root.here !== root.focused || !Mood.admireAllowed(root.admireAt, t)) return; + if ((Hyprland.focusedWorkspace?.toplevels.values.length ?? 1) !== 0) return; + if (!Admired.listed(Admired.on(root.here))) return; + root.admireAt = t; + root.now = t; + admireLine.restart(); + } + } + // The line comes with the blush, not the turn. + Timer { id: admireLine; interval: Mood.T.admireLook; onTriggered: root.say("wallpaper") } + // Hyprland stacks a later surface above an earlier one on the same layer // and 0.56.2 has no layer rule to order them, so the assistant canvas's // full-screen dim covered her and her think and wave were never seen. @@ -217,7 +241,7 @@ PanelWindow { now: root.now, destructAt: root.destructAt, dodging: root.dodging, shoved: root.shoved, shovedAt: root.shovedAt, recording: root.asst.recording, busy: root.asst.busy, repliedAt: root.repliedAt, - clicks: root.clicks, mockAt: root.mockAt, typingAt: root.typingAt, wakeAt: root.wakeAt, + clicks: root.clicks, admireAt: root.admireAt, mockAt: root.mockAt, typingAt: root.typingAt, wakeAt: root.wakeAt, monologue: root.monologue, idle: root.idle, }) readonly property string outfit: Mood.outfit(root.destructAt, root.now) diff --git a/desktop/companion/Lines.js b/desktop/companion/Lines.js index 12b54d6..d6450df 100644 --- a/desktop/companion/Lines.js +++ b/desktop/companion/Lines.js @@ -24,6 +24,7 @@ var lines = { ready: ["Answer's ready.", "Your reply came in."], click: ["...Yes?", "Can I help you?"], blush: ["S-stop that.", "...Operator."], + wallpaper: ["...!", "W-what is this?", "I wasn't staring."], dodge: ["...Fine.", "I'll move."], destruct: ["Self-destruct sequence initiated."], aftermath: ["...That was unpleasant."], |
