def __call__(self): self.enc.sort_entries(entries=self.enc.current_entries, sorting=self.sorting_mode, reverse=self.reverse) self.enc.sorting_mode = self.sorting_mode renpy.restart_interaction()
def __call__(self): if self.block is False: # The Encyclopaedia's page display changes. self.enc.sub_current_position += self.direction # The EncEntry's current page changes to match. self.enc.active.current_page = self.enc.sub_current_position if self.enc.active.current_page.viewed is False: self.enc.active.current_page.viewed = True renpy.restart_interaction()
def set_mods_info(self, mds): for i, m in enumerate(mds): if (i + 1) % 100 == 0: restart_interaction() if m['size'] == 0: fp = urllib2.urlopen(m['url']) m['size'] = float(fp.headers['content-length']) / Mb m['last_modified'] = time.mktime( time.strptime(fp.headers['Last-Modified'], "%a, %d %b %Y %H:%M:%S %Z")) self.resort_mods() self.drop_mods()
def resort_mods(self, func=None): if func is not None: self.sorting_func = func if self.sorting_func is None: self.sorting_func = lambda x: x['idmod'] self.sorted_mods = list(self.mods.values()) self.sorted_mods.sort(key=self.sorting_func) for x in self.local_mods: mod = self.mods[x] self.sorted_mods.remove(mod) self.sorted_mods.insert(0, mod) restart_interaction()
def __call__(self): self.enc.show_locked_buttons = not self.enc.show_locked_buttons # Ensure the filtering isn't broken by hiding buttons. if self.enc.filtering: _build_subject_filter(self.enc, self.enc.filtering) # Ensure the sorting isn't broken by hiding buttons. reverse = False if self.enc.sorting_mode == self.enc.SORT_REVERSE_ALPHABETICAL: reverse = True self.enc.sort_entries(entries=self.enc.current_entries, sorting=self.enc.sorting_mode, reverse=reverse) renpy.restart_interaction()
def __call__(self): if self.block is False: # Update the current position. self.enc.current_position += self.direction # Update the active entry. self.enc.active = self.get_entry() if self.enc.active.locked is False: # Run the callback, if provided. self.enc.active.emit("viewed") # Mark the entry as viewed. self.enc.active.viewed = True # When changing an entry, the current sub-entry page number is # set back to 1. self.enc.sub_current_position = 1 self.enc.active.current_page = self.enc.sub_current_position renpy.restart_interaction()
def __call__(self): self.set_entry() # Show the entry screen associated with the encyclopaedia. renpy.show_screen(self.enc.entry_screen, self.enc) renpy.restart_interaction()
def __call__(self): self.enc.show_locked_entry = not self.enc.show_locked_entry renpy.restart_interaction()
def __call__(self): self.enc.sub_current_position = 1 if self.enc.active is not None: self.enc.active.current_page = 1 renpy.restart_interaction()
def __call__(self): self.enc.filtering = False renpy.restart_interaction()
def __call__(self): self.enc.filtering = self.subject _build_subject_filter(self.enc, self.subject) renpy.restart_interaction()
def progress(self, value): print(value) self.__progress = value restart_interaction()