app

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigFormat = ConfigTemplate{
	Extractors: map[string]ConfigTemplateExtractor{
		"wwise_stream": {
			Category: "audio",
			Options: map[string]ConfigTemplateOption{
				"format": {
					PossibleValues: []string{"ogg", "wav", "aac", "mp3", "wem", "source"},
				},
			},
		},
		"wwise_bank": {
			Category: "audio",
			Options: map[string]ConfigTemplateOption{
				"format": {
					PossibleValues: []string{"ogg", "wav", "aac", "mp3", "bnk", "source"},
				},
			},
		},
		"bik": {
			Category: "video",
			Options: map[string]ConfigTemplateOption{
				"format": {
					PossibleValues: []string{"mp4", "bik", "source"},
				},
			},
		},
		"texture": {
			Category: "image",
			Options: map[string]ConfigTemplateOption{
				"format": {
					PossibleValues: []string{"png", "dds", "source"},
				},
			},
		},
		"unit": {
			Category: "model",
			Options: map[string]ConfigTemplateOption{
				"format": {
					PossibleValues: []string{"glb", "source"},
				},
				"meshes": {
					PossibleValues: []string{"highest_detail", "all"},
				},
			},
		},
		"raw": {
			Category: "",
			Options: map[string]ConfigTemplateOption{
				"format": {
					PossibleValues: []string{"source"},
				},
			},
			DefaultDisabled: true,
		},
	},
	Fallback: "raw",
}

Functions

func DetectGameDir added in v0.3.1

func DetectGameDir() (string, error)

Returns error if steam path couldn't be found.

func ExtractorConfigHelpMessage

func ExtractorConfigHelpMessage(template ConfigTemplate) string

func ParseExtractorConfig

func ParseExtractorConfig(template ConfigTemplate, cfgStr string) (map[string]map[string]string, error)

func ParseHashes added in v0.3.1

func ParseHashes(str string) []string

func VerifyGameDir added in v0.3.1

func VerifyGameDir(path string) error

Types

type App

type App struct {
	Hashes  map[stingray.Hash]string
	DataDir *stingray.DataDir
}

func OpenGameDir added in v0.3.1

func OpenGameDir(ctx context.Context, gameDir string, hashes []string, onProgress func(curr, total int)) (*App, error)

Open game dir and read metadata.

func (*App) ExtractFile

func (a *App) ExtractFile(ctx context.Context, id stingray.FileID, outDir string, extrCfg map[string]map[string]string, runner *exec.Runner) ([]string, error)

Returns path to extracted file/directory.

func (*App) MatchingFiles

func (a *App) MatchingFiles(includeGlob, excludeGlob string, cfgTemplate ConfigTemplate, cfg map[string]map[string]string) (map[stingray.FileID]*stingray.File, error)

type ConfigTemplate

type ConfigTemplate struct {
	Extractors map[string]ConfigTemplateExtractor
	Fallback   string
}

type ConfigTemplateExtractor

type ConfigTemplateExtractor struct {
	Category        string
	Options         map[string]ConfigTemplateOption
	DefaultDisabled bool
}

type ConfigTemplateOption

type ConfigTemplateOption struct {
	PossibleValues []string
}

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(colorOutput bool, stdout io.Writer, stderr io.Writer) *Printer

func (*Printer) Errorf

func (p *Printer) Errorf(f string, a ...any)

func (*Printer) Fatalf

func (p *Printer) Fatalf(f string, a ...any)

func (*Printer) Infof

func (p *Printer) Infof(f string, a ...any)

func (*Printer) NoStatus

func (p *Printer) NoStatus()

func (*Printer) Statusf

func (p *Printer) Statusf(f string, a ...any)

func (*Printer) Warnf

func (p *Printer) Warnf(f string, a ...any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL