Skip to content

Commit

Permalink
Merge branch 'json'
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeqMacaw committed Oct 27, 2019
2 parents c3338ba + 8dd5db6 commit bc1d95a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Crowbar/Core/SteamAppInfos/GarrysModSteamAppInfo.vb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Imports System.ComponentModel
Imports System.IO
Imports System.Web.Script.Serialization
Imports Steamworks

Public Class GarrysModSteamAppInfo
Expand Down Expand Up @@ -232,22 +233,23 @@ Public Class GarrysModSteamAppInfo
fileStream = File.CreateText(addonJsonPathFileName)
fileStream.AutoFlush = True
Try
Dim jss As JavaScriptSerializer = New JavaScriptSerializer()
If File.Exists(addonJsonPathFileName) Then
fileStream.WriteLine("{")
fileStream.WriteLine(vbTab + """title"": """ + itemTitle + """,")
fileStream.WriteLine(vbTab + """title"": " + jss.Serialize(itemTitle) + ",")
If itemTags.Count > 1 Then
fileStream.WriteLine(vbTab + """type"": """ + itemTags(0) + """,")
fileStream.WriteLine(vbTab + """type"": " + jss.Serialize(itemTags(0)) + ",")
fileStream.WriteLine(vbTab + """tags"": ")
fileStream.WriteLine(vbTab + "[")
If itemTags.Count > 2 Then
fileStream.WriteLine(vbTab + vbTab + """" + itemTags(1) + """,")
fileStream.WriteLine(vbTab + vbTab + """" + itemTags(2) + """")
fileStream.WriteLine(vbTab + vbTab + jss.Serialize(itemTags(1)) + ",")
fileStream.WriteLine(vbTab + vbTab + jss.Serialize(itemTags(2)))
Else
fileStream.WriteLine(vbTab + vbTab + """" + itemTags(1) + """")
fileStream.WriteLine(vbTab + vbTab + jss.Serialize(itemTags(1)))
End If
fileStream.WriteLine(vbTab + "]")
Else
fileStream.WriteLine(vbTab + """type"": """ + itemTags(0) + """")
fileStream.WriteLine(vbTab + """type"": " + jss.Serialize(itemTags(0)))
End If
fileStream.WriteLine("}")
fileStream.Flush()
Expand Down

0 comments on commit bc1d95a

Please sign in to comment.