tiny fixes

This commit is contained in:
Aleksander Waage 2020-08-19 22:29:53 +02:00
parent 2492cc5533
commit 6dc11d05ce
5 changed files with 11 additions and 16 deletions

View File

@ -15,7 +15,6 @@ namespace QSB
public static string DefaultServerIP;
public static bool DebugMode;
public static AssetBundle NetworkAssetBundle;
private static GameObject GameObject;
private void Awake()
{
@ -25,10 +24,9 @@ namespace QSB
private void Start()
{
Helper = ModHelper;
GameObject = gameObject;
NetworkAssetBundle = Helper.Assets.LoadBundle("assets/network");
QSB.Helper.HarmonyHelper.EmptyMethod<NetworkManagerHUD>("Update");
Helper.HarmonyHelper.EmptyMethod<NetworkManagerHUD>("Update");
gameObject.AddComponent<DebugLog>();
gameObject.AddComponent<QSBNetworkManager>();

View File

@ -150,13 +150,9 @@ namespace QSB
public void CleanupNetworkBehaviour(uint netId)
{
var networkBehaviours = FindObjectsOfType<NetworkBehaviour>()
.Where(x => x.netId.Value == netId);
.Where(x => x != null && x.netId.Value == netId);
foreach (var networkBehaviour in networkBehaviours)
{
if (networkBehaviour == null)
{
continue;
}
var transformSync = networkBehaviour.GetComponent<TransformSync.TransformSync>();
if (transformSync != null)

View File

@ -20,6 +20,7 @@ namespace QSB.TransformSync
{
LocalInstance = this;
}
private Transform GetPlayerModel()
{
return Locator.GetPlayerTransform().Find("Traveller_HEA_Player_v2");

View File

@ -14,6 +14,7 @@ namespace QSB.TransformSync
{
LocalInstance = this;
}
private Transform GetShipModel()
{
return Locator.GetShipTransform();

View File

@ -29,23 +29,22 @@ namespace QSB.Utility
ToHud(message);
}
public static string GenerateTable(List<string> collumsData, List<string> rowData)
public static string GenerateTable(List<string> columnsData, List<string> rowData)
{
var longestKey = collumsData.OrderByDescending(s => s.Length).First();
var longestKey = columnsData.OrderByDescending(s => s.Length).First();
var longestValue = rowData.OrderByDescending(s => s.Length).First();
var longestObject = (longestKey.Length > longestValue.Length) ? longestKey : longestValue;
string collums = "|";
string data = "|";
foreach (var item in collumsData)
var columns = "|";
var data = "|";
foreach (var item in columnsData)
{
collums += " " + item.PadRight(longestObject.Length) + " |";
columns += " " + item.PadRight(longestObject.Length) + " |";
}
foreach (var item in rowData)
{
data += " " + item.PadRight(longestObject.Length) + " |";
}
return collums + Environment.NewLine + data;
return columns + Environment.NewLine + data;
}
}
}