public static GameDialogHelperCharaController GetGameDialogHelperController(this SaveData.CharaData charaData) { GameDialogHelperCharaController controller = null; charaData.SafeProc(cd => cd.chaCtrl.SafeProcObject(cc => controller = cc.GetGameDialogHelperController())); return(controller); }
internal static void DoReset() { GameDialogHelperGameController.DoReset(); GameDialogHelperCharaController.DoReset(); Instance.OnReset(); }
public static GameDialogHelperCharaController GetGameDialogHelperController(this SaveData.Player player) { GameDialogHelperCharaController controller = null; player.SafeProc(h => h.chaCtrl.SafeProcObject(cc => controller = cc.GetGameDialogHelperController())); return(controller); }
private static void PersistAllToCards(bool isSaving = false) { for (var i = 0; i < Game.Instance.HeroineList.Count; i++) { GameDialogHelperCharaController controller = null; Game.Instance.HeroineList.SafeProc(i, h => controller = h.GetGameDialogHelperController()); if (controller == null) { continue; } if (!isSaving && controller.DialogMemory.LastUpdated < controller.LastPersistedToCard) { continue; } controller.PersistToCard(); } // don't change CurrentSaveGuid until after all heroine's have been persisted or they'll all be invalidated if (isSaving && GameDialogHelper.Instance.CurrentSaveGuid == Guid.Empty) { GameDialogHelper.Instance.CurrentSaveGuid = Guid.NewGuid(); Logger?.LogDebug( $"new save guid: {GameDialogHelper.Instance.CurrentSaveGuid}"); UpdateSaveGuidOnControllers(); } Game.Instance.Player.chaCtrl.GetGameDialogHelperController().SafeProc(c => c.PersistToCard()); }
public static GameDialogHelperCharaController GetGameDialogHelperController(this ChaControl chaControl) { GameDialogHelperCharaController controller = null; chaControl.SafeProcObject(cc => cc.gameObject.SafeProcObject(go => controller = go.GetComponent <GameDialogHelperCharaController>())); return(controller); }