private static void BeforeMove_GetPause(UIStateVehicleSelected __instance, ref bool __state) { try { __state = getContext(__instance).Level.Timing.Paused; //Verbo( "New travel site. Paused = {0}", __state ); } catch (Exception ex) { Error(ex); } }
private static void AfterContextMove_RestorePause(UIStateVehicleSelected __instance, GeoAbility ability, ref bool __state) { try { if (!(ability is MoveVehicleAbility)) { return; } AfterAddTravelSite_RestorePause(__instance, ref __state); } catch (Exception ex) { Error(ex); } }
private static void AfterAddTravelSite_RestorePause(UIStateVehicleSelected __instance, ref bool __state) { try { var craft_count = GameUtl.CurrentLevel().GetComponent <GeoLevelController>().ViewerFaction.Vehicles.Count(); //Verbo( "Craft count = {0}", craft_count ); if ((craft_count <= 1 && Mod.Config.Auto_Unpause_Single) || (craft_count > 1 && Mod.Config.Auto_Unpause_Multiple)) { return; } Verbo("New vehicle travel plan. Setting time to {0}.", __state ? "Paused" : "Running"); getContext(__instance).Level.Timing.Paused = __state; } catch (Exception ex) { Error(ex); } }
private static GeoscapeViewContext getContext(UIStateVehicleSelected __instance) => (GeoscapeViewContext)ContextGetter.GetValue(__instance);