Esempio n. 1
0
def reload_all():
    update_display_caption()
    res.update_mods_list()
    sounds.load_default()
    rules.load(res.get_text("rules", append=True))
    load_ai(res.get_text("ai", append=True))  # just in case
    style.load(res.get_text("ui/style", append=True, locale=True))
    while (res.alerts):
        voice.alert(res.alerts.pop(0))
Esempio n. 2
0
def reload_all():
    update_display_caption()
    res.update_mods_list()
    sounds.load_default()
    rules.load(res.get_text("rules", append=True))
    load_ai(res.get_text("ai", append=True)) # just in case
    style.load(res.get_text("ui/style", append=True, locale=True))
    while(res.alerts):
        voice.alert(res.alerts.pop(0))
Esempio n. 3
0
 def load_and_build_map(self, map):
     if os.path.exists(MAPERROR_PATH):
         try:
             os.remove(MAPERROR_PATH)
         except:
             warning("cannot remove map error file")
     try:
         rules.load(res.get_text_file("rules", append=True), map.campaign_rules, map.additional_rules)
         load_ai(res.get_text_file("ai", append=True), map.campaign_ai, map.additional_ai)
         self._load_map(map)
         self.map = map
         self.square_width = int(self.square_width * PRECISION)
         self._build_map()
     except MapError, msg:
         warning("map error: %s", msg)
         self.map_error = "map error: %s" % msg
         return False
Esempio n. 4
0
 def load_and_build_map(self, map):
     if os.path.exists(MAPERROR_PATH):
         try:
             os.remove(MAPERROR_PATH)
         except:
             warning("cannot remove map error file")
     try:
         rules.load(res.get_text_file("rules", append=True),
                    map.campaign_rules, map.additional_rules)
         load_ai(res.get_text_file("ai", append=True), map.campaign_ai,
                 map.additional_ai)
         self._load_map(map)
         self.map = map
         self.square_width = int(self.square_width * PRECISION)
         self._build_map()
     except MapError, msg:
         warning("map error: %s", msg)
         self.map_error = "map error: %s" % msg
         return False
Esempio n. 5
0
 def load_and_build_map(self, map):
     if os.path.exists(MAPERROR_PATH):
         try:
             os.remove(MAPERROR_PATH)
         except:
             warning("cannot remove map error file")
     try:
         rules.load(res.get_text("rules", append=True), map.campaign_rules, map.additional_rules)
         load_ai(res.get_text("ai", append=True), map.campaign_ai, map.additional_ai)
         self._load_map(map)
         self.map = map
         self.square_width = int(self.square_width * 1000) # XXX 1000=PRECISION?
         self._build_map()
         if self.objective:
             self.introduction = [4020] + self.objective
         else:
             self.introduction = []
     except MapError, msg:
         warning("map error: %s", msg)
         self.map_error = "map error: %s" % msg
         return False
Esempio n. 6
0
 def load_rules_and_ai(self, res):
     from definitions import rules, load_ai
     rules.load(res.get_text_file("rules", append=True), self.campaign_rules, self.additional_rules)
     load_ai(res.get_text_file("ai", append=True), self.campaign_ai, self.additional_ai)
Esempio n. 7
0
 def load_rules_and_ai(self, res):
     from definitions import rules, load_ai
     rules.load(res.get_text_file("rules", append=True), self.campaign_rules, self.additional_rules)
     load_ai(res.get_text_file("ai", append=True), self.campaign_ai, self.additional_ai)