userdir

package
v0.0.0-...-79996cc Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigDirectoryName = "doodle"

	ProfileDirectory    string
	LevelDirectory      string
	LevelPackDirectory  string
	DoodadDirectory     string
	CampaignDirectory   string
	ScreenshotDirectory string
	SaveFile            string

	CacheDirectory string
	FontDirectory  string
)

Profile Directory settings.

Functions

func CacheFilename

func CacheFilename(filename ...string) string

CacheFilename returns a path to a file in the cache folder. Send in path components and not literal slashes, like CacheFilename("images", "chunks", "id.bmp")

func DoodadPath

func DoodadPath(filename string) string

DoodadPath is like LevelPath but for Doodad files.

func LevelPackPath

func LevelPackPath(filename string) string

LevelPackPath returns the user's levelpacks directory.

func LevelPath

func LevelPath(filename string) string

LevelPath will turn a "simple" filename into an absolute path in the user's local levels folder. If the filename already contains slashes, it is returned as-is as an absolute or relative path.

func ListCampaigns

func ListCampaigns() ([]string, error)

ListCampaigns returns a listing of all available campaigns.

func ListDoodads

func ListDoodads() ([]string, error)

ListDoodads returns a listing of all available doodads.

func ListLevels

func ListLevels() ([]string, error)

ListLevels returns a listing of all available levels.

func ResolvePath

func ResolvePath(filename, extension string, one bool) string

ResolvePath takes an ambiguous simple filename and searches for a Level or Doodad that matches. Returns a blank string if no files found.

Pass a true value for `one` if you are intending to create the file. It will only test one filepath and return the first one, regardless if the file existed. So the filename should have a ".level" or ".doodad" extension and then this path will resolve the ProfileDirectory of the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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