Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/thunderstore_bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ function generateManifest() {
const manifest = {
name: pluginInfo.name,
description:
"With this mod you will be able to play with your friends in the same game! Now supports combat mode in game version 0.10.33",
"With this mod you will be able to play with your friends in the same game! Now supports combat mode in game version 0.10.34",
version_number: pluginInfo.version,
dependencies: [
BEPINEX_DEPENDENCY,
`nebula-${apiPluginInfo.name}-${apiPluginInfo.version}`,
"PhantomGamers-IlLine-1.0.0",
"starfi5h-BulletTime-1.5.12",
"starfi5h-BulletTime-1.5.13",
"starfi5h-ErrorAnalyzer-1.3.3",
"starfi5h-NebulaCompatibilityAssist-0.5.0"
],
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Changelog

0.9.20
- Compatible with game version 0.10.34.28392
- @gabrielgad: Sync Planet Memo
- @gabrielgad: Sync Holo Beacon (marker)

0.9.19:
- Add new config option `Chat View Mode` to switch between TMPro and IMGUI chat window.
- Sync point-to-point transport setting window in client.
Expand Down
14 changes: 8 additions & 6 deletions NebulaModel/MultiplayerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,14 @@ public bool StreamerMode


// Detail function group buttons
public bool PowerGridEnabled { get; set; }
public bool VeinDistributionEnabled { get; set; }
public bool SpaceNavigationEnabled { get; set; } = true;
public bool BuildingWarningEnabled { get; set; } = true;
public bool BuildingIconEnabled { get; set; } = true;
public bool GuidingLightEnabled { get; set; } = true;
public bool ShowDetailPowerGrid { get; set; }
public bool ShowDetailVeinDistribution { get; set; }
public bool ShowDetailSpaceNavigation { get; set; } = true;
public bool ShowDetailDefenseArea { get; set; }
public bool ShowDetailBuildingAlarm { get; set; } = true;
public bool ShowDetailBuildingIcon { get; set; } = true;
public bool ShowGuidingLight { get; set; } = true;
public bool ShowDetailHpBars { get; set; } = true;

public bool RemoteAccessEnabled { get; set; } = false;
public string RemoteAccessPassword { get; set; } = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ public enum MonitorSettingEvent
SetMonitorMode = 3,
SetSystemWarningMode = 4,
SetSystemWarningSignalId = 5,
SetCargoFilter = 6,
SetTargetCargoBytes = 7,
SetPeriodTickCount = 8,
SetTargetBelt = 9,
SetSpawnOperator = 10
SetDigitalSignalId = 6,
SetCargoFilter = 7,
SetTargetCargoBytes = 8,
SetPeriodTickCount = 9,
SetTargetBelt = 10,
SetSpawnOperator = 11
}
5 changes: 3 additions & 2 deletions NebulaModel/Packets/Universe/MarkerSettingUpdatePacket.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NebulaModel.Packets.Universe;
namespace NebulaModel.Packets.Universe;

public class MarkerSettingUpdatePacket
{
Expand Down Expand Up @@ -36,5 +36,6 @@ public enum MarkerSettingEvent
SetVisibility = 6,
SetDetailLevel = 7,
SetHeight = 8,
SetRadius = 9
SetRadius = 9,
SetDigitalSignalId = 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ protected override void ProcessPacket(MonitorSettingUpdatePacket packet, NebulaC
pool[packet.MonitorId].SetSystemWarningSignalId(packet.Parameter1);
break;

case MonitorSettingEvent.SetDigitalSignalId:
pool[packet.MonitorId].SetDigitalSignalId(packet.Parameter1);
break;

case MonitorSettingEvent.SetCargoFilter:
pool[packet.MonitorId].SetCargoFilter(packet.Parameter1);
break;
Expand Down Expand Up @@ -99,6 +103,10 @@ protected override void ProcessPacket(MonitorSettingUpdatePacket packet, NebulaC
uIMonitor.iconTagImage.sprite = sprite ? sprite : uIMonitor.tagNotSelectedSprite;
break;

case MonitorSettingEvent.SetDigitalSignalId:
uIMonitor.digitalSignalIdInput.SetTextWithoutNotify((packet.Parameter1 == 0) ? "" : packet.Parameter1.ToString());
break;

case MonitorSettingEvent.SetCargoFilter:
var sprite2 = LDB.items.Select(packet.Parameter1)?.iconSprite;
uIMonitor.cargoFilterImage.sprite = sprite2 ? sprite2 : uIMonitor.cargoFilterNotSelectedSprite;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region
#region

using NebulaAPI.Packets;
using NebulaModel.Logger;
Expand Down Expand Up @@ -94,6 +94,10 @@ protected override void ProcessPacket(MarkerSettingUpdatePacket packet, NebulaCo
case MarkerSettingEvent.SetRadius:
marker.SetRadius(packet.FloatValue);
break;

case MarkerSettingEvent.SetDigitalSignalId:
marker.SetDigitalSignalId(packet.IntValue);
break;
}

try
Expand All @@ -103,6 +107,13 @@ protected override void ProcessPacket(MarkerSettingUpdatePacket packet, NebulaCo
catch
{
}

//Update UI Window too if it is viewing the current marker
var window = UIRoot.instance.uiGame.markerWindow;
if (window.active && window.markerId == packet.MarkerId && window.factory == factory)
{
window.markerDesc.Refresh();
}
}
}
}
26 changes: 0 additions & 26 deletions NebulaPatcher/Patches/Dynamic/EntitySignRenderer_Patch.cs

This file was deleted.

37 changes: 37 additions & 0 deletions NebulaPatcher/Patches/Dynamic/GamePrefsData_Patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#region

using HarmonyLib;
using NebulaModel;
using NebulaWorld;

#endregion

namespace NebulaPatcher.Patches.Dynamic;

[HarmonyPatch(typeof(GamePrefsData))]
internal class GamePrefsData_Patch
{
[HarmonyPostfix]
[HarmonyPatch(nameof(GamePrefsData.Restore))]
public static void Restore_Postfix()
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}

NebulaModel.Logger.Log.Debug("Apply save prefs");
var uiGame = UIRoot.instance.uiGame;
PowerSystemRenderer.powerGraphOn = Config.Options.ShowDetailPowerGrid;
uiGame.dfVeinOn = Config.Options.ShowDetailVeinDistribution;
uiGame.dfSpaceGuideOn = Config.Options.ShowDetailSpaceNavigation;
DefenseSystemRenderer.turretGraphOn = Config.Options.ShowDetailDefenseArea;
EntitySignRenderer.showSign = Config.Options.ShowDetailBuildingAlarm;
EntitySignRenderer.showIcon = Config.Options.ShowDetailBuildingIcon;
PostEffectController.headlight = Config.Options.ShowGuidingLight;
if (GameMain.sectorModel != null)
{
GameMain.sectorModel.disableHPBars = !Config.Options.ShowDetailHpBars;
}
}
}
13 changes: 13 additions & 0 deletions NebulaPatcher/Patches/Dynamic/MonitorComponent_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ public static void SetSystemWarningSignalId_Prefix(MonitorComponent __instance,
new MonitorSettingUpdatePacket(planetId, __instance.id, MonitorSettingEvent.SetSystemWarningSignalId, __0));
}

