From 2a8076782ac7786c26e18493fe407c7916b49254 Mon Sep 17 00:00:00 2001 From: El-BG-1970 Date: Fri, 26 Aug 2022 08:15:34 +0200 Subject: added zone price panels --- src/main.lisp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') 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)) -- cgit v1.2.3