export

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpriteLists = []SpriteList{
	{
		Path:         "Art/UIImages1.txt",
		NamePrefix:   "Art/2DArt/UIImages/",
		SpritePrefix: "Art/Textures/Interface/2D/",
	},
	{
		Path:         "Art/UIDivinationImages.txt",
		NamePrefix:   "Art/2DItems/Divination/Images/",
		SpritePrefix: "Art/Textures/Interface/2D/DivinationCards/",
	},
	{
		Path:         "Art/UIShopImages.txt",
		NamePrefix:   "Art/2DArt/Shop/",
		SpritePrefix: "Art/Textures/Interface/2D/Shop/",
	},
}

SpriteLists contains all known sprite sheet definitions

Functions

func ConvertDDSToPNG

func ConvertDDSToPNG(ddsData []byte, crop *CropParams, outputPath string) error

ConvertDDSToPNG converts a DDS image to PNG format using ImageMagick Optionally crops the image if crop parameters are provided Returns an error if ImageMagick is not installed or conversion fails

func DecodeUTF16LE

func DecodeUTF16LE(data []byte) (string, error)

DecodeUTF16LE decodes UTF-16LE byte data to a string

func IsInsideSprite

func IsInsideSprite(path string) bool

IsInsideSprite checks if the given path is inside a sprite sheet

Types

type CropParams

type CropParams struct {
	Width  int
	Height int
	Top    int
	Left   int
}

CropParams defines optional crop parameters for image extraction

type Exporter

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

Exporter handles exporting files from bundles to disk

func NewExporter

func NewExporter(loader FileLoader, outputDir string) *Exporter

NewExporter creates a new file exporter

func (*Exporter) ExportFiles

func (e *Exporter) ExportFiles(files []string, progressCallback ProgressCallback) error

ExportFiles exports the specified files from bundles to the output directory Handles sprite extraction and DDS conversion as needed

type FileLoader

type FileLoader interface {
	GetFile(path string) ([]byte, error)
}

FileLoader defines the interface for loading files from bundles

type ProgressCallback

type ProgressCallback func(current int, total int, description string)

ProgressCallback is called to report export progress

type SpriteImage

type SpriteImage struct {
	Name       string
	SpritePath string
	Top        int
	Left       int
	Width      int
	Height     int
}

SpriteImage represents a single image within a sprite sheet

func ParseSpriteIndex

func ParseSpriteIndex(data []byte) ([]SpriteImage, error)

ParseSpriteIndex parses a sprite index file (UTF-16LE encoded) Returns a slice of SpriteImage entries

type SpriteList

type SpriteList struct {
	Path         string
	NamePrefix   string
	SpritePrefix string
}

SpriteList defines a sprite sheet configuration

Jump to

Keyboard shortcuts

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