diff options
| author | troido <troido@hotmail.com> | 2017-12-28 22:47:36 +0100 |
|---|---|---|
| committer | troido <troido@hotmail.com> | 2017-12-28 22:47:36 +0100 |
| commit | 8c8c410f0eb7b6995c6e8db613228d91191f4e23 (patch) | |
| tree | 8a0ff8bf95e20963a40332bc5fb2588fd9eb6ba6 /asciifarm/client/display/screen.py | |
| parent | d983e275f3f4ba156e33d00e5deaa2f730695cae (diff) | |
chat now works!
Diffstat (limited to 'asciifarm/client/display/screen.py')
| -rw-r--r-- | asciifarm/client/display/screen.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/asciifarm/client/display/screen.py b/asciifarm/client/display/screen.py index 41b7e12..588310e 100644 --- a/asciifarm/client/display/screen.py +++ b/asciifarm/client/display/screen.py @@ -22,8 +22,10 @@ class Screen: sideW = 20 sideX = width-sideW - msgH = max(3, min(height // 5, 6)) - msgY = height - msgH + msgH = max(3, min(height // 5, 5)) + msgY = height - msgH-1 + inputH = 1 + inputY = msgY + msgH healthY = 0 healthH = self._limitHeight(2, healthY) groundY = healthY + healthH @@ -36,6 +38,7 @@ class Screen: self.windows = { "field": self.makeWin(0, 0, sideX - 1, msgY), "msg": self.makeWin(0, msgY, sideX - 1, msgH), + "textinput": self.makeWin(0, inputY, sideX - 1, inputH), "health": self.makeWin(sideX, healthY, sideW, healthH), "ground": self.makeWin(sideX, groundY, sideW, groundH), "inventory": self.makeWin(sideX, invY, sideW, invH), @@ -47,22 +50,18 @@ class Screen: return None return curses.newwin(height, width, y, x) + def getWin(self, name): + return self.windows[name] + def updateSize(self, *args): curses.endwin() curses.initscr() self.setWins() self.stdscr.clear() - self.update(True) + self.display.update(True) - def update(self, force=False): - d = self.display - d.fieldPad.update(self.windows["field"], force) - d.messagePad.update(self.windows["msg"], force) - d.healthPad.update(self.windows["health"], force) - d.groundPad.update(self.windows["ground"], force) - d.inventoryPad.update(self.windows["inventory"], force) - d.infoPad.update(self.windows["info"], force) + def update(self): curses.doupdate() |
