From fb01362a9dd816fc0d0e50052ab4764dd30e46f3 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Thu, 1 May 2025 17:06:41 -0400 Subject: You know we love updating with a horrendous commit message --- src/wasp-overlay.el | 76 ++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 42 deletions(-) (limited to 'src/wasp-overlay.el') diff --git a/src/wasp-overlay.el b/src/wasp-overlay.el index 23786453..c4e63e3b 100644 --- a/src/wasp-overlay.el +++ b/src/wasp-overlay.el @@ -1,57 +1,49 @@ -;;; wasp-overlay --- Superterranean Animism Overlay -*- lexical-binding: t; -*- +;;; wasp-overlay --- Fullscreen overlay -*- lexical-binding: t; -*- ;;; Commentary: ;;; Code: (require 'wasp-utils) (require 'wasp-bus) -(require 'wasp-prod) - -(add-to-list 'load-path (f-canonical "~/src/animism/")) -(require 'bulletml) - -;; src,Xway,fire^쾠㘽쾷ㅗ껋㾨먝乲뛏屚w㮇㸩멽ꝼ쓋♫릫m떫쓏䓳⩺䮻1㨧퉝ƭ쓐ǥᓌ㒵ᒄ먽乳俴㢈쿗峫ฐꙢ왽욍투ㅖ㨧슝呑㟪䁓Ɂy䏧呠3먫슎呒3⧘ɍy욋ᕈ00먫⇳ -;; this one is broken fix it -ellg, probably - -(defconst w/overlay-spellcard-names - '("Joel" "Pemis" "JoelTeachingHisSonJolHowToSpinWhileWideBorisPassesBy" "bugSegz" - "widepeepoMASTURBATION77769420GANGSHITNOMOREFORTNITE19DOLLERFORTNITECARD" - "Machine Made Of Fire, Heart Made Of Doves" - "Dream Seal" "Evil-Sealing Circle" "Dream Seal -Spread-" "Dream Seal -Concentrate-" - "Duplex Barrier" "Dream Orb" "Omnidirectional Oni-Binding Circle" "Yin-Yang Treasured Orb" - "Yin-Yang Kishin Orb" "Dream Orb String" "Yin-Yang Scattering" "Exorcising Border" - "Yin-Yang King Piece" "Illusionary Moon" "Flying Mysterious Shrine Maiden" - "Dream Seal -Blink-" "Great Duplex Barrier" "Dream Seal -Worn-" "Dream Seal -Marred-" - "Dream Seal -The Point Of The Mask-" - )) - -(defvar w/overlay-barrage-active nil) + +(defun w/overlay-shader (user shader) + "Set the overlay shader to SHADER by USER." + (w/pub '(avatar overlay shader) + (list (w/encode-string user) (w/encode-string shader)))) + +(defun w/overlay-chat (msg) + "Update the overlay about chat MSG." + (w/pub '(avatar overlay chat) + (list + (w/encode-string (w/. user msg)) + (w/encode-string (w/. text msg)) + (format "%s" (w/unix-time)) + (format "%s" (or (w/. biblicality msg) 0.0))))) + +(defun w/overlay-muzak (user song) + "Update the overlay about Muzak SONG played by USER." + (ignore song) + (w/pub '(avatar overlay muzak) (list (w/encode-string user)))) + +(defun w/overlay-muzak-clear () + "Tell the overlay that there is no Muzak song playing." + (w/pub '(avatar overlay muzak clear) (list))) + (defvar w/overlay-last-cursor nil) (defun w/overlay-update-cursor () "Inform the overlay about the current cursor position." - (when (and w/overlay-barrage-active (process-live-p (get-process w/bus-process))) - (when-let ((pos (window-absolute-pixel-position))) + (when (and (process-live-p (get-process w/bus-process))) + (when-let* ((pos (window-absolute-pixel-position))) (when (not (equal pos w/overlay-last-cursor)) (setf w/overlay-last-cursor pos) - (w/pub '(overlay cursor) (list (- (car pos) 1920) (cdr pos))))))) + (w/pub '(avatar overlay cursor) (list (car pos) (cdr pos))))))) (add-hook 'post-command-hook #'w/overlay-update-cursor) -(defun w/overlay-start-barrage (bml) - "Start a barrage on the overlay using the BulletML source string BML." - (w/pub '(overlay barrage start) (list (w/encode-string bml)))) - -(defun w/overlay-decode-shorthand-bml (s k) - "Decode the shorthand BulletML string S. -Pass the resulting BulletML XML string to K." - ;; (w/write-log s) - (w/prod-get-raw - (format "/api/yamame?input=%s" (url-encode-url s)) - (lambda (data) - (if-let* ((bml (bml/parse-string data)) - (b (bml/initialize bml)) - ((bml/barrage-toplevel b))) - (progn - (funcall k data)) - (w/write-chat-event "That spell card is too powerful... "))))) +(defun w/overlay-emacs () + "Update the overlay with miscellaneous data from Emacs." + (w/pub '(avatar overlay emacs) + (list + (w/get-heartrate) + ))) (provide 'wasp-overlay) ;;; wasp-overlay.el ends here -- cgit v1.2.3