Quantum-Engineering/MachineGUI.cs

589 lines
27 KiB
C#
Raw Normal View History

2020-07-24 07:53:54 -04:00
using UnityEngine;
2020-09-03 03:09:26 -04:00
using System.Collections.Generic;
2020-07-24 07:53:54 -04:00
public class MachineGUI : MonoBehaviour
{
private PlayerController playerController;
private GuiCoordinates gc;
2020-09-03 18:26:56 -04:00
private TextureDictionary td;
2020-09-03 03:09:26 -04:00
private bool hubStopWindowOpen;
2020-07-24 07:53:54 -04:00
2020-09-03 03:09:26 -04:00
// Called by unity engine on start up to initialize variables
public void Start()
2020-07-24 07:53:54 -04:00
{
playerController = GetComponent<PlayerController>();
gc = GetComponent<GuiCoordinates>();
2020-09-03 18:26:56 -04:00
td = GetComponent<TextureDictionary>();
2020-07-24 07:53:54 -04:00
}
2020-09-03 03:09:26 -04:00
// Called by unity engine for rendering and handling GUI events
public void OnGUI()
2020-07-24 07:53:54 -04:00
{
//STYLE
GUI.skin = GetComponent<PlayerGUI>().thisGUIskin;
//ASPECT RATIO
int ScreenHeight = Screen.height;
int ScreenWidth = Screen.width;
if (ScreenHeight < 700)
{
GUI.skin.label.fontSize = 10;
}
if (playerController.stateManager.worldLoaded == true && GetComponent<MainMenu>().finishedLoading == true)
{
//MACHINE CONTROL GUI
if (playerController.inventoryOpen == false && playerController.machineGUIopen == true && playerController.objectInSight != null)
{
GameObject obj = playerController.objectInSight;
if (obj.GetComponent<PowerConduit>() != null)
2020-07-24 07:53:54 -04:00
{
PowerConduit powerConduit = obj.GetComponent<PowerConduit>();
if (powerConduit.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.FourButtonSpeedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.outputLabelRect, "Range");
powerConduit.range = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, powerConduit.range, 6, 120);
if (GUI.Button(gc.outputControlButton3Rect, "Dual Output: " + powerConduit.dualOutput))
2020-07-24 07:53:54 -04:00
{
if (powerConduit.dualOutput == true)
2020-07-24 07:53:54 -04:00
{
powerConduit.dualOutput = false;
2020-07-24 07:53:54 -04:00
}
else
{
powerConduit.dualOutput = true;
2020-07-24 07:53:54 -04:00
}
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
if (GUI.Button(gc.outputControlButton4Rect, "Close"))
2020-07-24 07:53:54 -04:00
{
playerController.machineGUIopen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
else
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
powerConduit.connectionAttempts = 0;
powerConduit.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<RailCartHub>() != null)
2020-07-24 07:53:54 -04:00
{
RailCartHub hub = obj.GetComponent<RailCartHub>();
if (hub.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
if (hubStopWindowOpen == false)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.FiveButtonSpeedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.railCartHubCircuitLabelRect, "Circuit");
int circuit = hub.circuit;
string circuitString = GUI.TextField(gc.railCartHubCircuitRect, circuit.ToString(), 3);
try
{
hub.circuit = int.Parse(circuitString);
}
catch
{
//NOOP
}
GUI.Label(gc.outputLabelRect, "Range");
hub.range = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, hub.range, 6, 120);
if (GUI.Button(gc.outputControlButton3Rect, "Stop Settings"))
2020-07-24 07:53:54 -04:00
{
hubStopWindowOpen = true;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
if (GUI.Button(gc.outputControlButton4Rect, "Close"))
2020-07-24 07:53:54 -04:00
{
playerController.machineGUIopen = false;
hubStopWindowOpen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
else
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.FiveButtonSpeedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.longOutputLabelRect, "Stop Time");
if (GUI.Button(gc.outputControlButton0Rect, "Stop: " + hub.stop))
2020-07-24 07:53:54 -04:00
{
if (hub.stop == true)
2020-07-24 07:53:54 -04:00
{
hub.stop = false;
2020-07-24 07:53:54 -04:00
}
else
{
hub.stop = true;
2020-07-24 07:53:54 -04:00
}
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
hub.stopTime = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, hub.stopTime, 0, 600);
if (GUI.Button(gc.outputControlButton3Rect, "Range Settings"))
2020-07-24 07:53:54 -04:00
{
hubStopWindowOpen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
if (GUI.Button(gc.outputControlButton4Rect, "Close"))
2020-07-24 07:53:54 -04:00
{
playerController.machineGUIopen = false;
hubStopWindowOpen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
else
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
hub.connectionAttempts = 0;
hub.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<Retriever>() != null)
2020-07-24 07:53:54 -04:00
{
Retriever retriever = obj.GetComponent<Retriever>();
if (retriever.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.FourButtonSpeedControlBGRect, td.dictionary["Interface Background"]);
if (retriever.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
retriever.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, retriever.speed, 0, retriever.power);
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
}
if (GUI.Button(gc.outputControlButton3Rect, "Choose Items"))
{
if (obj.GetComponent<InventoryManager>().initialized == true)
2020-07-24 07:53:54 -04:00
{
playerController.inventoryOpen = true;
playerController.storageGUIopen = true;
playerController.machineGUIopen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
if (GUI.Button(gc.outputControlButton4Rect, "Close"))
2020-07-24 07:53:54 -04:00
{
playerController.machineGUIopen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
else
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
retriever.connectionAttempts = 0;
retriever.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<AutoCrafter>() != null)
2020-07-24 07:53:54 -04:00
{
AutoCrafter autoCrafter = obj.GetComponent<AutoCrafter>();
if (autoCrafter.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.FourButtonSpeedControlBGRect, td.dictionary["Interface Background"]);
if (autoCrafter.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
autoCrafter.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, autoCrafter.speed, 0, autoCrafter.power);
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
}
if (GUI.Button(gc.outputControlButton3Rect, "Choose Item"))
{
if (obj.GetComponent<InventoryManager>().initialized == true)
2020-07-24 07:53:54 -04:00
{
playerController.inventoryOpen = true;
playerController.storageGUIopen = true;
playerController.machineGUIopen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
if (GUI.Button(gc.outputControlButton4Rect, "Close"))
2020-07-24 07:53:54 -04:00
{
playerController.machineGUIopen = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
else
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
autoCrafter.connectionAttempts = 0;
autoCrafter.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<UniversalConduit>() != null)
2020-07-24 07:53:54 -04:00
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
UniversalConduit conduit = obj.GetComponent<UniversalConduit>();
if (conduit.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Range");
conduit.range = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, conduit.range, 6, 120);
2020-07-24 07:53:54 -04:00
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
conduit.connectionAttempts = 0;
conduit.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<DarkMatterConduit>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
DarkMatterConduit conduit = obj.GetComponent<DarkMatterConduit>();
if (conduit.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Range");
conduit.range = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, conduit.range, 6, 120);
2020-07-24 07:53:54 -04:00
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
conduit.connectionAttempts = 0;
conduit.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<HeatExchanger>() != null)
2020-07-24 07:53:54 -04:00
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
HeatExchanger hx = obj.GetComponent<HeatExchanger>();
if (hx.inputObject != null)
2020-07-24 07:53:54 -04:00
{
if (hx.inputObject.GetComponent<UniversalConduit>() != null)
2020-07-24 07:53:54 -04:00
{
if (hx.inputObject.GetComponent<UniversalConduit>().speed > 0)
2020-07-24 07:53:54 -04:00
{
if (hx.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
hx.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, hx.speed, 0, hx.inputObject.GetComponent<UniversalConduit>().speed);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
{
hx.connectionAttempts = 0;
hx.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
}
2020-07-24 07:53:54 -04:00
}
}
else
{
GUI.Label(gc.outputLabelRect, "No Input");
2020-07-24 07:53:54 -04:00
}
}
else
{
GUI.Label(gc.outputLabelRect, "No Input");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "No Input");
}
}
if (obj.GetComponent<PowerSource>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
PowerSource powerSource = obj.GetComponent<PowerSource>();
if (powerSource.connectionFailed == true)
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
powerSource.connectionAttempts = 0;
powerSource.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Online");
}
}
if (obj.GetComponent<Auger>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
Auger auger = obj.GetComponent<Auger>();
if (auger.power > 0)
{
GUI.Label(gc.outputLabelRect, "Output");
auger.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, auger.speed, 0, auger.power);
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
}
}
if (obj.GetComponent<UniversalExtractor>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
UniversalExtractor extractor = obj.GetComponent<UniversalExtractor>();
if (extractor.connectionFailed == false)
{
if (extractor.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
extractor.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, extractor.speed, 0, extractor.power);
2020-07-24 07:53:54 -04:00
}
else
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
GUI.Label(gc.outputLabelRect, "No Power");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
extractor.connectionAttempts = 0;
extractor.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<DarkMatterCollector>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
DarkMatterCollector collector = obj.GetComponent<DarkMatterCollector>();
if (collector.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
if (collector.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
collector.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, collector.speed, 0, collector.power);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
collector.connectionAttempts = 0;
collector.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<Smelter>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
Smelter smelter = obj.GetComponent<Smelter>();
if (smelter.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
2020-09-03 03:09:26 -04:00
if (smelter.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
smelter.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, smelter.speed, 0, smelter.power);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
smelter.connectionAttempts = 0;
smelter.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
if (obj.GetComponent<AlloySmelter>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
AlloySmelter alloySmelter = obj.GetComponent<AlloySmelter>();
if (alloySmelter.connectionFailed == false)
2020-07-24 07:53:54 -04:00
{
if (alloySmelter.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
alloySmelter.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, alloySmelter.speed, 0, alloySmelter.power);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
alloySmelter.connectionAttempts = 0;
alloySmelter.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
}
}
}
if (obj.GetComponent<Press>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
Press press = obj.GetComponent<Press>();
if (press.connectionFailed == false)
{
if (press.power > 0)
{
GUI.Label(gc.outputLabelRect, "Output");
press.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, press.speed, 0, press.power);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
press.connectionAttempts = 0;
press.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
}
}
}
if (obj.GetComponent<Extruder>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
Extruder extruder = obj.GetComponent<Extruder>();
if (extruder.connectionFailed == false)
{
if (extruder.power > 0)
{
GUI.Label(gc.outputLabelRect, "Output");
extruder.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, extruder.speed, 0, extruder.power);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
2020-07-24 07:53:54 -04:00
{
extruder.connectionAttempts = 0;
extruder.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
}
}
}
if (obj.GetComponent<Turret>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
Turret turret = obj.GetComponent<Turret>();
if (turret.power > 0)
{
GUI.Label(gc.outputLabelRect, "Output");
if (turret.power < 30)
{
turret.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, turret.speed, 0, turret.power);
2020-07-24 07:53:54 -04:00
}
else
{
turret.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, turret.speed, 0, 30);
2020-07-24 07:53:54 -04:00
}
}
else
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "No Power");
}
}
if (obj.GetComponent<GearCutter>() != null)
{
2020-09-03 18:26:56 -04:00
GUI.DrawTexture(gc.speedControlBGRect, td.dictionary["Interface Background"]);
GearCutter gearCutter = obj.GetComponent<GearCutter>();
if (gearCutter.connectionFailed == false)
{
if (gearCutter.power > 0)
2020-07-24 07:53:54 -04:00
{
GUI.Label(gc.outputLabelRect, "Output");
gearCutter.speed = (int)GUI.HorizontalSlider(gc.outputControlButton2Rect, gearCutter.speed, 0, gearCutter.power);
2020-07-24 07:53:54 -04:00
}
else
{
GUI.Label(gc.outputLabelRect, "No Power");
}
}
else
{
GUI.Label(gc.outputLabelRect, "Offline");
if (GUI.Button(gc.outputControlButton2Rect, "Reboot"))
{
gearCutter.connectionAttempts = 0;
gearCutter.connectionFailed = false;
2020-09-03 18:26:56 -04:00
playerController.PlayButtonSound();
2020-07-24 07:53:54 -04:00
}
}
}
}
else
{
hubStopWindowOpen = false;
gameObject.GetComponent<MSCameraController>().enabled = true;
}
}
}
}