diff options
| author | El-BG-1970 <elouan.gros.fr@gmail.com> | 2022-08-26 08:15:34 +0200 |
|---|---|---|
| committer | El-BG-1970 <elouan.gros.fr@gmail.com> | 2022-08-26 08:15:34 +0200 |
| commit | 2a8076782ac7786c26e18493fe407c7916b49254 (patch) | |
| tree | c9266638c7021d91fbe214acb570d562f4c9c24a | |
| parent | ba291bd4a870048e48b5527878604c9fc31ef07c (diff) | |
| download | transacc-2a8076782ac7786c26e18493fe407c7916b49254.tar.gz | |
added zone price panels
| -rw-r--r-- | src/main.lisp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.lisp b/src/main.lisp index b3c6933..330abe4 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -14,6 +14,9 @@ (title :title-pane :display-time :command-loop :display-function 'display-title) + (panel :application + :label-alignment :top + :display-function 'display-panel) (int :interactor)) ;; :layouts section describes how the panes are layed out. @@ -21,11 +24,12 @@ (:layouts (default (clim:vertically () (1/8 title) - (7/8 int))))) + (5/8 panel) + (2/8 int))))) -(defun format-panel (panel) +(defun format-panel (panel stream) (loop for it in panel do - (format t "~a :~T ~$$ [~@$$] owned: ~a~%" + (format stream "~a :~T ~$$ [~@$$] owned: ~a~%" (getf it :name) (getf it :price) (getf it :profit) @@ -47,10 +51,12 @@ 300 2 :align-x :center :align-y :top)) + (defmethod display-panel ((frame superapp) stream) + (format-panel (game:commodities-panel g) stream)) ;; Panel command (define-superapp-command (com-panel :name t) () - (format-panel (game:commodities-panel g))) + (format-panel (game:commodities-panel g) t)) ;; Buy command (define-superapp-command (com-buy :name t) ((item 'string) (quantity 'integer)) |
