def set_race(self, player_index, race): player = self.players[int(player_index)] player.race = race style = Style() style.load(res.get_text("ui/style", append=True, locale=True)) race_name = style.get(player.race, 'title') self.broadcast([player.login, ] + race_name)
def set_faction(self, player_index, faction): player = self.players[int(player_index)] player.faction = faction style = Style() style.load(res.get_text_file("ui/style", append=True, localize=True)) faction_name = style.get(player.faction, 'title') self.broadcast([player.login, ] + faction_name)
def _move_recommended_maps(w): style = Style() style.load(res.get_text("ui/style", append=True, locale=True)) for n in reversed(style.get("parameters", "recommended_maps")): for m in reversed(w[:]): # reversed so the custom map is after the official map if m.get_name()[:-4] == n: w.remove(m) w.insert(0, m)
def _move_recommended_maps(w): from definitions import Style style = Style() style.load(get_text_file("ui/style", append=True, localize=True)) for n in reversed(style.get("parameters", "recommended_maps")): for m in reversed(w[:]): # reversed so the custom map is after the official map if m.get_name()[:-4] == n: w.remove(m) w.insert(0, m)
def set_faction(self, player_index, faction): player = self.players[int(player_index)] player.faction = faction style = Style() style.load(res.get_text_file("ui/style", append=True, localize=True)) faction_name = style.get(player.faction, 'title') self.broadcast([ player.login, ] + faction_name)