datalib

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BitsPerWord = 32 << (^uint(0) >> 63)

Variables

View Source
var DLHashesToStrings map[DLHash]string

Functions

func LoadArmorSetDefinitions

func LoadArmorSetDefinitions(strings map[uint32]string) (map[stingray.Hash]ArmorSet, error)

Map of archive hash to armor set

func ParseVisibilityMasks

func ParseVisibilityMasks() (map[stingray.Hash]VisibilityMaskComponent, error)

Types

type ArmorSet

type ArmorSet struct {
	Name         string
	SetId        uint32
	Passive      CustomizationKitPassive
	Type         CustomizationKitType
	UnitMetadata map[stingray.Hash]UnitData
}

type Body

type Body struct {
	Type          CustomizationKitBodyType
	Unk00         uint32
	PiecesAddress int64
	PiecesCount   int64
}

type ComponentIndexData

type ComponentIndexData struct {
	Resource stingray.Hash
	Index    uint32
	// contains filtered or unexported fields
}

type CustomizationKitBodyType

type CustomizationKitBodyType uint32
const (
	BodyTypeStocky CustomizationKitBodyType = 0
	BodyTypeSlim   CustomizationKitBodyType = 1
	BodyTypeUnk    CustomizationKitBodyType = 2
	BodyTypeAny    CustomizationKitBodyType = 3
)

func (CustomizationKitBodyType) String

func (b CustomizationKitBodyType) String() string

type CustomizationKitPassive

type CustomizationKitPassive uint32
const (
	PassiveNone                 CustomizationKitPassive = 0
	PassivePadding              CustomizationKitPassive = 1
	PassiveTactician            CustomizationKitPassive = 2
	PassiveFireSupport          CustomizationKitPassive = 3
	PassiveUnk01                CustomizationKitPassive = 4
	PassiveExperimental         CustomizationKitPassive = 5
	PassiveCombatEngineer       CustomizationKitPassive = 6
	PassiveCombatMedic          CustomizationKitPassive = 7
	PassiveBattleHardened       CustomizationKitPassive = 8
	PassiveHero                 CustomizationKitPassive = 9
	PassiveReinforcedEpaulettes CustomizationKitPassive = 10
	PassiveFireResistant        CustomizationKitPassive = 11
	PassivePeakPhysique         CustomizationKitPassive = 12
	PassiveGasResistant         CustomizationKitPassive = 13
	PassiveUnflinching          CustomizationKitPassive = 14
	PassiveAcclimated           CustomizationKitPassive = 15
	PassiveSiegeReady           CustomizationKitPassive = 16
	PassiveIntegratedExplosives CustomizationKitPassive = 17
	PassiveGunslinger           CustomizationKitPassive = 18
	PassiveAdrenoDefibrillator  CustomizationKitPassive = 19
	PassiveBallisticPadding     CustomizationKitPassive = 20
	PassiveFeetFirst            CustomizationKitPassive = 30
)

func (CustomizationKitPassive) String

func (v CustomizationKitPassive) String() string

type CustomizationKitPieceType

type CustomizationKitPieceType uint32
const (
	TypeArmor        CustomizationKitPieceType = 0
	TypeUndergarment CustomizationKitPieceType = 1
	TypeAccessory    CustomizationKitPieceType = 2
)

func (CustomizationKitPieceType) String

func (b CustomizationKitPieceType) String() string

type CustomizationKitRarity

type CustomizationKitRarity uint32
const (
	RarityCommon CustomizationKitRarity = 0
	// Not really sure if this is the name, but w/e
	RarityUncommon CustomizationKitRarity = 1
	RarityHeroic   CustomizationKitRarity = 2
)

func (CustomizationKitRarity) String

func (v CustomizationKitRarity) String() string

type CustomizationKitSlot

