|
1 | 1 | class Builder { |
2 | 2 | app := "" |
3 | | - key := "" |
4 | | - config := Map() |
5 | 3 |
|
6 | | - __New(app, key, config) { |
| 4 | + __New(app) { |
7 | 5 | this.app := app |
8 | | - this.key := key |
9 | | - this.config := config |
10 | 6 | } |
11 | 7 |
|
12 | | - Build() { |
| 8 | + Build(key, config) { |
13 | 9 | launcherDir := this.app.AppConfig.LauncherDir |
14 | 10 | assetsDir := this.app.AppConfig.AssetsDir |
15 | 11 |
|
16 | 12 | if (launcherDir == "" or assetsDir == "") { |
17 | | - this.app.Toast(this.key . ": Required directories not set. Skipping build.", "Launchpad", 10, 2) |
| 13 | + this.app.Notifications.Warning(key . ": Required directories not set. Skipping build.") |
18 | 14 | return false |
19 | 15 | } |
20 | 16 |
|
21 | 17 | if (this.app.AppConfig.IndividualDirs) { |
22 | | - launcherDir .= "\" . this.key |
| 18 | + launcherDir .= "\" . key |
23 | 19 | } |
24 | | - assetsDir .= "\" . this.key |
| 20 | + assetsDir .= "\" . key |
25 | 21 |
|
26 | 22 | DirCreate(launcherDir) |
27 | 23 | DirCreate(assetsDir) |
28 | 24 |
|
29 | | - iconObj := IconFile.new(this.app, this.config, assetsDir, this.key) |
| 25 | + iconObj := IconFile.new(this.app, config, assetsDir, key) |
30 | 26 | iconResult := iconObj.Build() |
31 | 27 |
|
32 | | - shortcutResult := !this.config["requiresShortcutFile"] ; Default to true if shortcut isn't required |
33 | | - if (this.config["requiresShortcutFile"]) { |
34 | | - shortcutObj := ShortcutFile.new(this.app, this.config, assetsDir, this.key) |
| 28 | + shortcutResult := !config["requiresShortcutFile"] ; Default to true if shortcut isn't required |
| 29 | + if (config["requiresShortcutFile"]) { |
| 30 | + shortcutObj := ShortcutFile.new(this.app, config, assetsDir, key) |
35 | 31 | shortcutResult := shortcutObj.Build() |
36 | 32 | } |
37 | 33 |
|
38 | 34 | ahkResult := false |
39 | 35 | exeResult := false |
40 | 36 |
|
41 | 37 | if (iconResult and shortcutResult) { |
42 | | - gameAhkObj := GameAhkFile.new(this.app, this.config, assetsDir, this.key) |
| 38 | + gameAhkObj := GameAhkFile.new(this.app, config, assetsDir, key) |
43 | 39 | ahkResult := gameAhkObj.Build() |
44 | 40 |
|
45 | 41 | if (ahkResult) { |
46 | | - gameExeObj := GameExeFile.new(this.app, this.config, launcherDir, this.key) |
| 42 | + gameExeObj := GameExeFile.new(this.app, config, launcherDir, key) |
47 | 43 | exeResult := gameExeObj.Build() |
48 | 44 | } |
49 | 45 |
|
|
0 commit comments