From 6dd194ec453cbd5f8bd750fd38678dc87f42860c Mon Sep 17 00:00:00 2001 From: Boutade Date: Fri, 18 Oct 2019 08:40:31 -0500 Subject: coffee indicator --- the-price-of-a-cup-of-coffee.lisp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'the-price-of-a-cup-of-coffee.lisp') diff --git a/the-price-of-a-cup-of-coffee.lisp b/the-price-of-a-cup-of-coffee.lisp index 012f656..6ddbe3f 100644 --- a/the-price-of-a-cup-of-coffee.lisp +++ b/the-price-of-a-cup-of-coffee.lisp @@ -53,7 +53,7 @@ (setf (sdl2:rect-x *status-meter-decoration-rect*) (+ -32 (sdl2:rect-x shape) (sdl2:rect-width shape))) (setf (sdl2:rect-y *status-meter-decoration-rect*) - (+ -12 (sdl2:rect-y shape))) + (+ -16 (sdl2:rect-y shape))) (sdl2:render-copy renderer *expression-texture* :source-rect (get-expression decoration) :dest-rect *status-meter-decoration-rect*))) @@ -98,6 +98,14 @@ :percent 0.0 :max-width width))) +(defmethod render :after ((cold-meter (eql *cold-meter*)) renderer) + (let ((x (round (* 0.45 (max-width cold-meter))))) + (setf (sdl2:rect-x *status-meter-decoration-rect*) x) + (sdl2:render-copy renderer *expression-texture* + :source-rect (get-expression "coffee") + :dest-rect *status-meter-decoration-rect*))) + + ;; TODO - REIMPLEMENT TO WORK WITH *TWEENS* ;; (defun drink-coffee () ;; (let ((now (sdl2:get-ticks)) -- cgit v1.2.3