Changeset 467 for TFP-WebServer/WebServer/src/WebAPI/APIs/GameData
- Timestamp:
- Aug 18, 2023, 12:08:10 PM (15 months ago)
- Location:
- TFP-WebServer/WebServer/src/WebAPI/APIs/GameData
- Files:
-
- 2 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 -
TFP-WebServer/WebServer/src/WebAPI/APIs/GameData/Mods.openapi.yaml
r460 r467 37 37 type: object 38 38 properties: 39 baseUrl: 40 type: string 41 examples: 42 - /webmods/TFP_MarkersExample/ 43 description: Base URL of the WebMod folder of this mod. Always ends with a forward slash '/'. 39 44 bundle: 40 45 type: string 41 46 examples: 42 - /webmods/Xample_MarkersMod/bundle.js 47 - /webmods/TFP_MarkersExample/bundle.js 48 description: URL of the React bundle if the mod has one. 43 49 css: 44 50 type: string 45 51 examples: 46 - /webmods/Xample_MarkersMod/styling.css 52 - /webmods/TFP_MarkersExample/styling.css 53 description: URL of a styling CSS file if the mod has one. 54 required: 55 - baseUrl 47 56 required: 48 57 - name
Note:
See TracChangeset
for help on using the changeset viewer.