Documentation ¶
Overview ¶
Package settings provides functionality for creating and managing the application's settings.
Index ¶
- Constants
- Variables
- func Create(parentDirPath string, filenameSuffix string, s SaveableSettings) error
- func CreateDir(dirPath string) error
- func CreateInternalFilesDir(settingsDirPath string) (string, error)
- func CreateLogFilesDir(settingsDirPath string) (string, error)
- func DirPath() string
- func InternalFilesDir(settingsDirPath string) string
- func LogFile(settingsDirPath string) (*os.File, error)
- type AppSettings
- type DynamicFilePath
- type GameSettings
- type KnownGamesSettings
- type Launcher
- type LaunchersSettings
- type SaveableSettings
Constants ¶
View Source
const ( FileExtension = ".grundy.ini" ExampleSuffix = "-example" )
Variables ¶
View Source
var (
GameImageSuffixes = append(gameIconSuffixes, gameGridImageSuffixes...)
)
Functions ¶
func CreateInternalFilesDir ¶
func CreateLogFilesDir ¶
func InternalFilesDir ¶
Types ¶
type AppSettings ¶
type AppSettings interface { SaveableSettings GameCollectionsPathsToLauncherNames() map[string]string AddGameCollection(dirPath string, launcherName string) RemoveGameCollection(dirPath string) HasGameCollection(dirPath string) (launcherName string, ok bool) }
func NewAppSettings ¶
func NewAppSettings() AppSettings
type DynamicFilePath ¶
type GameSettings ¶
type GameSettings interface { SaveableSettings SetName(string) Name() string SetExeSubPath(string) ExeFullPath(launcher Launcher) (filePath string, exists bool) ShouldOverrideLauncherArgs() bool SetLauncherOverrideArgs(string) LauncherOverrideArgs() string SetAdditionalLauncherArgs(string) AdditionalLauncherArgs() string SetIconPath(string) IconPath() DynamicFilePath SetGridImagePath(string) GridImagePath() DynamicFilePath AddCategory(string) RemoveCategory(string) SetCategories([]string) Categories() []string }
func LoadGameSettings ¶
func LoadGameSettings(filePath string, launcher Launcher) (GameSettings, error)
func NewGameSettings ¶
func NewGameSettings(dirPath string) GameSettings
type KnownGamesSettings ¶
type KnownGamesSettings interface { SaveableSettings GameDirPathsToGameNames() map[string]string AddUniqueGameOnly(game GameSettings, gameDirPath string) bool Disown(gameDirPath string) (gameName string, ok bool) DisownNonExistingGames() (gameDirPathsToGameNames map[string]string) }
func LoadOrCreateKnownGamesSettings ¶
func LoadOrCreateKnownGamesSettings(parentDirPath string) (KnownGamesSettings, bool)
type Launcher ¶
type Launcher interface { ResetToDefaults() Example() Launcher IsValid() error SetName(string) Name() string SetExePath(string) ExePath() string ExeDirPath() string SetDefaultArgs(string) DefaultArgs() string SetGameFileSuffixes([]string) GameFileSuffixes() []string }
func NewLauncher ¶
func NewLauncher() Launcher
type LaunchersSettings ¶
type LaunchersSettings interface { SaveableSettings Has(name string) (Launcher, bool) AddOrUpdate(Launcher) Remove(Launcher) }
func NewLaunchersSettings ¶
func NewLaunchersSettings() LaunchersSettings
type SaveableSettings ¶
Click to show internal directories.
Click to hide internal directories.