Skip to content

Commit d982a98

Browse files
Merge pull request #39 from cvusmo/dev
v0.3.0.1 fully functional
2 parents eb30c39 + 13e747f commit d982a98

4 files changed

Lines changed: 21 additions & 26 deletions

File tree

Toggle NotificationsProject/TNTools/UI/AssetsLoader.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ internal class AssetsLoader
77
{
88
internal static Texture2D LoadIcon(string path)
99
{
10-
Texture2D imageTexture = AssetManager.GetAsset<Texture2D>("togglenotifications/images/" + path + ".png");
10+
string fullPath = "com.github.cvusmo.togglenotifications/images/" + path + ".png";
11+
Debug.Log("Trying to load asset from path: " + fullPath);
12+
Texture2D imageTexture = AssetManager.GetAsset<Texture2D>(fullPath);
1113

1214
if (imageTexture == null)
1315
{
1416
Debug.LogError("Failed to load image texture from path: " + path);
1517
Debug.Log("Full resource path: " + Application.dataPath + "/" + path);
1618
Debug.Log("Expected resource type: Texture2D");
17-
Debug.Log("Full path: " + Application.dataPath + "/togglenotifications/images/" + path + ".png");
19+
Debug.Log("Full path: " + Application.dataPath + "com.github.cvusmo.togglenotifications/images/" + path + ".png");
1820
}
1921
return imageTexture;
2022
}

Toggle NotificationsProject/ToggleNotificationsPlugin.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public override void OnInitialized()
5959
TNBaseSettings.Init(SettingsPath);
6060

6161
base.OnInitialized();
62+
Debug.Log("SpaceWarpMetadata.ModID value: " + SpaceWarpMetadata.ModID);
6263

6364
Instance = this;
6465
Logger = base.Logger;
@@ -68,12 +69,13 @@ public override void OnInitialized()
6869
messageCenter = game.Messages;
6970

7071
MainUI = new ToggleNotificationsUI(this, _isGUIenabled, messageCenter);
72+
Debug.Log("SpaceWarpMetadata.ModID value: " + SpaceWarpMetadata.ModID);
7173

7274
// Register Flight AppBar button
7375
Appbar.RegisterAppButton(
7476
"Toggle Notifications",
7577
ToolbarFlightButtonID,
76-
AssetManager.GetAsset<Texture2D>($"{SpaceWarpMetadata.ModID}/images/icon.png"),
78+
AssetManager.GetAsset<Texture2D>($"{SpaceWarpMetadata.ModID}/images/icon.png"), //changed
7779
isOpen =>
7880
{
7981
ToggleButton(isOpen, isOpen);
Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<Project Sdk="Microsoft.NET.Sdk">
23
<PropertyGroup>
34
<TargetFramework>netstandard2.0</TargetFramework>
@@ -16,7 +17,11 @@
1617
<ApplicationIcon>icon.ico</ApplicationIcon>
1718
<PackageProjectUrl>https://github.com/cvusmo/Toggle-Notifications</PackageProjectUrl>
1819
<PackageIcon>icon.png</PackageIcon>
19-
<RepositoryUrl>https://github.com/cvusmo/Toggle-Notifications</RepositoryUrl>
20+
<RepositoryUrl></RepositoryUrl>
21+
<PackageTags>KSP2-mods</PackageTags>
22+
</PropertyGroup>
23+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
24+
<Optimize>True</Optimize>
2025
</PropertyGroup>
2126
<ItemGroup>
2227
<Compile Remove="assets\**" />
@@ -31,30 +36,18 @@
3136
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all" />
3237
<PackageReference Include="BepInEx.Core" Version="5.*" />
3338
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
34-
<PackageReference Include="DocumentFormat.OpenXml" Version="2.20.0" />
35-
<PackageReference Include="HarmonyX" Version="2.10.1" />
36-
<PackageReference Include="Lib.Harmony" Version="2.2.2" />
39+
<PackageReference Include="HarmonyX" Version="2.10.2" />
3740
<PackageReference Include="SpaceWarp" Version="1.4.*" />
38-
</ItemGroup>
41+
<PackageReference Include="UnityEngine.Modules" Version="2020.3.33.1" IncludeAssets="compile" />
42+
</ItemGroup>
3943
<ItemGroup>
4044
<Reference Include="Assembly-CSharp">
4145
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\KSP2_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
46+
<Publicize>true</Publicize>
47+
<Private>false</Private>
4248
</Reference>
4349
</ItemGroup>
44-
<ItemGroup>
45-
<Compile Update="Properties\Settings.Designer.cs">
46-
<DesignTimeSharedInput>True</DesignTimeSharedInput>
47-
<AutoGen>True</AutoGen>
48-
<DependentUpon>Settings.settings</DependentUpon>
49-
</Compile>
50-
</ItemGroup>
51-
<ItemGroup>
52-
<None Update="Properties\Settings.settings">
53-
<Generator>PublicSettingsSingleFileGenerator</Generator>
54-
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
55-
</None>
56-
</ItemGroup>
5750
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
5851
<Exec Command="rm -rf &quot;$(ProjectDir)..\$(ConfigurationName)\&quot;&#xA;echo d | xcopy /y /s &quot;$(ProjectDir)..\$(ModId)\&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\&quot;&#xA;echo f | xcopy /y &quot;$(TargetPath)&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).dll&quot;&#xA;if $(ConfigurationName) == Debug echo f | xcopy /y &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\$(ModId).pdb&quot;&#xA;xcopy /y &quot;$(ProjectDir)..\LICENSE&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\&quot;&#xA;echo f | xcopy /y &quot;$(ProjectDir)..\README.md&quot; &quot;$(ProjectDir)..\$(ConfigurationName)\BepInEx\plugins\$(ModId)\README.txt&quot;" />
5952
</Target>
60-
</Project>
53+
</Project>

toggle_notifications/swinfo.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@
55
"description": "Toggle Notifications on and off",
66
"license": "MIT",
77
"source": "https://github.com/cvusmo/Toggle-Notifications",
8-
"version": "0.2.5",
9-
"spec": "1.3",
108
"version": "0.3.0",
119
"spec": "1.3",
1210
"version_check": "https://raw.githubusercontent.com/cvusmo/Toggle-Notifications/master/toggle_notifications/swinfo.json",
1311
"dependencies": [
1412
{
1513
"id": "com.github.x606.spacewarp",
1614
"version": {
17-
"min": "1.1.1",
15+
"min": "1.4.*",
1816
"max": "*"
1917
}
2018
}
2119
],
2220
"ksp2_version": {
23-
"min": "0.1.0",
21+
"min": "0.1.4",
2422
"max": "*"
2523
}
2624
}

0 commit comments

Comments
 (0)