Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
 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)