def render_GUI(self): if self.window_too_small(): return white = colors.get("white") layers.add_border(layers.get("main"), color=white) layers.get("main").setrange(0,0, "<main>", color=white) layers.get("gameworld").setrange(0, 0, "<gameworld>", color=white) layers.add_border(layers.get("gameframe"), color=white) layers.get("gameframe").setrange(0, 0, "<gameframe>", color=white) self.stats.render() layers.add_border(layers.get("stats"), color=white) layers.get("stats").setrange(0, 0, "<stats>", color=white) layers.add_border(layers.get("player"), color=white) layers.get("player").setrange(0, 0, "<player>", color=white) layers.get("player").setlines(5, 2, BODY, color=white) layers.add_border(layers.get("news"), color=white) layers.get("news").setrange(0, 0, "<news>", color=white) for (y, news) in enumerate(NEWS.latest(3), 1): layers.get("news").setrange(1, y, news, color=white)
def render(self, stdscr): WHITE = colors.get("white") RED = colors.get("red") (X,Y) = true_terminal_size() # <---- TODO: ok? layers.add_border(self.layer, color=WHITE) self.layer.setrange(0, 0, "<quit_main>", color=WHITE) self.layer.setrange(1, 1, "Quit? (Y/N)", color=RED) layers.render_to(self.layer, stdscr, int(X//2.7), int(Y//2.7))