type CustomizationKitSlot uint32
const (
	SlotHelmet        CustomizationKitSlot = 0
	SlotCape          CustomizationKitSlot = 1
	SlotTorso         CustomizationKitSlot = 2
	SlotHips          CustomizationKitSlot = 3
	SlotLeftLeg       CustomizationKitSlot = 4
	SlotRightLeg      CustomizationKitSlot = 5
	SlotLeftArm       CustomizationKitSlot = 6
	SlotRightArm      CustomizationKitSlot = 7
	SlotLeftShoulder  CustomizationKitSlot = 8
	SlotRightShoulder CustomizationKitSlot = 9
)

func (CustomizationKitSlot) String

func (b CustomizationKitSlot) String() string

type CustomizationKitType

type CustomizationKitType uint32
const (
	KitArmor  CustomizationKitType = 0
	KitHelmet CustomizationKitType = 1
	KitCape   CustomizationKitType = 2
)

func (CustomizationKitType) String

func (v CustomizationKitType) String() string

type CustomizationKitWeight

type CustomizationKitWeight uint32
const (
	WeightLight  CustomizationKitWeight = 0
	WeightMedium CustomizationKitWeight = 1
	WeightHeavy  CustomizationKitWeight = 2
)

func (CustomizationKitWeight) String

func (b CustomizationKitWeight) String() string

type DLBitfieldOrArrayLen

type DLBitfieldOrArrayLen uint16

func (DLBitfieldOrArrayLen) GetArrayLen

func (b DLBitfieldOrArrayLen) GetArrayLen() uint16

func (DLBitfieldOrArrayLen) GetBits

func (b DLBitfieldOrArrayLen) GetBits() uint8

func (DLBitfieldOrArrayLen) GetOffset

func (b DLBitfieldOrArrayLen) GetOffset() uint8

func (DLBitfieldOrArrayLen) MarshalJSON

func (b DLBitfieldOrArrayLen) MarshalJSON() ([]byte, error)

type DLEnumDesc

type DLEnumDesc struct {
	Name    string            `json:"name"`
	Flags   DLTypeFlags       `json:"flags"`
	Storage DLTypeStorage     `json:"storage"`
	Values  []DLEnumValueDesc `json:"values"`
}

type DLEnumValueDesc

type DLEnumValueDesc struct {
	Name    string   `json:"name"`
	Comment string   `json:"comment,omitempty"`
	Value   uint64   `json:"value"`
	Aliases []string `json:"aliases,omitempty"`
}

type DLHash

type DLHash uint32

func Sum

func Sum(text string) DLHash

func (DLHash) MarshalText

func (h DLHash) MarshalText() ([]byte, error)

func (DLHash) String

func (h DLHash) String() string

func (DLHash) StringEndian

func (h DLHash) StringEndian(endian binary.ByteOrder) string

type DLInstance

type DLInstance struct {
	DLInstanceHeader
	Data []byte
}

type DLInstanceHeader

type DLInstanceHeader struct {
	Magic   [4]byte
	Version uint32
	Type    DLHash
	Size    uint32
	Is64Bit uint8
	// contains filtered or unexported fields
}

type DLMemberDesc

type DLMemberDesc struct {
	Name         string      `json:"name"`
	Comment      string      `json:"comment,omitempty"`
	Type         DLType      `json:"type_flags"`
	TypeID       DLHash      `json:"type"`
	Size         uint32      `json:"size"`
	Alignment    uint32      `json:"alignment"`
	Offset       uint32      `json:"offset"`
	DefaultValue []uint8     `json:"-"`
	Flags        DLTypeFlags `json:"flags"`
}

type DLSubdata

type DLSubdata struct {
	DLSubdataHeader
	Data []byte
}

type DLSubdataHeader

type DLSubdataHeader struct {
	Magic   [4]byte
	Version uint32
	Type    DLHash
	Size    uint32
	Is64Bit uint8
	// contains filtered or unexported fields
}

type DLType

type DLType struct {
	Atom                   DLTypeAtom           `json:"atom"`
	Storage                DLTypeStorage        `json:"storage"`
	BitfieldInfoOrArrayLen DLBitfieldOrArrayLen `json:"union_arrayinfo_bfinfo"`
}

