Skip to content

Commit

Permalink
Merge pull request #230 from SpaceWarpDev/v1.2.1
Browse files Browse the repository at this point in the history
V1.2.1 -> Main
  • Loading branch information
cheese3660 authored Jun 4, 2023
2 parents 7e3224e + ea3fe70 commit aa04c41
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 205 deletions.
141 changes: 0 additions & 141 deletions ExampleMod/ExampleMod.cs

This file was deleted.

13 changes: 0 additions & 13 deletions ExampleMod/ExampleMod.csproj

This file was deleted.

14 changes: 0 additions & 14 deletions ExampleMod/swinfo.json

This file was deleted.

6 changes: 0 additions & 6 deletions SpaceWarp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceWarp", "SpaceWarp\SpaceWarp.csproj", "{42FA2F7B-A595-44E8-8CD5-A9C30B80A667}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleMod", "ExampleMod\ExampleMod.csproj", "{56255DE9-749D-447D-B1D8-1B634535A087}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpaceWarpPatcher", "SpaceWarpPatcher\SpaceWarpPatcher.csproj", "{2EF642D0-F66D-461C-A5B0-953E39307B76}"
EndProject
Global
Expand All @@ -19,10 +17,6 @@ Global
{42FA2F7B-A595-44E8-8CD5-A9C30B80A667}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42FA2F7B-A595-44E8-8CD5-A9C30B80A667}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42FA2F7B-A595-44E8-8CD5-A9C30B80A667}.Release|Any CPU.Build.0 = Release|Any CPU
{56255DE9-749D-447D-B1D8-1B634535A087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56255DE9-749D-447D-B1D8-1B634535A087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56255DE9-749D-447D-B1D8-1B634535A087}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56255DE9-749D-447D-B1D8-1B634535A087}.Release|Any CPU.Build.0 = Release|Any CPU
{2EF642D0-F66D-461C-A5B0-953E39307B76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EF642D0-F66D-461C-A5B0-953E39307B76}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EF642D0-F66D-461C-A5B0-953E39307B76}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
7 changes: 1 addition & 6 deletions SpaceWarp/Patching/ColorsPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,10 @@ internal static void Prefix()
nameof(Module_Color.OnInitialize))]
internal static void Postfix(Module_Color __instance)
{
if (DeclaredParts.Count == 0)
{
return;
}

var partName = __instance.OABPart is not null ? __instance.OABPart.PartName : __instance.part.Name;
var trimmedPartName = TrimPartName(partName);

if (_allParts.Contains(trimmedPartName))
if (DeclaredParts.Count > 0 && _allParts.Contains(trimmedPartName))
{
var mat = new Material(_ksp2Opaque);
mat.name = __instance.GetComponentInChildren<MeshRenderer>().material.name;
Expand Down
10 changes: 5 additions & 5 deletions SpaceWarp/SpaceWarp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<Version>$(SpaceWarpVersion)</Version>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp" Private="false" Publicize="true" />
<Reference Include="Unity.TextMeshPro" Private="false" />
<Reference Include="Unity.Addressables" Private="false" />
<Reference Include="Unity.ResourceManager" Private="false" />
Expand All @@ -14,15 +13,16 @@
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.0" PrivateAssets="all" />
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all" />
<PackageReference Include="BepInEx.BaseLib" Version="5.4.21" Publicize="true" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.1.0" PrivateAssets="all" />
<PackageReference Include="HarmonyX" Version="2.10.1" />
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="UitkForKsp2" Version="1.0.0" />
<PackageReference Include="UnityEngine.Modules" Version="2020.3.33" />
<PackageReference Include="UnityEngine.UITK" Version="2020.3.33" />
<PackageReference Include="UitkForKsp2" Version="1.2.0" />
<PackageReference Include="UnityEngine.Modules" Version="2020.3.33.1" Publicize="true" />
<PackageReference Include="UnityEngine.UITK" Version="2020.3.33.1" Publicize="true" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SpaceWarpPatcher\SpaceWarpPatcher.csproj">
Expand Down
26 changes: 6 additions & 20 deletions SpaceWarp/UI/ModList/ModListController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand All @@ -9,6 +8,7 @@
using SpaceWarp.API.Mods.JSON;
using SpaceWarp.API.UI;
using SpaceWarpPatcher;
using UitkForKsp2;
using UitkForKsp2.API;
using UnityEngine;
using UnityEngine.UIElements;
Expand Down Expand Up @@ -69,6 +69,7 @@ public class ModListController : MonoBehaviour
private static readonly IReadOnlyList<string> NoToggleGuids = new List<string>
{
SpaceWarpPlugin.ModGuid,
UitkForKsp2Plugin.ModGuid,
ConfigurationManager.ConfigurationManager.GUID
};

Expand Down Expand Up @@ -121,23 +122,8 @@ private void SetupDocument()
}

_container = document.rootVisualElement;

StartCoroutine(SetupWindow());
}

private IEnumerator SetupWindow()
{
yield return new WaitForFixedUpdate();

var root = _container.hierarchy[0];
root.transform.position = new Vector3(
(Screen.width - root.boundingBox.width) / 2,
(Screen.height - root.boundingBox.height) / 2
);

yield return new WaitForFixedUpdate();

_container.style.display = DisplayStyle.None;
_container[0].CenterByDefault();
HideWindow();
}

private void InitializeElements()
Expand Down Expand Up @@ -530,13 +516,13 @@ internal void UpdateOutdated(string guid, bool isOutdated)
}
}

internal void ToggleWindow()
private void ToggleWindow()
{
_container.style.display = _isWindowVisible ? DisplayStyle.None : DisplayStyle.Flex;
_isWindowVisible = !_isWindowVisible;
}

internal void HideWindow()
private void HideWindow()
{
_container.style.display = DisplayStyle.None;
_isWindowVisible = false;
Expand Down
1 change: 1 addition & 0 deletions SpaceWarpPatcher/SpaceWarpPatcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.BaseLib" Version="5.4.21" />
<PackageReference Include="HarmonyX" Version="2.10.1" />
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.1.2" />
</ItemGroup>

</Project>

0 comments on commit aa04c41

Please sign in to comment.