Skip to content

Commit

Permalink
Fix trying to grab EditorConstruct while in the Editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
severedsolo committed Jun 19, 2019
1 parent 3180df3 commit 71710e5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
24 changes: 10 additions & 14 deletions OhScrap/OhScrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,30 +35,26 @@
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="ScrapYard, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\GameData\ScrapYard\ScrapYard.dll</HintPath>
<Reference Include="ScrapYard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program (1.7.2 Modded)\GameData\ScrapYard\ScrapYard.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="ScrapYard">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\GameData\ScrapYard\ScrapYard.dll</HintPath>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions OhScrap/UPFMUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,11 @@ void GUIDisplay(int windowID)
}
if(vesselSafetyRating == -1 || editorConstruct == null || editorConstruct.parts.Count() == 0)
{
GUILayout.Label("No parts detected. Place or right click on a part");
return;
if (HighLogic.LoadedSceneIsEditor || vesselSafetyRating == -1)
{
GUILayout.Label("No parts detected. Place or right click on a part");
return;
}
}
GUILayout.Label("Vessel Safety Rating: " + vesselSafetyRating + " " + s);
advancedDisplay = File.Exists(KSPUtil.ApplicationRootPath + "GameData/Severedsolo/OhScrap/debug.txt");
Expand Down
34 changes: 17 additions & 17 deletions OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Release/OhScrap.pdb
/home/martin/OneDrive/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CoreCompileInputs.cache
/home/martin/OneDrive/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.dll
/home/martin/OneDrive/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.pdb
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\OhScrap.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\OhScrap.pdb
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\Assembly-CSharp-firstpass.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\Assembly-CSharp.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\ScrapYard.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\UnityEngine.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\UnityEngine.UI.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\KSPTrackIR.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\KSPAssets.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\Mono.Cecil.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\Ionic.Zip.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\bin\Release\TDx.TDxInput.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\obj\Release\OhScrap.csproj.CoreCompileInputs.cache
C:\Users\evilp\source\repos\OhScrap\OhScrap\obj\Release\OhScrap.csproj.CopyComplete
C:\Users\evilp\source\repos\OhScrap\OhScrap\obj\Release\OhScrap.dll
C:\Users\evilp\source\repos\OhScrap\OhScrap\obj\Release\OhScrap.pdb
C:\Users\evilp\source\repos\OhScrap\OhScrap\obj\Release\OhScrap.csprojAssemblyReference.cache
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/OhScrap.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/OhScrap.pdb
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/Assembly-CSharp-firstpass.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/Assembly-CSharp.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/ScrapYard.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/UnityEngine.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/UnityEngine.UI.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/KSPTrackIR.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/KSPAssets.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/Mono.Cecil.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/Ionic.Zip.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/bin/Release/TDx.TDxInput.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CoreCompileInputs.cache
C:/Users/evilp/source/repos/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CopyComplete
C:/Users/evilp/source/repos/OhScrap/OhScrap/obj/Release/OhScrap.dll
C:/Users/evilp/source/repos/OhScrap/OhScrap/obj/Release/OhScrap.pdb
C:/Users/evilp/source/repos/OhScrap/OhScrap/obj/Release/OhScrap.csprojAssemblyReference.cache

0 comments on commit 71710e5

Please sign in to comment.