Skip to content

Commit

Permalink
Updated to v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gamendegamer321 committed May 14, 2024
1 parent f595bc7 commit 5a99e38
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 24 deletions.
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Adds the CommNet lines from KSP 1 to KSP 2. This will finally allow you to see the CommNet you have set up in KSP 2.

This mod requires [SpaceWarp](https://spacedock.info/mod/3277/Space%20Warp%20+%20BepInEx) 1.5.2+
This mod requires [SpaceWarp](https://spacedock.info/mod/3277/Space%20Warp%20+%20BepInEx), it is recommended to always
use the newest version.

## How to use

Expand Down Expand Up @@ -43,15 +44,7 @@ as long as there are a lot of relays between the vessel and the KSC.

## Images

Below I have added a few images of how the lines look. I have added images with pathmode off and images of the same
scenario with pathmode on.

### Pathmode = off

![image](https://github.com/gamendegamer321/Commlines/assets/74590966/741801d9-59c8-4acf-b759-587172343d41)
![image](https://github.com/gamendegamer321/Commlines/assets/74590966/a7a83b2b-310e-435c-b918-90bd53c6249c)

### Pathmode = on

![image](https://github.com/gamendegamer321/Commlines/assets/74590966/9362865f-c45b-4c7b-9d33-74689d884d6c)
![image](https://github.com/gamendegamer321/Commlines/assets/74590966/f65d884a-c834-48ec-b446-6703504cc2df)
6 changes: 3 additions & 3 deletions commlines/swinfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"name": "CommNetUtils",
"description": "Add CommNet lines to KSP 2",
"source": "https://github.com/gamendegamer321/Commlines",
"version": "1.1.0",
"version": "1.2.0",
"version_check": "https://raw.githubusercontent.com/gamendegamer321/Commlines/main/commlines/swinfo.json",
"ksp2_version": {
"min": "0.1.5",
"min": "0.2.1",
"max": "*"
},
"dependencies": [
{
"id": "com.github.x606.spacewarp",
"version": {
"min": "1.5.2",
"min": "1.9.5",
"max": "*"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/CommLines/CommLines/CommLineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace CommLines.CommLines
public static class CommLineManager
{
private const string MapLayer = "Map";
public static readonly ManualLogSource Logger = BepInEx.Logging.Logger.CreateLogSource("CommNet Manager");
private static readonly ManualLogSource Logger = BepInEx.Logging.Logger.CreateLogSource("CommNet Manager");
private static readonly List<CommLineConnection> Connections = new();

private static GameInstance Game => GameManager.Instance.Game;
Expand Down
12 changes: 3 additions & 9 deletions src/CommLines/CommLinesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using CommLines.Patches;
using KSP.Game;
using KSP.UI.Binding;
using KSP.UI.Binding.Core;
using SpaceWarp;
using SpaceWarp.API.Assets;
using SpaceWarp.API.Mods;
Expand All @@ -22,12 +21,10 @@ public class CommLinesPlugin : BaseSpaceWarpPlugin
// These are useful in case some other mod wants to add a dependency to this one
public const string ModGuid = "com.gamendegamer.commlines";
public const string ModName = "CommLines";
public const string ModVer = "1.1.0";
public const string ModVer = "1.2.0";

public static CommLinesPlugin Instance { get; set; }

private static GameInstance game => GameManager.Instance.Game;

private const string AppbarId = "Commlines.Toggle";
private const string ConfigSection = "Stable features";
private const string ExperimentalConfigSection = "Experimental features";
Expand Down Expand Up @@ -133,7 +130,7 @@ private void SelectNextMode()
Appbar.SetAppBarButtonIndicator(AppbarId, true);
}

game.Notifications.ProcessNotification(new NotificationData
Game.Notifications.ProcessNotification(new NotificationData
{
Tier = NotificationTier.Passive,
Importance = NotificationImportance.None,
Expand All @@ -154,18 +151,15 @@ private static void OpenTray()

if (appbar == null)
{
CommLineManager.Logger.LogInfo("NOT FOUND!");
return;
}

var value = appbar.GetComponent<UIValue_WriteBool_Toggle>();
if (value == null)
{
CommLineManager.Logger.LogInfo("NOT FOUND! 2.0");
return;
}

CommLineManager.Logger.LogInfo("Detected!");

value.SetValue(true);
}
}
2 changes: 0 additions & 2 deletions src/CommLines/CommNet/CommNetJobHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,12 @@ private static bool CalculatePath()
{
case CommLineMode.VesselLinks:
case CommLineMode.All:
CommLineManager.Logger.LogInfo("Calculating all");
return false;
case CommLineMode.Disabled:
case CommLineMode.Hop:
case CommLineMode.ActivePathOnly:
case CommLineMode.PathOnly:
default:
CommLineManager.Logger.LogInfo("Calculating path");
return true;
}
}
Expand Down

0 comments on commit 5a99e38

Please sign in to comment.