1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 16:13:31 +08:00

Dustbin 1.3.3

This commit is contained in:
2024-02-19 21:35:54 +08:00
parent e2d83ee3cb
commit 4a0ab4494a
5 changed files with 19 additions and 13 deletions

View File

@@ -5,12 +5,13 @@ using System.Runtime.CompilerServices;
using BepInEx; using BepInEx;
using crecheng.DSPModSave; using crecheng.DSPModSave;
using NebulaAPI; using NebulaAPI;
using NebulaAPI.Interfaces;
namespace Dustbin; namespace Dustbin;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency(DSPModSavePlugin.MODGUID)] [BepInDependency(DSPModSavePlugin.MODGUID)]
[BepInDependency(NebulaModAPI.API_GUID)] [BepInDependency(NebulaModAPI.API_GUID, BepInDependency.DependencyFlags.SoftDependency)]
public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
{ {
public string Version => PluginInfo.PLUGIN_VERSION; public string Version => PluginInfo.PLUGIN_VERSION;
@@ -41,14 +42,11 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
} }
if (storageDustbin) StoragePatch.Enable(true); if (storageDustbin) StoragePatch.Enable(true);
if (tankDustbin) TankPatch.Enable(true); if (tankDustbin) TankPatch.Enable(true);
if (storageDustbin || tankDustbin)
{
NebulaModAPI.RegisterPackets(Assembly.GetExecutingAssembly());
NebulaModAPI.OnPlanetLoadFinished += RequestPlanetDustbinData;
}
if (belgSignalDustbin) BeltSignal.Enable(true); if (belgSignalDustbin) BeltSignal.Enable(true);
if (!BepInEx.Bootstrap.Chainloader.PluginInfos.ContainsKey("dsp.nebula-multiplayer") || (!storageDustbin && !tankDustbin)) return;
NebulaModAPI.RegisterPackets(Assembly.GetExecutingAssembly());
NebulaModAPI.OnPlanetLoadFinished += RequestPlanetDustbinData;
} }
private void OnDestroy() private void OnDestroy()
@@ -178,7 +176,7 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
public void RequestPlanetDustbinData(int planetId) public void RequestPlanetDustbinData(int planetId)
{ {
if (NebulaModAPI.IsMultiplayerActive && NebulaModAPI.MultiplayerSession.LocalPlayer.IsClient) if (NebulaModAPI.IsMultiplayerActive && NebulaModAPI.MultiplayerSession.IsClient)
NebulaModAPI.MultiplayerSession.Network.SendPacket(new NebulaSupport.Packet.ToggleEvent(planetId, 0, false)); NebulaModAPI.MultiplayerSession.Network.SendPacket(new NebulaSupport.Packet.ToggleEvent(planetId, 0, false));
} }
#endregion #endregion

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.dustbin</BepInExPluginGuid> <BepInExPluginGuid>org.soardev.dustbin</BepInExPluginGuid>
<Description>DSP MOD - Dustbin</Description> <Description>DSP MOD - Dustbin</Description>
<Version>1.3.2</Version> <Version>1.3.3</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<PackageId>Dustbin</PackageId> <PackageId>Dustbin</PackageId>
@@ -18,7 +18,7 @@
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" /> <PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" /> <PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<PackageReference Include="DysonSphereProgram.Modding.DSPModSave" Version="1.*" /> <PackageReference Include="DysonSphereProgram.Modding.DSPModSave" Version="1.*" />
<PackageReference Include="DysonSphereProgram.Modding.NebulaMultiplayerModApi" Version="1.3.1" /> <PackageReference Include="DysonSphereProgram.Modding.NebulaMultiplayerModApi" Version="2.0.0" />
<PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" /> <PackageReference Include="UnityEngine.Modules" Version="2018.4.12" IncludeAssets="compile" />
</ItemGroup> </ItemGroup>

View File

@@ -1,4 +1,6 @@
using NebulaAPI; using NebulaAPI;
using NebulaAPI.Networking;
using NebulaAPI.Packets;
namespace Dustbin.NebulaSupport namespace Dustbin.NebulaSupport
{ {

View File

@@ -4,6 +4,9 @@
#### 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品) #### 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)
## Changelog ## Changelog
* 1.3.3
+ Support for NebulaMultiplayerModApi 2.0.0
* 1.3.2 * 1.3.2
+ Fix a display issue that the dustbin checkbox is overlapped with the filter button in storage UI. + Fix a display issue that the dustbin checkbox is overlapped with the filter button in storage UI.
@@ -38,6 +41,9 @@
+ You can get item ID list [here](https://dsp-wiki.com/Modding:Items_IDs). + You can get item ID list [here](https://dsp-wiki.com/Modding:Items_IDs).
## 更新日志 ## 更新日志
* 1.3.3
+ 支持NebulaMultiplayerModApi 2.0.0
* 1.3.2 * 1.3.2
+ 修正了储物仓UI中的垃圾桶勾选框与筛选按钮重叠的显示问题 + 修正了储物仓UI中的垃圾桶勾选框与筛选按钮重叠的显示问题

View File

@@ -1,11 +1,11 @@
{ {
"name": "Dustbin", "name": "Dustbin",
"version_number": "1.3.2", "version_number": "1.3.3",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/Dustbin", "website_url": "https://github.com/soarqin/DSP_Mods/tree/master/Dustbin",
"description": "Can turn Storages and Tanks into Dustbin(Destroy incoming items) / 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)", "description": "Can turn Storages and Tanks into Dustbin(Destroy incoming items) / 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)",
"dependencies": [ "dependencies": [
"xiaoye97-BepInEx-5.4.17", "xiaoye97-BepInEx-5.4.17",
"CommonAPI-DSPModSave-1.1.4", "CommonAPI-DSPModSave-1.1.4",
"nebula-NebulaMultiplayerModApi-1.3.1" "nebula-NebulaMultiplayerModApi-2.0.0"
] ]
} }