Skip to content

Commit

Permalink
Update to 1.1.12 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Kron4ek authored Jul 16, 2020
1 parent 3b41a5c commit 15fd498
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 70 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.1.12
* Fixed relaunching the game when the launcher remains open (yes, again)
---------------------------------------------------------------------
v1.1.11
* Fixed relaunching the game when the launcher remains open ("Keep the launcher open" option)
* The launcher now unsets _JAVA_OPTIONS environment variable
Expand Down
71 changes: 36 additions & 35 deletions vlauncher_linux.pb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Define.i useCustomJavaDefault = 0
Define.i useCustomParamsDefault = 0
Define.i keepLauncherOpenDefault = 0

Define.s launcherVersion = "1.1.11"
Define.s launcherVersion = "1.1.12"
Define.s launcherDeveloper = "Kron(4ek)"

Declare assetsToResources(assetsIndex.s)
Expand Down Expand Up @@ -89,14 +89,14 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
downloadButton = ButtonGadget(#PB_Any, gadgetsIndent, 160, gadgetsWidth, gadgetsHeight, "Downloader")
settingsButton = ButtonGadget(#PB_Any, gadgetsIndent, 200, gadgetsWidth, gadgetsHeight, "Settings")

If LoadFont(0, "Ariral", 10, #PB_Font_Bold)
If LoadFont(0, "Arial", 10, #PB_Font_Bold)
SetGadgetFont(playButton, FontID(0))
SetGadgetFont(downloadButton, FontID(0))
EndIf

launcherAuthorGadget = TextGadget(#PB_Any, 2, windowHeight - 10, 70, 20, "by " + launcherDeveloper)
launcherVersionGadget = TextGadget(#PB_Any, windowWidth - 37, windowHeight - 10, 50, 20, "v" + launcherVersion)
If LoadFont(1, "Ariral", 7)
If LoadFont(1, "Arial", 7)
font = FontID(1) : SetGadgetFont(launcherAuthorGadget, font) : SetGadgetFont(launcherVersionGadget, font)
EndIf

Expand All @@ -114,6 +114,8 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
javaBinaryPath = "java"
downloadMissingLibraries = ReadPreferenceInteger("DownloadMissingLibs", downloadMissingLibrariesDefault)
versionSecondDigit = Val(StringField(clientVersion, 2, "."))
librariesString = ""
clientArguments = ""

If versionSecondDigit < 13
customLaunchArguments = customOldLaunchArgumentsDefault
Expand Down Expand Up @@ -174,6 +176,23 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine

nativesPath = "versions/" + StringField(clientJarFile, 2, "/") + "/natives"

jsonArgumentsMember = GetJSONMember(jsonObject, "minecraftArguments")
jsonArgumentsModernMember = GetJSONMember(jsonObject, "arguments")

If jsonArgumentsMember
clientArguments = GetJSONString(jsonArgumentsMember)
ElseIf jsonArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonArgumentsModernMember, "game")

For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

If jsonInheritsFromMember
inheritsClientJar = GetJSONString(jsonInheritsFromMember)

Expand All @@ -183,9 +202,22 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
inheritsJsonObject = JSONValue(inheritsJson)
jsonInheritsArgumentsModernMember = GetJSONMember(inheritsJsonObject, "arguments")

librariesString = ""
If jsonInheritsArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonInheritsArgumentsModernMember, "game")

For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

librariesString + parseLibraries(inheritsClientJar, downloadMissingLibraries)
assetsIndex = GetJSONString(GetJSONMember(JSONValue(inheritsJson), "assets"))

FreeJSON(inheritsJson)
Else
MessageRequester("Error", inheritsClientJar + ".json file is missing!") : Break
EndIf
Expand All @@ -203,36 +235,6 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
librariesString = parseLibraries(clientVersion, downloadMissingLibraries) + librariesString
clientMainClass = GetJSONString(GetJSONMember(jsonObject, "mainClass"))

jsonArgumentsMember = GetJSONMember(jsonObject, "minecraftArguments")
jsonArgumentsModernMember = GetJSONMember(jsonObject, "arguments")

If jsonArgumentsMember
clientArguments = GetJSONString(jsonArgumentsMember)
ElseIf jsonArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonArgumentsModernMember, "game")

clientArguments = ""
For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

If jsonInheritsArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonInheritsArgumentsModernMember, "game")

For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

UseMD5Fingerprint()

uuid = StringFingerprint("OfflinePlayer:" + playerName, #PB_Cipher_MD5)
Expand Down Expand Up @@ -279,7 +281,6 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
MessageRequester("Error", "Client jar file is missing!")
EndIf

FreeJSON(inheritsJson)
FreeJSON(jsonFile)
Else
MessageRequester("Error", "Client json file is missing!")
Expand Down
71 changes: 36 additions & 35 deletions vlauncher_windows.pb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Define.i keepLauncherOpenDefault = 0
Global.i useCustomJavaDefault = 0
Global.s javaBinaryPathDefault = "C:\jre8\bin\javaw.exe"

Define.s launcherVersion = "1.1.11"
Define.s launcherVersion = "1.1.12"
Define.s launcherDeveloper = "Kron(4ek)"

Declare assetsToResources(assetsIndex.s)
Expand Down Expand Up @@ -97,14 +97,14 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
downloadButton = ButtonGadget(#PB_Any, gadgetsIndent, 165, gadgetsWidth, gadgetsHeight + 5, "Downloader")
settingsButton = ButtonGadget(#PB_Any, gadgetsIndent, 200, gadgetsWidth, gadgetsHeight + 5, "Settings")

If LoadFont(0, "Ariral", 10, #PB_Font_Bold)
If LoadFont(0, "Arial", 10, #PB_Font_Bold)
SetGadgetFont(playButton, FontID(0))
SetGadgetFont(downloadButton, FontID(0))
EndIf

launcherAuthorGadget = TextGadget(#PB_Any, 2, windowHeight - 10, 70, 20, "by " + launcherDeveloper)
launcherVersionGadget = TextGadget(#PB_Any, windowWidth - 34, windowHeight - 10, 50, 20, "v" + launcherVersion)
If LoadFont(1, "Ariral", 7)
If LoadFont(1, "Arial", 7)
font = FontID(1) : SetGadgetFont(launcherAuthorGadget, font) : SetGadgetFont(launcherVersionGadget, font)
EndIf

Expand All @@ -123,6 +123,8 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
javaBinaryPath = GetGadgetText(javaListGadget)
downloadMissingLibraries = ReadPreferenceInteger("DownloadMissingLibs", downloadMissingLibrariesDefault)
versionSecondDigit = Val(StringField(clientVersion, 2, "."))
librariesString = ""
clientArguments = ""

If versionSecondDigit < 13
customLaunchArguments = customOldLaunchArgumentsDefault
Expand Down Expand Up @@ -187,6 +189,23 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine

nativesPath = "versions\" + StringField(clientJarFile, 2, "\") + "\natives"

jsonArgumentsMember = GetJSONMember(jsonObject, "minecraftArguments")
jsonArgumentsModernMember = GetJSONMember(jsonObject, "arguments")

If jsonArgumentsMember
clientArguments = GetJSONString(jsonArgumentsMember)
ElseIf jsonArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonArgumentsModernMember, "game")

For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

If jsonInheritsFromMember
inheritsClientJar = GetJSONString(jsonInheritsFromMember)

Expand All @@ -196,9 +215,22 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
inheritsJsonObject = JSONValue(inheritsJson)
jsonInheritsArgumentsModernMember = GetJSONMember(inheritsJsonObject, "arguments")

librariesString = ""
If jsonInheritsArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonInheritsArgumentsModernMember, "game")

For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

librariesString + parseLibraries(inheritsClientJar, downloadMissingLibraries)
assetsIndex = GetJSONString(GetJSONMember(JSONValue(inheritsJson), "assets"))

FreeJSON(inheritsJson)
Else
MessageRequester("Error", inheritsClientJar + ".json file is missing!") : Break
EndIf
Expand All @@ -216,36 +248,6 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
librariesString = parseLibraries(clientVersion, downloadMissingLibraries) + librariesString
clientMainClass = GetJSONString(GetJSONMember(jsonObject, "mainClass"))

jsonArgumentsMember = GetJSONMember(jsonObject, "minecraftArguments")
jsonArgumentsModernMember = GetJSONMember(jsonObject, "arguments")

If jsonArgumentsMember
clientArguments = GetJSONString(jsonArgumentsMember)
ElseIf jsonArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonArgumentsModernMember, "game")

clientArguments = ""
For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

If jsonInheritsArgumentsModernMember
jsonArgumentsArray = GetJSONMember(jsonInheritsArgumentsModernMember, "game")

For i = 0 To JSONArraySize(jsonArgumentsArray) - 1
jsonArrayElement = GetJSONElement(jsonArgumentsArray, i)

If JSONType(jsonArrayElement) = #PB_JSON_String
clientArguments + " " + GetJSONString(jsonArrayElement) + " "
EndIf
Next
EndIf

UseMD5Fingerprint()

uuid = StringFingerprint("OfflinePlayer:" + playerName, #PB_Cipher_MD5)
Expand Down Expand Up @@ -292,7 +294,6 @@ If OpenWindow(0, #PB_Ignore, #PB_Ignore, windowWidth, windowHeight, "Vortex Mine
MessageRequester("Error", "Client jar file is missing!")
EndIf

FreeJSON(inheritsJson)
FreeJSON(jsonFile)
Else
MessageRequester("Error", "Client json file is missing!")
Expand Down

0 comments on commit 15fd498

Please sign in to comment.