internal void SetStandardModes(CyclopsModel cyclopsModel) { SetInternalLighting(cyclopsModel.Id, cyclopsModel.InternalLightsOn); SetFloodLighting(cyclopsModel.Id, cyclopsModel.FloodLightsOn); ToggleEngineState(cyclopsModel.Id, cyclopsModel.EngineState, false, true); ChangeEngineMode(cyclopsModel.Id, cyclopsModel.EngineMode); }
public static void Postfix(CyclopsHelmHUDManager __instance) { CyclopsModel cyclops = Resolve <Vehicles>().GetVehicles <CyclopsModel>(NitroxEntity.GetId(__instance.subRoot.gameObject)); __instance.hudActive = true; __instance.engineToggleAnimator.SetTrigger(cyclops.EngineState ? "EngineOn" : "EngineOff"); }
public static bool Prefix(CyclopsLightingPanel __instance) { // Suppress powered on if a cyclops´s floodlight is set to false GameObject gameObject = __instance.gameObject; NitroxId id = NitroxIdentifier.GetId(gameObject); CyclopsModel model = NitroxServiceLocator.LocateService <Vehicles>().GetVehicles <CyclopsModel>(id); return(model.FloodLightsOn); }
// Will be called at a later, because it is needed that the modules are installed and may need power to not immediatly be shut off public void SetAdvancedModes(CyclopsModel cyclopsModel) { // We need to wait till the cyclops is powered up to start all advanced modes // At this time all Equipment will be loaded into the cyclops, so we do not need other structures SubRoot root = NitroxEntity.GetObjectFrom(cyclopsModel.Id).Value.GetComponent <SubRoot>(); UWE.Event <PowerRelay> .HandleFunction handleFunction = null; handleFunction = _ => { ChangeSilentRunning(cyclopsModel.Id, cyclopsModel.SilentRunningOn); ChangeShieldMode(cyclopsModel.Id, cyclopsModel.ShieldOn); ChangeSonarMode(cyclopsModel.Id, cyclopsModel.SonarOn); // After registering all modes. Remove the handler root.powerRelay.powerUpEvent.RemoveHandler(root, handleFunction); }; root.powerRelay.powerUpEvent.AddHandler(root, handleFunction); }
public void SetAllModes(CyclopsModel model) { SetStandardModes(model); SetAdvancedModes(model); }