diff --git a/Plugin.cs b/Plugin.cs index 7893732..f79c208 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -8,12 +8,14 @@ using Photon.Pun; using BepInEx.Logging; using UnityEngine.Localization.PropertyVariants; using System; +using CWOffline; namespace SpookTubeEX; [BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] [BepInIncompatibility("me.loaforc.Flashcard")] // No flashcard support [ContentWarningPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, true)] +[BepInDependency("CWOffline", BepInDependency.DependencyFlags.HardDependency)] public class Plugin : BaseUnityPlugin { Harmony harmony; @@ -52,9 +54,15 @@ class ReplayPatch [HarmonyPrefix] static bool Prefix(UploadCompleteUI __instance) { + if (CWOfflineAPI.IsGameOffline()) + { + Modal.ShowError("Upload Error", "Your device is offline."); + return false; + } + if (!PhotonNetwork.IsMasterClient) { - // Modal.ShowError("Upload Error", "Only the host can upload videos to SpookedTube."); + Modal.ShowError("Upload Error", "Only the host can upload videos to SpookTube."); return false; } diff --git a/SpookedTube.csproj b/SpookedTube.csproj index 8f118f2..8d25a67 100644 --- a/SpookedTube.csproj +++ b/SpookedTube.csproj @@ -1,7 +1,7 @@ - net472 + netstandard2.1 com.redbigz.SpookTubeEX SpookTubeEX Upload your videos to a website and watch others' videos! @@ -75,5 +75,9 @@ ./lib/Photon3Unity3D.dll + + + ./apis/CWOffline.dll + diff --git a/apis/CWOffline.dll b/apis/CWOffline.dll new file mode 100644 index 0000000..57eaea5 Binary files /dev/null and b/apis/CWOffline.dll differ diff --git a/build.sh b/build.sh index cc05b72..2751cd7 100644 --- a/build.sh +++ b/build.sh @@ -3,5 +3,5 @@ cp buildResources/* .build cp README.md .build sed -i -e "s/img\//https\:\/\/git.redbigz.com\/SpookTube\/SpookTubeEX\/media\/branch\/main\/img\//g" .build/README.md dotnet build -c release -cp -r bin/Release/net472/com.redbigz.SpookTubeEX.dll .build/BepInEx/plugins +cp -r bin/Release/netstandard2.1/com.redbigz.SpookTubeEX.dll .build/BepInEx/plugins jar -cf SpookTubeEX.zip -C .build/ . \ No newline at end of file