Skip to content

Commit

Permalink
Merge pull request OpenDiablo2#1097 from drpaneas/fix_config
Browse files Browse the repository at this point in the history
Fix config.json issues
  • Loading branch information
essial committed Mar 24, 2021
2 parents 421d425 + f8881ed commit 6c00b32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
1 change: 1 addition & 0 deletions d2app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func (a *App) LoadConfig() (*d2config.Configuration, error) {
configAsset, _ := a.asset.LoadAsset(configBaseName)

config := &d2config.Configuration{}
config.SetPath(d2config.DefaultConfigPath())

// create the default if not found
if configAsset == nil {
Expand Down
6 changes: 3 additions & 3 deletions d2app/initialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ func (a *App) initialize() error {
}

const (
fmtErrSourceNotFound = `file not found: %s
fmtErrSourceNotFound = `file not found: %q
Please check your config file at %s
Please check your config file at %q
Also, verify that the MPQ files exist at %s
Also, verify that the MPQ files exist at %q
Capitalization in the file name matters.
`
Expand Down
5 changes: 1 addition & 4 deletions d2core/d2config/default_directories.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import (
)

const (
od2ConfigDirName = "OpenDiablo2"
)

const (
od2ConfigDirName = "OpenDiablo2"
od2ConfigFileName = "config.json"
)

Expand Down
15 changes: 1 addition & 14 deletions d2core/d2config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func DefaultConfig() *Configuration {
MpqPath: "C:/Program Files (x86)/Diablo II",
Backend: "Ebiten",
MpqLoadOrder: []string{
"Patch_D2.mpq",
"patch_d2.mpq",
"d2exp.mpq",
"d2xmusic.mpq",
"d2xtalk.mpq",
Expand All @@ -45,19 +45,6 @@ func DefaultConfig() *Configuration {
}
case "darwin":
config.MpqPath = "/Applications/Diablo II/"
config.MpqLoadOrder = []string{
"Diablo II Patch",
"Diablo II Expansion Data",
"Diablo II Expansion Movies",
"Diablo II Expansion Music",
"Diablo II Expansion Speech",
"Diablo II Game Data",
"Diablo II Graphics",
"Diablo II Movies",
"Diablo II Music",
"Diablo II Sounds",
"Diablo II Speech",
}
case "linux":
if usr, err := user.Current(); err == nil {
config.MpqPath = path.Join(usr.HomeDir, ".wine/drive_c/Program Files (x86)/Diablo II")
Expand Down

0 comments on commit 6c00b32

Please sign in to comment.