Documentation ¶
Index ¶
- Constants
- Variables
- func DOWNLOAD_PATH() string
- func EnableBasePath() error
- func GePathIwads(path string) ([]string, error)
- func GetConfigFolder() string
- func GetDemoFolder() string
- func GetFileContentStringFromPK3(pk3path, filename string) (contentString string, err error)
- func GetFileFromPK3(pk3Path string, filename string) (io.ReadCloser, error)
- func GetFileLinesFromPK3(pk3path, filename string) (lines []string, err error)
- func GetGameConfigFolder() string
- func GetSavegameFolder() string
- func GetSharedGameConfigFolder() string
- func GetSharedGameConfigs(port string) []string
- func ImportArchive(zipPath, modName string) (err error)
- func ModOk(mod string) bool
- func PathHasIwads(path string) (bool, error)
- func Persist() error
- func PortSharedConfigPath(port string) string
- func SourcePorts() []string
- func WadDirIsSane() bool
- type Cfg
Constants ¶
const ( CFG_VERSION = 2 MAX_SOURCE_PORTS = 6 )
Variables ¶
var ( // KnownIwads contains names of the most common iwads KnownIwads = map[string]bool{ "doom.wad": true, "doom2.wad": true, "tnt.wad": true, "plutonia.wad": true, "heretic.wad": true, "hexen.wad": true, "strive1.wad": true, "sve.wad": true, "chex.wad": true, "strife0.wad": true, "freedoom1.wad": true, "freedoom2.wad": true, "freedm.wad": true, "chex3.wad": true, "action2.wad": true, "harm1.wad": true, "hacx.wad": true, "boa.ipk3": true, } )
Functions ¶
func DOWNLOAD_PATH ¶ added in v0.20.0
func DOWNLOAD_PATH() string
func EnableBasePath ¶
func EnableBasePath() error
EnableBasePath adds the mod base path to the config ini files and/or sets it as DOOMWADDIR that enables the engine, to find mod files added with the -file parameter based on relative paths
func GePathIwads ¶
func GetConfigFolder ¶
func GetConfigFolder() string
GetConfigFolder returns the folder where configuration is stored
func GetDemoFolder ¶
func GetDemoFolder() string
GetDemoFolder returns the folder where demos are stored
func GetFileContentStringFromPK3 ¶
GetFileContentStringFromPK3 is a wrapper for GetFileFromPK3 It returns the files contents as string
func GetFileFromPK3 ¶
func GetFileFromPK3(pk3Path string, filename string) (io.ReadCloser, error)
GetFileFromPK3 returns one specific file from given wad or pk3 file Don't forget to close the ReadCloser when done reading Can return nil if it didn't work out
func GetFileLinesFromPK3 ¶
GetFileLinesFromPK3 is a wrapper for GetFileFromPK3 It uses a bufio.Scanner to scan the file line by line and return them as slice
func GetGameConfigFolder ¶
func GetGameConfigFolder() string
GetGameConfigFolder returns the folder where savegames are stored
func GetSavegameFolder ¶
func GetSavegameFolder() string
GetSavegameFolder returns the folder where savegames are stored
func GetSharedGameConfigFolder ¶
func GetSharedGameConfigFolder() string
GetSharedGameConfigFolder returns the folder where savegames are stored
func GetSharedGameConfigs ¶
GetSharedGameConfigs returns a list with configs for given port name in the according shared subfolder
func ImportArchive ¶
ImportArchive imports given archive into a subfolder of the base path
func ModOk ¶ added in v0.19.0
ModOk checks, if the given mod (relative file path) exists within the configured DOOMWADDIR TODO: Maybe even check with MD5
func PortSharedConfigPath ¶
PortSharedConfigPath returns the path where common/shared configs for the given port should be stored
func SourcePorts ¶
func SourcePorts() []string
func WadDirIsSane ¶
func WadDirIsSane() bool
WadDirIsSane checks if the configured DOOMWADDIR is something useful The root directory "/" for example is a bad idea, especially considering zip import functionality
Types ¶
type Cfg ¶
type Cfg struct { WadDir string `json:"wad_dir"` WriteWadDirToEngineCfg bool `json:"write_wad_dir_to_engine_cfg"` DontSetDoomwaddir bool `json:"dont_set_doomwaddir"` ModExtensions string `json:"mod_extensions"` Ports []string `json:"source_ports"` IWADs []string `json:"iwa_ds"` Configured bool `json:"configured"` DeleteWithoutWarning bool `json:"delete_without_warning"` HideHeader bool `json:"hide_header"` GameListAbsoluteWidth int `json:"game_list_absolute_width"` GameListRelativeWidth int `json:"game_list_relative_width"` CfgVersion int `json:"cfg_version"` }
Cfg holds basic configuration settings Should only be instantiated via GetInstance