[HarmonyPrefix]
[HarmonyPatch(nameof(MonitorComponent.SetDigitalSignalId))]
public static void SetDigitalSignalId(MonitorComponent __instance, int __0)
{
if (!Multiplayer.IsActive || Multiplayer.Session.Warning.IsIncomingMonitorPacket)
{
return;
}
var planetId = GameMain.data.localPlanet == null ? -1 : GameMain.data.localPlanet.id;
Multiplayer.Session.Network.SendPacketToLocalStar(
new MonitorSettingUpdatePacket(planetId, __instance.id, MonitorSettingEvent.SetDigitalSignalId, __0));
}

[HarmonyPrefix]
[HarmonyPatch(nameof(MonitorComponent.SetCargoFilter))]
public static void SetCargoFilter_Prefix(MonitorComponent __instance, int __0)
Expand Down
25 changes: 0 additions & 25 deletions NebulaPatcher/Patches/Dynamic/PostEffectController_Patch.cs

This file was deleted.

25 changes: 0 additions & 25 deletions NebulaPatcher/Patches/Dynamic/PowerSystemRenderer_Patch.cs

This file was deleted.

74 changes: 14 additions & 60 deletions NebulaPatcher/Patches/Dynamic/UIGameMenu_Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,79 +13,33 @@ internal class UIGameMenu_Patch
{
[HarmonyPostfix]
[HarmonyPatch(nameof(UIGameMenu.OnDfGuideButtonClick))]
public static void OnDfGuideButtonClick_Postfix(UIGameMenu __instance)
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}

