Пример #1
0
func init() {
	flag.Usage = usage
	flag.StringVar(&imgconf.IniPath, "celini", "cel.ini", "Path to an ini file containing image information.")
	flag.StringVar(&mpq.ExtractPath, "mpqdump", "mpqdump/", "Path to an extracted MPQ file.")
	flag.StringVar(&mpq.IniPath, "mpqini", "mpq.ini", "Path to an ini file containing relative path information.")
	flag.Parse()
	err := mpq.Init()
	if err != nil {
		log.Fatalln(err)
	}
	err = imgconf.Init()
	if err != nil {
		log.Fatalln(err)
	}
}
Пример #2
0
func main() {
	if flag.NArg() < 1 {
		flag.Usage()
		os.Exit(1)
	}
	if flag.NArg() > 0 {
		if path.Ext(flag.Arg(0)) == ".cl2" {
			imgconf.IniPath = "cl2.ini"
		}
	}
	err := imgconf.Init()
	if err != nil {
		log.Fatalln(err)
	}
	for _, imgName := range flag.Args() {
		err = imgarchive.Extract(imgName)
		if err != nil {
			log.Fatalln(err)
		}
	}
}
Пример #3
0
func init() {
	flag.Usage = usage
	flag.BoolVar(&flagAll, "a", false, "Dump all dungeons.")
	flag.StringVar(&imgconf.IniPath, "celini", "cel.ini", "Path to an ini file containing image information.")
	flag.StringVar(&dunconf.IniPath, "dunini", "dun.ini", "Path to an ini file containing starting coordinate information.")
	flag.StringVar(&mpq.ExtractPath, "mpqdump", "mpqdump/", "Path to an extracted MPQ file.")
	flag.StringVar(&mpq.IniPath, "mpqini", "mpq.ini", "Path to an ini file containing relative path information.")
	flag.Parse()
	err := mpq.Init()
	if err != nil {
		log.Fatalln(err)
	}
	err = dunconf.Init()
	if err != nil {
		log.Fatalln(err)
	}
	err = imgconf.Init()
	if err != nil {
		log.Fatalln(err)
	}
}