Documentation
¶
Index ¶
- func ClearChildNodesFromScene(ctx *Context, doc *gltf.Document)
- func GetDocument(ctx *Context, inDoc *gltf.Document) *gltf.Document
- func SaveDocument(ctx *Context, doc *gltf.Document, stingrayFormat, fileFormat string) error
- type Context
- func (c *Context) AllocateFile(suffix string) (string, error)
- func (c *Context) ArmorSets() []datalib.ArmorSet
- func (c *Context) AttachmentSlots() map[stingray.Hash]enum.WeaponCustomizationSlot
- func (c *Context) BuildInfo() *ah_bin.BuildInfo
- func (c *Context) Config() appconfig.Config
- func (c *Context) CreateFile(suffix string) (io.WriteCloser, error)
- func (c *Context) Ctx() context.Context
- func (c *Context) Exists(id stingray.FileID, typ stingray.DataType) bool
- func (c *Context) FileID() stingray.FileID
- func (c *Context) GuessFileArmorSet(fileID stingray.FileID) (datalib.ArmorSet, bool)
- func (c *Context) Hashes() map[stingray.Hash]string
- func (c *Context) LanguageMap() map[uint32]string
- func (c *Context) LookupHash(hash stingray.Hash) string
- func (c *Context) LookupString(id uint32) string
- func (c *Context) LookupThinHash(hash stingray.ThinHash) string
- func (c *Context) Open(id stingray.FileID, typ stingray.DataType) (io.ReadSeeker, error)
- func (c *Context) OverrideMaterial(slot stingray.ThinHash, original stingray.Hash) stingray.Hash
- func (c *Context) Read(id stingray.FileID, typ stingray.DataType) ([]byte, error)
- func (c *Context) RootFileID() stingray.FileID
- func (c *Context) Runner() *exec.Runner
- func (c *Context) SelectedArchives() []stingray.Hash
- func (c *Context) SkinOverrideGroups() []datalib.UnitSkinOverrideGroup
- func (c *Context) Statusf(format string, args ...any)
- func (c *Context) ThinHashes() map[stingray.ThinHash]string
- func (c *Context) Warnf(format string, args ...any)
- func (c *Context) WeaponPaintSchemes() []datalib.WeaponCustomizableItem
- func (c *Context) WithFileID(newFileID stingray.FileID) *Context
- func (c *Context) WithMaterialOverrides(newOverrides map[stingray.ThinHash]stingray.Hash) *Context
- type ExtractFunc
- type Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearChildNodesFromScene ¶ added in v0.7.16
Blender throws a hissy fit if a node is reachable from multiple places in a scene, so we need to remove child nodes from the scene before saving.
func GetDocument ¶ added in v0.7.26
Types ¶
type Context ¶ added in v0.3.0
type Context struct {
// contains filtered or unexported fields
}
Context is what's passed to the extractor when extracting the file. The most useful methods are Context.FileID, Context.Open and Context.CreateFile.
A context should only be used once.
func NewContext ¶ added in v0.6.17
func NewContext( ctx context.Context, fileID stingray.FileID, hashes map[stingray.Hash]string, thinHashes map[stingray.ThinHash]string, armorSets map[stingray.Hash]datalib.ArmorSet, skinOverrideGroups []datalib.UnitSkinOverrideGroup, weaponPaintSchemes []datalib.WeaponCustomizableItem, attachmentSlots map[stingray.Hash]enum.WeaponCustomizationSlot, gameBuildInfo *ah_bin.BuildInfo, languageMap map[uint32]string, dataDir *stingray.DataDir, runner *exec.Runner, config appconfig.Config, outPath string, selectedArchives []stingray.Hash, warnf func(format string, args ...any), statusf func(format string, args ...any), ) (_ *Context, getFiles func() []string)
NewContext creates a new Context.
getFiles can be called when the extractor is done to obtain a list of output files.
func (*Context) AllocateFile ¶ added in v0.3.1
AllocateFile is similar to Context.CreateFile, but you get to create the file yourself.
func (*Context) AttachmentSlots ¶ added in v0.7.30
func (c *Context) AttachmentSlots() map[stingray.Hash]enum.WeaponCustomizationSlot
func (*Context) CreateFile ¶ added in v0.3.0
func (c *Context) CreateFile(suffix string) (io.WriteCloser, error)
CreateFile creates an output file. Suffix is appended to the source file name/hash and should be unique to the output format. Call WriteCloser.Close() when done.
func (*Context) GuessFileArmorSet ¶ added in v0.6.17
GuessFileArmorSet uses the selected archives (-t option) to guess which armor set the given file is meant to belong to.
TODO: We might want to take a different approach to this, since we can never truly be sure the archive/armor set ID is correct.
func (*Context) LanguageMap ¶ added in v0.7.1
LanguageMap returns a map of localization strings.
func (*Context) LookupHash ¶ added in v0.6.0
LookupHash returns the cracked hash (if known), or the hex representation otherwise.
func (*Context) LookupString ¶ added in v0.7.1
LookupString returns the localized string for an ID or the hex representation if the ID is not present.
func (*Context) LookupThinHash ¶ added in v0.6.17
LookupThinHash returns the cracked thin hash (if known), or the hex representation otherwise.
func (*Context) Open ¶ added in v0.6.17
Open opens the specified game file. NOTE THAT THIS WILL PREALLOCATE ALL FILE DATA; use Exists() to check if a file exists.
func (*Context) OverrideMaterial ¶ added in v0.7.27
Transparently return the override for a slot if it exists, otherwise return the original
func (*Context) Read ¶ added in v0.7.1
Read reads the specified game file. NOTE THAT THIS WILL PREALLOCATE ALL FILE DATA; use Exists() to check if a file exists.
func (*Context) RootFileID ¶ added in v0.7.16
RootFileID gets the ID of the root file to be extracted.
func (*Context) SelectedArchives ¶ added in v0.7.23
func (*Context) SkinOverrideGroups ¶ added in v0.7.1
func (c *Context) SkinOverrideGroups() []datalib.UnitSkinOverrideGroup
func (*Context) Statusf ¶ added in v0.7.16
Statusf logs a user-visible info message. Use this to display progress in long running extractions
func (*Context) ThinHashes ¶ added in v0.4.0
ThinHashes returns a map of known thin hashes.
func (*Context) Warnf ¶ added in v0.4.2
Warnf logs a user-visible warning message. Use this when an error occurred, but extraction can continue.
func (*Context) WeaponPaintSchemes ¶ added in v0.7.2
func (c *Context) WeaponPaintSchemes() []datalib.WeaponCustomizableItem
func (*Context) WithFileID ¶ added in v0.7.16
Returns a copy of the context with the fileID changed
type ExtractFunc ¶
func ExtractFuncRaw ¶ added in v0.1.7
func ExtractFuncRaw(extension string) ExtractFunc
func ExtractFuncRawCombined ¶ added in v0.5.6
func ExtractFuncRawCombined(extension string) ExtractFunc
func ExtractFuncRawSingleType ¶ added in v0.5.6
func ExtractFuncRawSingleType(extension string, typ stingray.DataType) ExtractFunc