def on_cr_entity_edited(self, widget, path, text): match = PATTERN_MD_ENTRY.match(text) if match is None: return try: entid = int(match.group(1)) except ValueError: return idx = int(self._list_store[path][0]) # Check, if this is a special entry, # in this case we update the standin entry! # TODO: it's a bit weird doing this over the color if self._list_store[path][8] == ORANGE: logger.debug(f"Updated standin for actor {idx}: {entid}") standins = self._sprite_provider.get_standin_entities() standins[idx] = entid self._sprite_provider.set_standin_entities(standins) # entid: self._list_store[path][4] = entid # ent_icon: # If color is orange it's special. # TODO: it's a bit weird doing this over the color self._list_store[path][3] = self._get_icon( entid, idx, self._list_store[path][8] == ORANGE) # ent_name: self._list_store[path][7] = self._ent_names[entid]
def on_default_player_species_changed(self, w, *args): match = PATTERN_MD_ENTRY.match(w.get_text()) if match is None: return try: val = int(match.group(1)) except ValueError: return if self._default_player != val: self._default_player = val self.module.set_starter_default_ids(self._default_player, self._default_partner)
def on_spec_entity_edited(self, widget, path, text): match = PATTERN_MD_ENTRY.match(text) if match is None: return entid = match.group(1) self.set_tree_attr(path, entid, 'spec_store', 'pkmn_id', 1) try: v = int(entid) tree_store: Gtk.ListStore = self.builder.get_object('spec_store') tree_store[path][5] = self._get_pkmn_name(v) except ValueError: return
def on_cr_entity_edited(self, widget, path, text): match = PATTERN_MD_ENTRY.match(text) if match is None: return try: entid = int(match.group(1)) except ValueError: return idx = int(self._list_store[path][0]) # entid: self._list_store[path][4] = entid # ent_icon: self._list_store[path][3] = self._get_icon(entid, idx, False) # ent_name: self._list_store[path][6] = self._ent_names[entid]
def _on_species_edited(self, store_name, iters, path, text): store = self.builder.get_object(store_name) match = PATTERN_MD_ENTRY.match(text) if match is None: return try: entid = int(match.group(1)) except ValueError: return idx = int(store[path][0]) # entid: store[path][2] = entid # ent_icon: # If color is orange it's special. store[path][1] = self._get_icon(entid, idx, False, store, iters) # ent_name: store[path][3] = self._ent_names[entid] self._apply()
def on_cr_entity_edited(self, widget, path, text): match = PATTERN_MD_ENTRY.match(text) if match is None: return try: entid = u16_checked(int(match.group(1))) except ValueError: return idx = int(self._list_store[path][0]) # ent_name: try: self._list_store[path][6] = self._ent_names[entid] except KeyError as e: raise UserValueError(_("No Pokémon with this ID found.")) # entid: self._list_store[path][4] = entid # ent_icon: self._list_store[path][3] = self._get_icon(entid, idx, False)