Skip to content

Commit fc77c6c

Browse files
Born Of Bread Update
Added a recursive search for AltLauncher.ini to fix compatibility with Born Of Bread
1 parent b29f642 commit fc77c6c

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

AltLauncher.au3

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
#AutoIt3Wrapper_Icon=Resources\AltLauncher.ico
33
#AutoIt3Wrapper_Outfile=Build\AltLauncher.exe
44
#AutoIt3Wrapper_UseX64=n
5-
#AutoIt3Wrapper_Res_Fileversion=0.1.0.1
5+
#AutoIt3Wrapper_Res_Fileversion=0.1.0.2
66
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
77
#AutoIt3Wrapper_Res_Language=1033
88
#AutoIt3Wrapper_Run_Before=cmd /c echo %fileversion% > "%scriptdir%\VERSION"
99
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
1010
#include <Constants.au3>
11+
#include <File.au3>
1112
#include <Misc.au3>
1213
Opt("TrayIconHide", True)
1314
Global $Title = "AltLauncher"
@@ -29,8 +30,8 @@ WaitWhileGameRunning()
2930
doExit()
3031

3132
Func RegisterVariables()
32-
Global $backup="backup",$restore="restore"
33-
EndFunc
33+
Global $backup = "backup", $restore = "restore"
34+
EndFunc ;==>RegisterVariables
3435
Func ReadINISection(ByRef $Ini, $Section)
3536
Local $Data = IniReadSection($Ini, $Section)
3637
If @error Then
@@ -41,8 +42,14 @@ Func ReadINISection(ByRef $Ini, $Section)
4142
EndFunc ;==>ReadINISection
4243
Func ReadConfig()
4344
Global $Ini = @ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini"
44-
If Not FileExists($Ini) Then ExitMSG("AltLauncher.ini not found.")
45+
If Not FileExists($Ini) Then
46+
$SearchResults = _FileListToArrayRec(@ScriptDir, StringTrimRight(@ScriptName, 4) & ".ini", $FLTAR_FILES, $FLTAR_RECUR)
47+
_ArrayDisplay($SearchResults, @error)
48+
If $SearchResults[0] = 1 Then $Ini = @ScriptDir & "\" & $SearchResults[0]
49+
If $SearchResults[0] <> 1 Then ExitMSG("AltLauncher.ini not found.")
50+
EndIf
4551
Global $Name = IniRead($Ini, "General", "Name", Null)
52+
Global $Path = IniRead($Ini, "General", "Path", Null)
4653
Global $Executable = IniRead($Ini, "General", "Executable", Null)
4754
Global $LaunchFlags = IniRead($Ini, "General", "LaunchFlags", Null)
4855
Global $MinWait = IniRead($Ini, "Settings", "MinWait", 0)
@@ -87,12 +94,12 @@ EndFunc ;==>ShowProgressBar
8794
Func RunLauncherIfNeeded()
8895
If FileExists(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & "-launcher.cmd") Then
8996
ProgressSet(100, "Starting Launcher...", "")
90-
ShellExecuteWait(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & "-launcher.cmd", "", @ScriptDir, $SHEX_OPEN, @SW_HIDE)
97+
ShellExecuteWait(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & "-launcher.cmd", "", ($Path = Null) ? @ScriptDir : $Path, $SHEX_OPEN, @SW_HIDE)
9198
EndIf
9299
EndFunc ;==>RunLauncherIfNeeded
93100
Func RunGame()
94101
ProgressSet(100, "Launching Game...", "")
95-
ShellExecute($Executable, $LaunchFlags, @ScriptDir)
102+
ShellExecute($Executable, $LaunchFlags, ($Path = Null) ? @ScriptDir : $Path)
96103
EndFunc ;==>RunGame
97104
Func WaitWhileGameRunning()
98105
ProgressSet(100, "Waiting for game to close...")
@@ -223,4 +230,4 @@ Func doExit($immediately = False)
223230
EndFunc ;==>doExit
224231
Func ExitMSG($msg)
225232
Exit MsgBox($MB_OK + $MB_ICONERROR + $MB_SYSTEMMODAL, "AltLauncher", $msg)
226-
EndFunc ;==>ExitMSG
233+
EndFunc ;==>ExitMSG
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[General]
2+
Name=Born Of Bread
3+
Path=C:\Program Files (x86)\Steam\steamapps\common\BornOfBread\BornOfBread\BornOfBread\Binaries\Win64
4+
Executable=BornOfBread-Win64-Shipping.exe
5+
LaunchFlags=
6+
7+
8+
[Registry]
9+
10+
11+
[Directories]
12+
=%LOCALAPPDATA%\BornOfBread\Saved
13+
14+
[Files]

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0.0
1+
0.1.0.2

0 commit comments

Comments
 (0)