Config.Options.SpaceNavigationEnabled = __instance.uiGame.dfSpaceGuideOn;
Config.SaveOptions();
}

[HarmonyPostfix]
[HarmonyPatch(nameof(UIGameMenu.OnDfIconButtonClick))]
public static void OnDfIconButtonClick_Postfix()
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}

Config.Options.BuildingIconEnabled = EntitySignRenderer.showIcon;
Config.SaveOptions();
}

[HarmonyPostfix]
[HarmonyPatch(nameof(UIGameMenu.OnDfLightButtonClick))]
public static void OnDfLightButtonClick_Postfix()
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}

Config.Options.GuidingLightEnabled = PowerSystemRenderer.powerGraphOn;
Config.SaveOptions();
}

[HarmonyPostfix]
[HarmonyPatch(nameof(UIGameMenu.OnDfPowerButtonClick))]
public static void OnDfPowerButtonClick_Postfix()
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}

Config.Options.PowerGridEnabled = PostEffectController.headlight;
Config.SaveOptions();
}

[HarmonyPostfix]
[HarmonyPatch(nameof(UIGameMenu.OnDfSignButtonClick))]
public static void OnDfSignButtonClick_Postfix()
[HarmonyPatch(nameof(UIGameMenu.OnDfVeinButtonClick))]
[HarmonyPatch(nameof(UIGameMenu.OnDfDefenseButtonClick))]
[HarmonyPatch(nameof(UIGameMenu.OnDfHpBarButtonClick))]
public static void SaveDetailOptions()
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}
var uiGame = UIRoot.instance.uiGame;

Config.Options.BuildingWarningEnabled = EntitySignRenderer.showSign;
Config.SaveOptions();
}
Config.Options.ShowDetailPowerGrid = PowerSystemRenderer.powerGraphOn;
Config.Options.ShowDetailVeinDistribution = uiGame.dfVeinOn;
Config.Options.ShowDetailSpaceNavigation = uiGame.dfSpaceGuideOn;
Config.Options.ShowDetailDefenseArea = DefenseSystemRenderer.turretGraphOn;

[HarmonyPostfix]
[HarmonyPatch(nameof(UIGameMenu.OnDfVeinButtonClick))]
public static void OnDfVeinButtonClick_Postfix(UIGameMenu __instance)
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
Config.Options.ShowDetailBuildingAlarm = EntitySignRenderer.showSign;
Config.Options.ShowDetailBuildingIcon = EntitySignRenderer.showIcon;
Config.Options.ShowGuidingLight = PostEffectController.headlight;
if (GameMain.sectorModel != null)
{
return;
Config.Options.ShowDetailHpBars = !GameMain.sectorModel.disableHPBars;
}

Config.Options.VeinDistributionEnabled = __instance.uiGame.dfVeinOn;
Config.SaveOptions();
}
}
16 changes: 0 additions & 16 deletions NebulaPatcher/Patches/Dynamic/UIGame_Patch.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#region

using System.Diagnostics.CodeAnalysis;
using HarmonyLib;
using NebulaModel;
using NebulaWorld;

#endregion
Expand All @@ -12,20 +10,6 @@ namespace NebulaPatcher.Patches.Dynamic;
[HarmonyPatch(typeof(UIGame))]
internal class UIGame_Patch
{
[HarmonyPostfix]
[HarmonyPatch(nameof(UIGame._OnInit))]
[SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Original Function Name")]
public static void _OnInit_Postfix(UIGame __instance)
{
if (!Multiplayer.IsActive || Multiplayer.Session.LocalPlayer.IsHost)
{
return;
}

__instance.dfSpaceGuideOn = Config.Options.SpaceNavigationEnabled;
__instance.dfVeinOn = Config.Options.VeinDistributionEnabled;
}

[HarmonyPrefix]
[HarmonyPatch(nameof(UIGame.StarmapChangingToMilkyWay))]
public static bool StarmapChangingToMilkyWay_Prefix()
Expand Down
Loading