Changeset 467 for TFP-WebServer/WebServer/src/WebAPI/APIs/GameData/Mods.cs
- Timestamp:
- Aug 18, 2023, 12:08:10 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TFP-WebServer/WebServer/src/WebAPI/APIs/GameData/Mods.cs
r434 r467 19 19 } 20 20 21 writer.WriteBeginObject ();22 23 21 writeModJson (ref writer, webMod); 24 25 if (webMod.ReactBundle != null || webMod.CssPath != null) {26 writer.WriteValueSeparator ();27 28 writer.WritePropertyName ("web");29 writer.WriteBeginObject ();30 31 string webModReactBundle = webMod.ReactBundle;32 if (webModReactBundle != null) {33 writer.WritePropertyName ("bundle");34 writer.WriteString (webModReactBundle);35 }36 37 string webModCssFile = webMod.CssPath;38 if (webModCssFile != null) {39 if (webModReactBundle != null) {40 writer.WriteValueSeparator ();41 }42 43 writer.WritePropertyName ("css");44 writer.WriteString (webModCssFile);45 }46 47 writer.WriteEndObject ();48 }49 50 writer.WriteEndObject ();51 22 } 52 23 … … 56 27 } 57 28 58 private void writeModJson (ref JsonWriter _writer, WebMod _webMod) { 29 private static void writeModJson (ref JsonWriter _writer, WebMod _webMod) { 30 _writer.WriteBeginObject (); 31 59 32 _writer.WritePropertyName ("name"); 60 33 _writer.WriteString (_webMod.ParentMod.Name); … … 79 52 _writer.WritePropertyName ("website"); 80 53 _writer.WriteString (_webMod.ParentMod.Website); 54 55 writeWebModJson (ref _writer, _webMod); 56 57 _writer.WriteEndObject (); 58 } 59 60 private static void writeWebModJson (ref JsonWriter _writer, WebMod _webMod) { 61 if (_webMod.ModUrl != null) { 62 _writer.WriteValueSeparator (); 63 64 _writer.WritePropertyName ("web"); 65 _writer.WriteBeginObject (); 66 67 _writer.WritePropertyName ("baseUrl"); 68 _writer.WriteString (_webMod.ModUrl); 69 70 string webModReactBundle = _webMod.ReactBundle; 71 if (webModReactBundle != null) { 72 _writer.WriteValueSeparator (); 73 _writer.WritePropertyName ("bundle"); 74 _writer.WriteString (webModReactBundle); 75 } 76 77 string webModCssFile = _webMod.CssPath; 78 if (webModCssFile != null) { 79 _writer.WriteValueSeparator (); 80 _writer.WritePropertyName ("css"); 81 _writer.WriteString (webModCssFile); 82 } 83 84 _writer.WriteEndObject (); 85 } 81 86 } 82 87
Note:
See TracChangeset
for help on using the changeset viewer.