app

package
v0.7.14 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: BSD-3-Clause Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectGameDir added in v0.3.1

func DetectGameDir() (string, error)

Returns error if steam path couldn't be found.

func FileMetadataTypeName added in v0.7.0

func FileMetadataTypeName(fieldName string) string

String representation for metadata types that should be used in help texts

func LoadPaintSchemes added in v0.7.2

func LoadPaintSchemes(dataDir *stingray.DataDir, languageMap map[uint32]string) ([]datalib.WeaponCustomizableItem, error)

func LoadSkinOverrides added in v0.7.2

func LoadSkinOverrides(dataDir *stingray.DataDir, languageMap map[uint32]string) ([]datalib.UnitSkinOverrideGroup, error)

func MetadataFilterExprMatches added in v0.7.0

func MetadataFilterExprMatches(prog *FilterExprProgram, meta FileMetadata) (bool, error)

func NewConsolePrinter added in v0.5.17

func NewConsolePrinter(colorOutput bool, stdout io.Writer, stderr io.Writer) *printer

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
	ThinHashes         map[stingray.ThinHash]string
	ArmorSets          map[stingray.Hash]datalib.ArmorSet
	SkinOverrideGroups []datalib.UnitSkinOverrideGroup
	WeaponPaintSchemes []datalib.WeaponCustomizableItem
	DataDir            *stingray.DataDir
	LanguageMap        map[uint32]string
	Metadata           map[stingray.FileID]FileMetadata
	GameBuildInfo      *ah_bin.BuildInfo
}

func OpenGameDir added in v0.3.1

func OpenGameDir(ctx context.Context, gameDir string, hashStrings []string, thinhashes []string, language stingray.ThinHash, 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 appconfig.Config, runner *exec.Runner, gltfDoc *gltf.Document, archiveIDs []stingray.Hash, printer Printer) ([]string, error)

Returns path to extracted file/directory.

func (*App) LookupHash added in v0.4.2

func (a *App) LookupHash(hash stingray.Hash) string

Prints hash if human-readable name is unknown.

func (*App) LookupString added in v0.7.13

func (a *App) LookupString(stringId uint32) string

Prints string if string id is known.

func (*App) LookupThinHash added in v0.6.0

func (a *App) LookupThinHash(hash stingray.ThinHash) string

Prints hash if human-readable name is unknown.

func (*App) MatchingFiles

func (a *App) MatchingFiles(
	includeGlob string,
	excludeGlob string,
	includeOnlyTypes []string,
	includeArchiveIDs []stingray.Hash,
	metadataFilter string,
) (
	map[stingray.FileID]struct{},
	error,
)

type FileMetadata added in v0.7.0

type FileMetadata struct {
	// Meta-info about which fields should be considered
	// as having an assigned value.
	AvailableFields map[string]bool `meta:"true"`

	Type     stingray.Hash     `help:"File type" example:"\"unit\""`
	Archives []stingray.Hash   `help:"Archives the file is contained in"`
	Width    int               `help:"Texture width"`
	Height   int               `help:"Texture height"`
	Format   string            `help:"Texture format" example:"\"BC1UNorm\""`
	Language stingray.ThinHash `help:"Strings language" example:"\"us\""`
}

Searchable metadata

type FilterExprProgram added in v0.7.0

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

func CompileMetadataFilterExpr added in v0.7.0

func CompileMetadataFilterExpr(src string) (*FilterExprProgram, error)

type Printer

type Printer interface {
	Infof(f string, a ...any)
	Warnf(f string, a ...any)
	Errorf(f string, a ...any)
	Fatalf(f string, a ...any)
	Statusf(f string, a ...any)
	NoStatus()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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