type DLTypeAtom

type DLTypeAtom uint8
const (
	POD DLTypeAtom = iota
	ARRAY
	INLINE_ARRAY
	BITFIELD

	ATOM_CNT
)

func (DLTypeAtom) MarshalText

func (atom DLTypeAtom) MarshalText() ([]byte, error)

func (DLTypeAtom) String

func (i DLTypeAtom) String() string

type DLTypeDesc

type DLTypeDesc struct {
	Name      string         `json:"name"`
	Flags     DLTypeFlags    `json:"flags"`
	Size      uint32         `json:"size"`
	Alignment uint32         `json:"alignment"`
	Members   []DLMemberDesc `json:"members,omitempty"`
	Comment   string         `json:"comment,omitempty"`
}

type DLTypeFlags

type DLTypeFlags uint32

4 bytes for alignment purposes

func (DLTypeFlags) HasSubdata

func (f DLTypeFlags) HasSubdata() bool

func (DLTypeFlags) IsExternal

func (f DLTypeFlags) IsExternal() bool

func (DLTypeFlags) IsUnion

func (f DLTypeFlags) IsUnion() bool

func (DLTypeFlags) MarshalJSON

func (f DLTypeFlags) MarshalJSON() ([]byte, error)

func (DLTypeFlags) VerifyExternalSizeAlign

func (f DLTypeFlags) VerifyExternalSizeAlign() bool

type DLTypeLib

type DLTypeLib struct {
	DLTypeLibHeader `json:"header"`
	Types           map[DLHash]DLTypeDesc `json:"types,omitempty"`
	Enums           map[DLHash]DLEnumDesc `json:"enums,omitempty"`
}

func ParseTypeLib

func ParseTypeLib(data []byte) (*DLTypeLib, error)

type DLTypeLibHeader

type DLTypeLibHeader struct {
	ID      [4]uint8 `json:"-"`
	Version uint32   `json:"version"`

	TypeCount      uint32 `json:"type_count"`
	EnumCount      uint32 `json:"enum_count"`
	MemberCount    uint32 `json:"member_count"`
	EnumValueCount uint32 `json:"enum_value_count"`
	EnumAliasCount uint32 `json:"enum_alias_count"`

	DefaultValueSize    uint32 `json:"default_value_size"`
	TypeInfoStringsSize uint32 `json:"typeinfo_strings_size"`
}

type DLTypeStorage

type DLTypeStorage uint8
const (
	INT8 DLTypeStorage = iota
	INT16
	INT32
	INT64
	UINT8
	UINT16
	UINT32
	UINT64
	FP32
	FP64
	ENUM_INT8
	ENUM_INT16
	ENUM_INT32
	ENUM_INT64
	ENUM_UINT8
	ENUM_UINT16
	ENUM_UINT32
	ENUM_UINT64
	STR
	PTR
	STRUCT

	STORAGE_CNT
)

func (DLTypeStorage) MarshalText

func (storage DLTypeStorage) MarshalText() ([]byte, error)

func (DLTypeStorage) String

func (i DLTypeStorage) String() string

type DLWidthDependentUInt32

type DLWidthDependentUInt32 [2]uint32

func (DLWidthDependentUInt32) Get32

func (u DLWidthDependentUInt32) Get32() uint32

func (DLWidthDependentUInt32) Get64

func (u DLWidthDependentUInt32) Get64() uint32

func (DLWidthDependentUInt32) GetNative

func (u DLWidthDependentUInt32) GetNative() uint32

type GetResourceFunc

type GetResourceFunc func(id stingray.FileID, typ stingray.DataType) (data []byte, exists bool, err error)

type HelldiverCustomizationKit

