1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 21:33:28 +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 crecheng.DSPModSave;
using NebulaAPI;
using NebulaAPI.Interfaces;
namespace Dustbin;
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
[BepInDependency(DSPModSavePlugin.MODGUID)]
[BepInDependency(NebulaModAPI.API_GUID)]
[BepInDependency(NebulaModAPI.API_GUID, BepInDependency.DependencyFlags.SoftDependency)]
public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
{
public string Version => PluginInfo.PLUGIN_VERSION;
@@ -41,14 +42,11 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
}
if (storageDustbin) StoragePatch.Enable(true);
if (tankDustbin) TankPatch.Enable(true);
if (storageDustbin || tankDustbin)
{
NebulaModAPI.RegisterPackets(Assembly.GetExecutingAssembly());
NebulaModAPI.OnPlanetLoadFinished += RequestPlanetDustbinData;
}
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()
@@ -178,7 +176,7 @@ public class Dustbin : BaseUnityPlugin, IModCanSave, IMultiplayerMod
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));
}
#endregion

View File

@@ -5,7 +5,7 @@
<TargetFramework>net472</TargetFramework>
<BepInExPluginGuid>org.soardev.dustbin</BepInExPluginGuid>
<Description>DSP MOD - Dustbin</Description>
<Version>1.3.2</Version>
<Version>1.3.3</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<PackageId>Dustbin</PackageId>
@@ -18,7 +18,7 @@
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="DysonSphereProgram.GameLibs" Version="*-r.*" />
<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" />
</ItemGroup>

View File

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

View File

@@ -4,6 +4,9 @@
#### 储物仓和储液罐可以转变为垃圾桶(销毁送进的物品)
## Changelog
* 1.3.3
+ Support for NebulaMultiplayerModApi 2.0.0
* 1.3.2
+ 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).
## 更新日志
* 1.3.3
+ 支持NebulaMultiplayerModApi 2.0.0
* 1.3.2
+ 修正了储物仓UI中的垃圾桶勾选框与筛选按钮重叠的显示问题

View File

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