;;-*-Lisp-*-
(in-package goal)

;; name: glider-hud.gc
;; name in dgo: glider-hud
;; dgos: HGA

;; DECOMP BEGINS

(defmethod draw ((this hud-glider-altitude))
  (set-hud-piece-position! (-> this sprites 0) 256 (+ (the int (* 50.0 (-> this offset))) 376))
  (set! (-> this sprites 0 pos z) #xfffff0)
  (let ((f0-4 (fmax 0.0 (fmin 1.0 (the-as float (-> this values 0 current))))))
    (set-as-offset-from! (-> this sprites 1) (-> this sprites 0 pos) (+ (the int (* 120.0 f0-4)) -60) 0)
    )
  (set! (-> this sprites 1 pos z) #xfffff1)
  ((method-of-type hud draw) this)
  0
  (none)
  )

(defmethod update-values! ((this hud-glider-altitude))
  (set! (-> this values 0 target) (the-as int (-> *game-info* health-bar-vehicle)))
  (logclear! (-> this flags) (hud-flags disable))
  ((method-of-type hud update-values!) this)
  0
  (none)
  )

(defmethod init-callback ((this hud-glider-altitude))
  (set! (-> this gui-id)
        (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0)
        )
  (logior! (-> this flags) (hud-flags show))
  (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-glider-speed-01 hanga-minimap)))
  (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3))
  (set! (-> this sprites 0 scale-x) 1.2)
  (set! (-> this sprites 0 scale-y) 1.2)
  (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-glider-speed-marker-01 hanga-minimap)))
  (set! (-> this sprites 1 flags) (hud-sprite-flags hsf3))
  (set! (-> this sprites 1 scale-x) 1.0)
  (set! (-> this sprites 1 scale-y) 1.0)
  0
  (none)
  )
