Permalink
Browse files

Some more minor fixes.

  • Loading branch information...
Shinmera committed Dec 17, 2017
1 parent 683d44d commit 34abe4685d9bb12a6f4b1ef743159b0b8743e490
Showing with 12 additions and 12 deletions.
  1. +4 −4 assets/font.lisp
  2. +8 −8 ui/input.lisp
View
@@ -40,7 +40,9 @@
(v:debug :trial.asset "Loaded font ~a" (first (coerced-inputs asset))))
(defmethod text-extent ((font font) text)
(cl-fond:compute-extent (resource font) text))
(if (resource font)
(cl-fond:compute-extent (resource font) text)
'(:l 0 :r 0 :t 0 :b 0 :gap 0)))
(define-shader-entity text (asset located-entity)
((font :initarg :font :accessor font)
@@ -128,9 +130,7 @@ void main(){
(setf (size vao) (cl-fond:update-text font text (resource vbo) (resource ebo))))))
(defmethod extent ((entity text))
(if (resource (font entity))
(text-extent entity (text entity))
'(:l 0 :r 0 :t 0 :b 0 :gap 0)))
(text-extent entity (text entity)))
(defmethod text-extent ((entity text) text)
(destructuring-bind (&key l r ((:t u)) b gap) (text-extent (font entity) text)
View
@@ -11,24 +11,24 @@
(define-action activate-next (ui-action)
(mouse-scroll (< 0 delta))
(key-release (one-of key :down :s))
(gamepad-release (eql button :dpad-down))
(gamepad-move (and (eql axis :left-v) (< old-pos -0.5 pos))))
(gamepad-release (eql button :dpad-d))
(gamepad-move (and (eql axis :l-v) (< old-pos -0.5 pos))))
(define-action activate-previous (ui-action)
(mouse-scroll (< delta 0))
(key-release (one-of key :up :w))
(gamepad-release (eql button :dpad-up))
(gamepad-move (and (eql axis :left-v) (< pos 0.5 old-pos))))
(gamepad-release (eql button :dpad-u))
(gamepad-move (and (eql axis :l-v) (< pos 0.5 old-pos))))
(define-action next-value (ui-action)
(key-release (one-of key :right :d))
(gamepad-release (eql button :dpad-right))
(gamepad-move (and (eql axis :left-h) (< pos 0.5 old-pos))))
(gamepad-release (eql button :dpad-r))
(gamepad-move (and (eql axis :l-h) (< pos 0.5 old-pos))))
(define-action previous-value (ui-action)
(key-release (one-of key :left :a))
(gamepad-release (eql button :dpad-left))
(gamepad-move (and (eql axis :left-h) (< old-pos -0.5 pos))))
(gamepad-release (eql button :dpad-l))
(gamepad-move (and (eql axis :l-h) (< old-pos -0.5 pos))))
(define-action confirm (ui-action)
(key-release (one-of key :return :enter))

0 comments on commit 34abe46

Please sign in to comment.