package tins2021 import ( "os" "opslag.de/schobers/geom" ) const settingsFileName = "settings.json" type Settings struct { Controls ControlsSettings Window WindowSettings } func (s *Settings) Init() error { err := LoadUserFileJSON(settingsFileName, s) if os.IsNotExist(err) { return nil } return err } func (s *Settings) Store() error { return SaveUserFileJSON(settingsFileName, s) } type ControlsSettings struct { Type string MoveDownRight string MoveDownLeft string MoveUpLeft string MoveUpRight string } type WindowSettings struct { Location *geom.Point Size *geom.Point VSync *bool }