Skip to content
Open
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
28 changes: 19 additions & 9 deletions MoreParts/Managers/ColonyManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ namespace MorePartsMod.Managers
{
class ColonyManager : MonoBehaviour
{
// public
public static ColonyManager Main;
public Player_Local Player;

public List<ColonyComponent> Colonies { get; private set; }

//private
private SFS.UI.ModGUI.Button _createColonyButton;
private ColonyGUI _ui;
private bool _extractFlow;
Expand Down Expand Up @@ -83,7 +80,7 @@ public bool CheckAndReduceMaterials(float constructionRequired, float electronic
{
if (resourceGroup.ResourceAmount < electronicRequired)
{
MsgDrawer.main.Log("Insufficient Electronic Components");
MsgDrawer.main.Log("Insufficient electronic components");
return false;
}
electronic = resourceGroup;
Expand All @@ -93,7 +90,7 @@ public bool CheckAndReduceMaterials(float constructionRequired, float electronic
{
if (resourceGroup.ResourceAmount < constructionRequired)
{
MsgDrawer.main.Log("Insufficient Construction MAterial");
MsgDrawer.main.Log("Insufficient construction material");
return false;
}
construction = resourceGroup;
Expand Down Expand Up @@ -154,7 +151,7 @@ private ColonyComponent GetNearestColony()

private void ExtractResources()
{
MsgDrawer.main.Log("Extracting resource from the colony to the rocket");
MsgDrawer.main.Log("Extracting resources");

ColonyComponent colony = GetNearestColony();

Expand All @@ -178,7 +175,7 @@ private void ExtractResources()

private void InsertResources()
{
MsgDrawer.main.Log("Inserting resource from the rocket to the colony");
MsgDrawer.main.Log("Storing resources in colony's refinery");

ColonyComponent colony = GetNearestColony();

Expand Down Expand Up @@ -300,8 +297,21 @@ private void CheckPlayerVelocity()
return;
}

ColonyComponent nearest = GetNearestColony();
if (nearest != null)
{
// Change button to VIEW MODE
_createColonyButton.Text = "View Colony Information";
_createColonyButton.OnClick = OpenColony;
}
else
{
// Change button to CREATE MODE
_createColonyButton.Text = "Create Colony";
_createColonyButton.OnClick = CreateColony;
}

this._createColonyButton.gameObject.SetActive(true);
_createColonyButton.gameObject.SetActive(true);
}

private void CreateColony()
Expand All @@ -311,7 +321,7 @@ private void CreateColony()

if (!this.CheckColonyDistance(planet.codeName, playerLocation.position.Value))
{
MsgDrawer.main.Log("Too close to another colony");
MsgDrawer.main.Log("Already inside another colony");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion MoreParts/Managers/ResourcesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void DrawInMap()
{
if (deposit.Active && deposit.Discovered)
{
MapUtils.DrawLandmarkInPlanet(this.CurrentPlanet, deposit.AngleDegree, deposit.Location, "Resource Deposit", Color.red);
MapUtils.DrawLandmarkInPlanet(this.CurrentPlanet, deposit.AngleDegree, deposit.Location, deposit.GetDepositSizeName(), Color.red);
}
}

Expand Down
Loading