def make_listbox(self): return listbox.CustomListbox(self, (0, -.10), (-1, -.77), list_item_height=0.06, anchor=constants.TOP_LEFT, remake_func=self.make_item, rebuild_func=self.update_item, on_double_click_on_item=self.yes_button.activated)
def make_listbox(self): return listbox.CustomListbox(self, (0, 0), (-1, -.85), anchor=constants.TOP_LEFT, align=constants.LEFT, item_borders=False, item_selectable=False, remake_func=self.make_item, rebuild_func=self.update_item)
def __init__(self, parent, pos=(.5, .1), size=(.93, .63), *args, **kwargs): self.dirty_count = True super(ResearchScreen, self).__init__(parent, pos, size, *args, **kwargs) self.listbox.parent = None self.listbox = listbox.CustomListbox(self, (0, 0), (.53, .55), list_item_height=0.06, remake_func=self.make_item, rebuild_func=self.update_item, update_func=self.handle_update) self.description_pane.size = (.39, .55) self.desc_func = self.on_select self.help_dialog = dialog.MessageDialog(self) self.yes_button.parent = None self.no_button.pos = (-.5, -.99) self.no_button.anchor = constants.BOTTOM_CENTER self.add_handler(constants.KEY, self._got_key, priority=5)
def __init__(self, *args, **kwargs): super(LocationScreen, self).__init__(*args, **kwargs) self.pos = (-.5, -.5) self.anchor = constants.MID_CENTER self.size = (.75, .70) self.name_display = text.Text(self, (0,0), (-1, -.08), anchor=constants.TOP_LEFT, borders=constants.ALL, border_color="pane_background", background_color="pane_background_empty", shrink_factor=1, bold=True) self.modifier_display = text.Text(self, (-.75, -.01), (-.25, -.06), anchor=constants.TOP_LEFT, background_color="clear") self.open_button = \ button.FunctionButton(self, (0, -.8), (-.3, -.09), autotranslate=True, text=N_("&OPEN BASE"), anchor=constants.TOP_LEFT, autohotkey=True, function=self.open_base) self.listbox = listbox.CustomListbox(self, (0,-.09), (-1, -.69), remake_func=self.make_item, rebuild_func=self.update_item, on_double_click_on_item=self.open_button.activated, ) self.rename_button = \ button.FunctionButton(self, (-.50, -.8), (-.3, -.09), autotranslate=True, text=N_("&RENAME BASE"), anchor=constants.TOP_CENTER, autohotkey=True, function=self.rename_base) self.power_button = \ button.FunctionButton(self, (-1, -.8), (-.3, -.09), autotranslate=True, text=N_("&POWER STATE"), anchor=constants.TOP_RIGHT, autohotkey=True, function=self.power_state) self.new_button = \ button.FunctionButton(self, (0, -.91), (-.3, -.09), autotranslate=True, text=N_("&NEW BASE"), autohotkey=True, function=self.new_base) self.destroy_button = \ button.FunctionButton(self, (-.50, -.91), (-.3, -.09), autotranslate=True, text=N_("&DESTROY BASE"), anchor=constants.TOP_CENTER, autohotkey=True, function=self.destroy_base) self.back_button = button.ExitDialogButton(self, (-1, -.9), (-.3, -.09), autotranslate=True, text=N_("&BACK"), anchor=constants.TOP_RIGHT, autohotkey=True) self.confirm_destroy = \ dialog.YesNoDialog(self, (-.5, 0), (-.35, -.7), autotranslate=True, text=N_("Are you sure you want to destroy this base?"), shrink_factor=.5) self.cannot_destroy_last_base = \ dialog.MessageDialog(self, autotranslate=True, text=N_("Destroying my last active base would be suicidal. I cannot do that."), pos=(-.5, 0), size=(-.35, -.7), shrink_factor=.5) self.new_base_dialog = NewBaseDialog(self) self.location = None self.name_dialog = dialog.TextEntryDialog(self) self.base_dialog = basescreen.BaseScreen(self, (0,0), anchor=constants.TOP_LEFT)