예제 #1
0
func initResources() {
	var pBar *progressBar
	resource.Init(func(progress float64, done bool) {
		if !done {
			if pBar == nil {
				pBar = newProgressBar()
			}
			pBar.update(progress, fmt.Sprintf("Downloading textures: %v/100", int(100*progress)))
		} else {
			if pBar != nil {
				pBar.remove()
			}
			reloadResources()
		}
	}, syncChan)

	for _, pck := range strings.Split(resourcePacks.Value(), ",") {
		if pck == "" {
			continue
		}
		resource.LoadZip(pck)
	}
	locale.Clear()
	loadBiomes()
	render.LoadSkinBuffer()
}
예제 #2
0
func AddPack(path string) {
	console.Text("Adding pack " + path)
	if err := resource.LoadZip(path); err != nil {
		fmt.Println("Failed to load pack", path)
		return
	}
	if resourcePacks.Value() != "" {
		resourcePacks.SetValue(resourcePacks.Value() + "," + path)
	} else {
		resourcePacks.SetValue(path)
	}
	reloadResources()
}