From 227f266df78b143b0c5dd2c7f498b755199707eb Mon Sep 17 00:00:00 2001 From: troido Date: Mon, 13 Nov 2017 13:37:05 +0100 Subject: display parts now use windows as arguments --- asciifarm/client/display/__init__.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'asciifarm/client/display/__init__.py') diff --git a/asciifarm/client/display/__init__.py b/asciifarm/client/display/__init__.py index ea86557..fc48d55 100644 --- a/asciifarm/client/display/__init__.py +++ b/asciifarm/client/display/__init__.py @@ -21,7 +21,7 @@ class Display: self.colours = Colours() else: self.colours = None - self.screen = Screen(stdscr) + self.screen = Screen(self, stdscr) self.fieldPad = FieldPad((1, 1), charMap.get("charwidth", 1), self.colours) self.characters = charMap["mapping"] self.defaultChar = charMap.get("default", "?") @@ -83,17 +83,18 @@ class Display: def update(self): if self.changed: - fieldRight = min(self.fieldPad.getWidth(), self.screen.getWidth()-SIDEWIDTH-1) - fieldBottom = min(self.fieldPad.getHeight(), self.screen.getHeight()-self.messagePad.getHeight()) - healthBottom = self.healthPad.getHeight() - groundBottom = healthBottom + self.groundPad.getHeight() - inventoryBottom = groundBottom + self.inventoryPad.getHeight() - self.fieldPad.update(self, 0,0,fieldRight, fieldBottom) - self.messagePad.update(self, 0,fieldBottom, fieldRight, min(self.screen.getHeight(), fieldBottom+self.messagePad.getHeight())) - self.healthPad.update(self, fieldRight+1,0, self.screen.getWidth(), healthBottom) - self.groundPad.update(self, fieldRight+1, healthBottom, self.screen.getWidth(), min(self.screen.getHeight(), groundBottom)) - self.inventoryPad.update(self, fieldRight+1, groundBottom, self.screen.getWidth(), min(self.screen.getHeight(), inventoryBottom)) - self.infoPad.update(self, fieldRight+1,inventoryBottom+1, self.screen.getWidth(), self.screen.getHeight()) + self.screen.update() + #fieldRight = min(self.fieldPad.getWidth(), self.screen.getWidth()-SIDEWIDTH-1) + #fieldBottom = min(self.fieldPad.getHeight(), self.screen.getHeight()-self.messagePad.getHeight()) + #healthBottom = self.healthPad.getHeight() + #groundBottom = healthBottom + self.groundPad.getHeight() + #inventoryBottom = groundBottom + self.inventoryPad.getHeight() + #self.fieldPad.update(self, 0,0,fieldRight, fieldBottom) + #self.messagePad.update(self, 0,fieldBottom, fieldRight, min(self.screen.getHeight(), fieldBottom+self.messagePad.getHeight())) + #self.healthPad.update(self, fieldRight+1,0, self.screen.getWidth(), healthBottom) + #self.groundPad.update(self, fieldRight+1, healthBottom, self.screen.getWidth(), min(self.screen.getHeight(), groundBottom)) + #self.inventoryPad.update(self, fieldRight+1, groundBottom, self.screen.getWidth(), min(self.screen.getHeight(), inventoryBottom)) + #self.infoPad.update(self, fieldRight+1,inventoryBottom+1, self.screen.getWidth(), self.screen.getHeight()) curses.doupdate() self.changed = False -- cgit