summaryrefslogtreecommitdiff
path: root/asciifarm/client/display/screen.py
diff options
context:
space:
mode:
Diffstat (limited to 'asciifarm/client/display/screen.py')
-rw-r--r--asciifarm/client/display/screen.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/asciifarm/client/display/screen.py b/asciifarm/client/display/screen.py
index a09c2a9..b563c00 100644
--- a/asciifarm/client/display/screen.py
+++ b/asciifarm/client/display/screen.py
@@ -1,12 +1,12 @@
import curses
from .fieldpad import FieldPad
+from asciifarm.common.utils import clamp
import signal
class Screen:
-
def __init__(self, display, stdscr):
self.display = display
curses.curs_set(0)
@@ -22,16 +22,16 @@ class Screen:
sideW = 20
sideX = width-sideW
- msgH = max(3, min(height // 5, 5))
+ msgH = clamp(height // 5, 3, 5)
msgY = height - msgH-1
inputH = 1
inputY = msgY + msgH
healthY = 0
healthH = self._limitHeight(2, healthY)
groundY = healthY + healthH
- groundH = self._limitHeight(7, groundY)
+ groundH = self._limitHeight(6, groundY)
invY = groundY + groundH
- invH = self._limitHeight(12, invY)
+ invH = self._limitHeight(9, invY)
eqY = invY + invH
eqH = self._limitHeight(5, eqY)
infoY = eqY + eqH