def __init__(self, master, controller, x, y): self.master = master self.controller = controller self.save_engine = self.master.master.save_engine self.x = x self.y = y self.id = "save_select" self.selected_save = 0 self.images = menu_image_loader.load_images() self.saves = self.save_engine.saves self.background = gui_components.Fill(self.x, self.y, 482, 362, constants.GUI_BACKING) self.background_fill = gui_components.Fill(self.x + 212, self.y + 6, 264, 350, constants.GUI_FILL) self.save_labels = [ gui_components.Label(self.x + 235, self.y + 2 + (44 * n), self.saves[n], False, 36, constants.BLACK) for n in range(len(self.saves)) ] self.arrow = icons.ArrowPointer( self.x + 222, self.y + 18 + (44 * self.selected_save)) self.new_save_button = gui_components.Button( self.images["new_save_button"], self.x + 7, self.y + 7, lambda: self.callback(0)) self.load_save_button = gui_components.Button( self.images["load_save_button"], self.x + 7, self.y + 95, lambda: self.callback(1)) self.delete_save_button = gui_components.Button( self.images["delete_save_button"], self.x + 7, self.y + 183, lambda: self.callback(2)) self.cancel_button = gui_components.Button( self.images["cancel_save_button"], self.x + 7, self.y + 271, lambda: self.callback(3)) self.buttons = [ self.new_save_button, self.load_save_button, self.delete_save_button, self.cancel_button ] self.components = [self.background, self.background_fill, self.arrow ] + self.save_labels + self.buttons
def __init__(self, player, master, controller, x, y): self.player = player self.master = master self.controller = controller self.x = x self.y = y self.id = "bean_select" self.selected_option = 0 self.background = gui_components.Fill(self.x, self.y, 366, 176, constants.GUI_BACKING) self.background_fill = gui_components.Fill(self.x + 5, self.y + 5, 356, 166, constants.GUI_FILL) self.title = [ gui_components.Label(self.x + 9, self.y + 3, "You have been challenged to fight!", False, 20, constants.BLACK), gui_components.Label(self.x + 9, self.y + 21, "Which bean accepts the challenge?", False, 20, constants.BLACK) ] self.options = [ gui_components.Label(self.x + 35, self.y + 39 + 18 * n, self.player.beans[n].meta.display_name, False, 20, constants.BLACK) for n in range(len(self.player.beans)) ] self.options.append( gui_components.Label(self.x + 35, self.y + 39 + 18 * len(self.options), "I decline the challenge", False, 20, constants.BLACK)) self.space_label = gui_components.Label(self.background.rect.centerx, self.y + 159, "<Space to Select>", True, 20, (79, 80, 68)) self.arrow = icons.ArrowPointer( self.x + 23, self.y + 44 + 18 * self.selected_option) self.components = [ self.background, self.background_fill, self.space_label, self.arrow ] + self.title + self.options
def __init__(self, master, controller, x, y): InventoryDisplay.__init__(self, master, controller, x, y) self.id = "item_select" self.selected_item = 0 self.pointer = icons.ArrowPointer( self.x + 10, self.y + 59 + (40 * self.selected_item)) self.title = gui_components.Label(self.x + 9, self.y, "Item Select", False, 32, constants.BLACK) self.press_space = gui_components.Label(self.x + 211, self.y, "<Space to Select>", False, 32, constants.BLACK) self.components = [ self.background, self.title, self.press_space, self.pointer ] + self.labels + self.item_images