# HG changeset patch # User Steve Losh # Date 1483801786 0 # Node ID ebd641c91236d2152f860a967cee2be856be97f8 # Parent 5560e722bc5cb676521fb6b5ad4413cd14c3fede Start the sidebar fuckery diff -r 5560e722bc5c -r ebd641c91236 .lispwords --- a/.lispwords Sat Jan 07 15:00:20 2017 +0000 +++ b/.lispwords Sat Jan 07 15:09:46 2017 +0000 @@ -1,1 +1,1 @@ -(1 with-panel-and-window) +(1 with-panel-and-window with-panels-and-windows) diff -r 5560e722bc5c -r ebd641c91236 src/main.lisp --- a/src/main.lisp Sat Jan 07 15:00:20 2017 +0000 +++ b/src/main.lisp Sat Jan 07 15:09:46 2017 +0000 @@ -23,6 +23,15 @@ (defparameter *wat* nil) (defparameter *player* nil) +(defparameter *sidebar-width* 20) + + +;;;; More Utils Lol +(defmacro with-window-dims (window &body body) + (with-gensyms (w h) + `(multiple-value-bind (,w ,h) (charms:window-dimensions ,window) + (with-dims (,w ,h) + ,@body)))) ;;;; Colors ------------------------------------------------------------------- @@ -167,12 +176,17 @@ (defun world-map () (with-dims ((- *screen-width* 2) (- *screen-height* 2)) - (with-panel-and-window (map-pan map-win *width* *height* 0 0) + (with-panels-and-windows + ((map-pan map-win (- *width* *sidebar-width*) *height* 0 0) + (bar-pan bar-win *sidebar-width* *height* (- *width* *sidebar-width*) 0)) (iterate - (center-view-on-player *width* *height*) - (render-map map-win) + (charms:clear-window bar-win) + (border bar-win) + (with-window-dims map-win + (center-view-on-player *width* *height*) + (render-map map-win)) (redraw) - (until (eql :quit (world-map-input map-win)))))) + (until (eql :quit (world-map-input bar-win)))))) nil)