Skip to content

Commit 4f4f0c3

Browse files
committed
restructure optional mods and scatterer install check
1 parent 964c13f commit 4f4f0c3

File tree

17 files changed

+50
-12
lines changed

17 files changed

+50
-12
lines changed

KerbalVR_Mod/KerbalVR-InstallCheck/InstallCheck.cs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class InstallCheck : MonoBehaviour
2626
{
2727
new Dependency { assemblyName = "EVEManager", minVersion = new Version(1, 11, 7, 1)},
2828
new Dependency { assemblyName = "TUFX", minVersion = new Version(1, 0, 5)},
29-
new Dependency { assemblyName = "Scatterer", minVersion = new Version(0, 880, 1)},
3029
new Dependency { assemblyName = "AvionicsSystems", minVersion = new Version(1, 3, 6)},
3130
new Dependency { assemblyName = "RasterPropMonitor", minVersion = new Version(0, 31, 10, 2)},
3231
};
@@ -47,6 +46,7 @@ public void Awake()
4746
CheckVREnabled();
4847
CheckDependencies();
4948
CheckOptionalMods();
49+
CheckScatterer();
5050
CheckRequiredFiles();
5151
}
5252

@@ -122,6 +122,49 @@ private static void CheckOptionalMods()
122122
}
123123
}
124124

125+
// If a given mod exists, checks it against a list of known good versions.
126+
// If it's not there, looks up a specific error message for the given version, or else a generic "unsupported" one
127+
private static void CheckComplexMappings(string assemblyName, Version[] goodVersions, Dictionary<Version, string> errorMessages)
128+
{
129+
var assembly = AssemblyLoader.loadedAssemblies.FirstOrDefault(a => a.name == assemblyName);
130+
if (assembly == null) return;
131+
132+
var assemblyVersion = assembly.assembly.GetName().Version;
133+
134+
// note: not using contains because this is a class and apparently it doesn't compare equal
135+
if (goodVersions.IndexOf(assemblyVersion) != -1)
136+
{
137+
return;
138+
}
139+
140+
if (errorMessages.TryGetValue(assemblyVersion, out var message))
141+
{
142+
Alert(message);
143+
}
144+
else
145+
{
146+
Alert($"Unsupported {assemblyName} version {assemblyVersion}");
147+
}
148+
}
149+
150+
private static void CheckScatterer()
151+
{
152+
CheckComplexMappings("Scatterer",
153+
new Version[]
154+
{
155+
new Version(0, 851, 0, 0), // volclouds v1
156+
new Version(0, 856, 0, 0), // volclouds v2
157+
new Version(0, 859, 0, 0), // volclouds v3
158+
new Version(0, 878, 1, 0), // VR patch on latest publicly available
159+
new Version(0, 880, 1, 0), // VR patch on volumetrics V4
160+
},
161+
new Dictionary<Version, string>()
162+
{
163+
{new Version(0, 878, 0, 0), "Install Scatterer from the Optional Mods folder"},
164+
{new Version(0, 880, 0, 0), "Install the files from Optional Mods/VolumetricClouds-v4"},
165+
});
166+
}
167+
125168
private static void CheckRequiredFiles()
126169
{
127170
string errorMessage = string.Empty;

KerbalVR_Mod/Optional Mods/README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ Install as normal, then copy the Scatterer directory from KerbalVR/Optional Mods
44

55
# Volumetric Clouds
66

7-
If you have blackrack's volumetric clouds, install it as normal and then follow the instructions below according to which version you have.
7+
If you have blackrack's volumetric clouds, install it as normal. Then install the contents of one of the KerbalVR/OptionalMods/VolumetricClouds folders into GameData, overwriting any existing files. Note that VolumetricClouds-v2 is empty; it does not need any special treatment.
88

9-
## Volumetric Clouds V4 (released December 22 2023)
9+
For reference, release dates of each version are below:
1010

11-
Copy the EnvironmentalVisualEnhancements and Scatterer folders from the KerbalVR/Optional Mods folder into your GameData directory and overwrite the existing files.
12-
13-
## Volumetric Clouds V3 (released August 26 2023)
14-
15-
Download https://github.com/JonnyOThan/Kerbal-VR/files/12777949/RaymarchedClouds-VR-8.26.23.zip and copy it over your existing EVE install, overwriting the existing files.
16-
17-
## Volumetric Clouds V2 (released May 21 2023)
18-
19-
No additional steps
11+
* v1 - January 14, 2023
12+
* v2 - May 21 through June 7, 2023
13+
* v3 - August 20 through 26, 2023
14+
* v4 - December 22, 2023 through July 16, 2024
2015

2116
# Optional VR patches
2217

-8.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)