Ejemplo n.º 1
0
def start(mod_path, hoi4_path):
    t0 = time.time()
    output_file = open("validator.txt", 'w', 'utf-8-sig')
    missing_divisions_names_group(mod_path, output_file)
    check_for_old_generals(mod_path, output_file)
    check_for_name_lists(mod_path, output_file)
    check_brackets(mod_path, output_file)
    check_for_double_locs(mod_path, output_file)
    check_for_missing_gfx(mod_path, output_file, hoi4_path)
    check_for_missing_focus(mod_path, output_file)
    check_for_missing_cores(mod_path, output_file)
    check_for_missing_OOB(mod_path, output_file)
    t0 = time.time() - t0
    print("Total time taken: " + (t0*1000).__str__() + " ms")
Ejemplo n.º 2
0
def start(mod_path, hoi4_path):
    t0 = time.time()
    print(dirName + '\\options.txt')
    optionsdict = {}
    options_file = open('options.txt', 'r', 'utf-8-sig')
    for line in options_file:
        #this checks through the options file to see if a given line is an option. If so, it checks the
        if ('#' in line) == False:
            line = line.strip()
            #print(line)
            if line != 'empty' and line != '':
                linelist = line.split(' = ')
                if linelist[1].strip() == 'yes':
                    optionsdict[linelist[0].strip()] = True
                else:
                    optionsdict[linelist[0].strip()] = False
    options_file.close()
    output_file = open("validator.txt", 'w', 'utf-8-sig')
    if optionsdict["check_ideologies"]:
        check_ideologies(mod_path, output_file)
    if optionsdict["check_missing_division_name_group"]:
        missing_divisions_names_group(mod_path, output_file,
                                      optionsdict["skip_unlock"])
    if optionsdict["check_for_old_generals"]:
        check_for_old_generals(mod_path, output_file)
    if optionsdict["check_for_name_lists"]:
        check_for_name_lists(mod_path, output_file)
    if optionsdict["check_for_brackets"]:
        check_brackets(mod_path, output_file)
    if optionsdict["check_for_double_locs"]:
        check_for_double_locs(mod_path, output_file)
    if optionsdict["check_for_missing_gfx"]:
        check_for_missing_gfx(mod_path, output_file, hoi4_path)
    if optionsdict["check_for_missing_focus"]:
        check_for_missing_focus(mod_path, output_file)
    if optionsdict["check_for_missing_cores"]:
        check_for_missing_cores(mod_path, output_file)
    if optionsdict["check_for_missing_oobs"]:
        check_for_missing_OOB(mod_path, output_file)
    check_events(
        mod_path, output_file,
        optionsdict)  #optionsdict is checked in the function, so no if for it
    if optionsdict["check_endlines"]:
        check_endlines(mod_path, output_file)
    if optionsdict["check_generals"]:
        check_for_missing_General(mod_path, output_file)
    if optionsdict["list_general_ids"]:
        create_general_list(mod_path, output_file)
    if optionsdict["check_for_equals_no"]:
        check_for_equals_no(mod_path, output_file)
    if optionsdict["check_for_unused_oobs"]:
        check_for_unused_OOB(mod_path, output_file)
    if optionsdict["check_for_missing_loc"]:
        check_for_missing_loc(mod_path, output_file, optionsdict)
    if optionsdict["check_for_alive_checks"]:
        check_alive_check(mod_path, output_file)
    if optionsdict["check_for_missing_equals"]:
        check_missing_equals(mod_path, output_file)
    if optionsdict["check_for_duplicate_ids"]:
        check_duplicate_ids(mod_path, output_file)
    if optionsdict["check_for_event_use"]:
        check_event_usage(mod_path, output_file)
    if optionsdict["check_flag_usage"]:
        check_flag_usage(mod_path, output_file)
    if optionsdict["check_idea_usage"]:
        check_idea_usage(mod_path, output_file)
    if optionsdict["check_mutually_exclusive_focuses"]:
        check_mutually_exclusive_focuses(mod_path, output_file)
    if optionsdict["check_naval_tech"]:
        check_for_naval_aviation_tech(mod_path, output_file)
    if optionsdict["check_states"]:
        check_states(mod_path, output_file)
    if optionsdict["check_vp_loc"]:
        check_for_vp_loc(mod_path, output_file, False)
    if optionsdict["check_kr_endo_vp_loc"]:
        check_for_vp_loc(mod_path, output_file, True)

    check_OOB_Contents(
        mod_path, output_file,
        optionsdict)  #optionsdict is checked in the function, so no if for it
    t0 = time.time() - t0
    print("Total time taken: " + (t0 * 1000).__str__() + " ms")