type HelldiverCustomizationKit struct {
	Id               uint32
	DlcId            uint32
	SetId            uint32
	NameUpper        uint32
	NameCased        uint32
	Description      uint32
	Rarity           CustomizationKitRarity
	Passive          CustomizationKitPassive
	Archive          stingray.Hash
	Type             CustomizationKitType
	Unk00            uint32
	BodyArrayAddress int64
	BodyCount        int64
}

type Piece

type Piece struct {
	Path              stingray.Hash
	Slot              CustomizationKitSlot
	Type              CustomizationKitPieceType
	Weight            CustomizationKitWeight
	Unk00             uint32
	MaterialLut       stingray.Hash
	PatternLut        stingray.Hash
	CapeLut           stingray.Hash
	CapeGradient      stingray.Hash
	CapeNac           stingray.Hash
	DecalScalarFields stingray.Hash
	BaseData          stingray.Hash
	DecalSheet        stingray.Hash
	ToneVariations    stingray.Hash
}

type UnitCustomizationCollectionCategoryType

type UnitCustomizationCollectionCategoryType uint32
const (
	CategoryHangar UnitCustomizationCollectionCategoryType = iota
	CategoryDeliverySystem
	CategoryVehicleBay
	CategoryCount
)

func (UnitCustomizationCollectionCategoryType) String

type UnitCustomizationCollectionType

type UnitCustomizationCollectionType uint32
const (
	CollectionShuttle UnitCustomizationCollectionType = iota
	CollectionHellpod
	CollectionHellpodRack
	CollectionCombatWalker
	CollectionCombatWalkerEmancipator
	CollectionFRV
	CollectionCount
)

func (UnitCustomizationCollectionType) String

type UnitCustomizationMaterialOverrides

type UnitCustomizationMaterialOverrides struct {
	MaterialID        stingray.ThinHash
	MaterialLut       stingray.Hash
	DecalSheet        stingray.Hash
	PatternLut        stingray.Hash
	PatternMasksArray stingray.Hash
}

type UnitCustomizationSetting

type UnitCustomizationSetting struct {
	DebugName      string
	ID             stingray.ThinHash
	Archive        stingray.Hash
	Name           string
	Thumbnail      stingray.Hash
	UIWidgetColors []mgl32.Vec3
}

type UnitCustomizationSettings

type UnitCustomizationSettings struct {
	ParentCollectionType UnitCustomizationCollectionType
	CollectionType       UnitCustomizationCollectionType
	ObjectName           string
	SkinName             string
	CategoryType         UnitCustomizationCollectionCategoryType
	Skins                []UnitCustomizationSetting
	ShowroomOffset       mgl32.Vec3
	ShowroomRotation     mgl32.Vec3
}

func ParseUnitCustomizationSettings

func ParseUnitCustomizationSettings(getResource GetResourceFunc) ([]UnitCustomizationSettings, error)

type UnitData

type UnitData struct {
	Slot              CustomizationKitSlot
	Type              CustomizationKitPieceType
	Weight            CustomizationKitWeight
	BodyType          CustomizationKitBodyType
	MaterialLut       stingray.Hash
	PatternLut        stingray.Hash
	CapeLut           stingray.Hash
	CapeGradient      stingray.Hash
	CapeNac           stingray.Hash
	DecalScalarFields stingray.Hash
	BaseData          stingray.Hash
	DecalSheet        stingray.Hash
	ToneVariations    stingray.Hash
}

type VisibilityMaskComponent

type VisibilityMaskComponent struct {
	MaskInfos      [64]VisibilityMaskInfo
	Randomizations [4]VisibilityRandomization
}

func (*VisibilityMaskComponent) Length

func (v *VisibilityMaskComponent) Length() int

type VisibilityMaskInfo

type VisibilityMaskInfo struct {
	Name        stingray.ThinHash
	Index       uint16
	StartHidden uint8
	// contains filtered or unexported fields
}

type VisibilityRandomization

type VisibilityRandomization struct {
	Identifier     stingray.ThinHash
	MaskIndexNames [7]stingray.ThinHash
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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