public StoryDialogBox(Size screenSize, SpriteFont font, bool gamePad) { _gamePad = gamePad; ScreenSize = screenSize; _font = font; StoryState = StoryState.Closed; }
public void Process(StoryState state) { Network.Messenger.SendPacket(PMDCP.Sockets.TcpPacket.CreatePacket("actonaction")); state.StoryPaused = true; state.Pause(); }
IEnumerator StayAndListenDialog() { //Bring up the black screen StartCoroutine(BlackScreenFadeIn(0.05f)); yield return(new WaitForSeconds(0.5f)); storyUI.SetActive(false); dialogBackground.SetActive(true); SetActiveVirtualCamera(1); StartCoroutine(BlackScreenFadeOut(0.005f)); yield return(new WaitForSeconds(0.05f)); yield return(new WaitForSeconds(1.0f)); // Bring up some noise/sound here storyText.text = "......"; storyUI.SetActive(true); backgroundNoise.Play(); mouseEventIndex = 50; _currState = StoryState.WaitForPlayerInput; // the length of it is according to the sound length //yield return new WaitForSeconds(2.0f); }
IEnumerator StayAndListenDialog2() { // Prepare to get out of the black scene storyUI.SetActive(false); StartCoroutine(BlackScreenFadeIn(0.005f)); yield return(new WaitForSeconds(0.05f)); dialogBackground.SetActive(false); workers.SetActive(false); StartCoroutine(BlackScreenFadeOut(0.05f)); yield return(new WaitForSeconds(0.5f)); // Dialog after the press conference yield return(new WaitForSeconds(1.0f)); storyText.text = "That was a pretty boring conference."; storyUI.SetActive(true); mouseEventIndex = 51; _currState = StoryState.WaitForPlayerInput; /* yield return new WaitForSeconds(2.0f); * yield return new WaitForSeconds(2.0f); * yield return new WaitForSeconds(2.0f); * optionUIBox1Text.text = "Leaving"; * optionUIBox2Text.text = "Sneaking"; * storyUI.SetActive(false); * optionUI.SetActive(true); * statusUI.SetActive(true); * _currState = StoryState.SecondChoice;*/ }
public void Process(StoryState state) { Menus.MenuSwitcher.ShowBlankMenu(); Components.SpokenTextMenu textMenu; IMenu menuToFind = Windows.WindowSwitcher.GameWindow.MenuManager.FindMenu("story-spokenTextMenu"); if (menuToFind != null) { textMenu = (Components.SpokenTextMenu)menuToFind; } else { textMenu = new Components.SpokenTextMenu("story-spokenTextMenu", Windows.WindowSwitcher.GameWindow.MapViewer.Size); } textMenu.DisplayText(StoryProcessor.ReplaceVariables(question), mugshot); Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(textMenu, true); Components.OptionSelectionMenu optionMenu = new Components.OptionSelectionMenu("story-optionSelectionMenu", Windows.WindowSwitcher.GameWindow.MapViewer.Size, options); optionMenu.OptionSelected += new Components.OptionSelectionMenu.OptionSelectedDelegate(optionMenu_OptionSelected); Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(optionMenu, true); Windows.WindowSwitcher.GameWindow.MenuManager.SetActiveMenu(optionMenu); Windows.WindowSwitcher.GameWindow.MenuManager.BlockInput = true; storyState = state; state.Pause(); optionMenu.OptionSelected -= new Components.OptionSelectionMenu.OptionSelectedDelegate(optionMenu_OptionSelected); Windows.WindowSwitcher.GameWindow.MenuManager.RemoveMenu(optionMenu); //if (state.NextSegment == null || !state.NextSegment.UsesSpeechMenu) { Windows.WindowSwitcher.GameWindow.MenuManager.RemoveMenu(textMenu); //} }
public void Process(StoryState state) { if (Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.StoryBackground != null) { Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.StoryBackground.Dispose(); } Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.StoryBackground = Logic.Graphics.SurfaceManager.LoadSurface(IO.Paths.StoryDataPath + "Backgrounds/" + file); }
public void LoadOptions() { if (_activeStory.CanContinue) { LoadDialogBox(); } else if (_activeStory.Choices.Count > 0) { var optionBoxes = new List <OptionTextBox>(); var choices = _activeStory.Choices; for (var i = 0; i < choices.Count; i++) { var option = new OptionTextBox(ScreenSize, _font, i, choices[i]); optionBoxes.Add(option); option.Show(); option.InteractEvent += (sender, args) => ChooseOption(option); } OptionTextBoxFactory.LineTextBoxes(optionBoxes, ScreenSize); _currentTextBox = new OptionTextBoxList(optionBoxes, _gamePad); StoryState = StoryState.Option; } else { EndDialog(); } }
public void Process(StoryState state) { state.ResetWaitEvent(); if (Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.StoryBackground != null) { Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.StoryBackground = null; } }
/// <summary> /// /// </summary> public void GoTo(string passageName) { if (this.State != StoryState.Idle) { throw new InvalidOperationException( // Paused this.State == StoryState.Paused ? "The story is currently paused. Resume() must be called before advancing to a different passage." : // Playing this.State == StoryState.Playing || this.State == StoryState.Exiting ? "The story can only be advanced when it is in the Idle state." : // Complete "The story is complete. Reset() must be called before it can be played again." ); } // Indicate specified passage as next _passageWaitingToEnter = passageName; if (CurrentPassageName != null) { this.State = StoryState.Exiting; // invoke exit cues CuesInvoke(CuesFind("Exit", reverse: true)); } if (this.State != StoryState.Paused) { Enter(passageName); } }
public void LoadDialogBox() { if (!_activeStory.Complete) { var storyText = _activeStory.CurrentText; var dialogBox = new DialogBox(ScreenSize, _font, storyText); dialogBox.InteractEvent += (sender, args) => { if (_activeStory.CanContinue) { _activeStory.Continue(); LoadDialogBox(); } else { LoadOptions(); } }; dialogBox.Show(); _currentTextBox = dialogBox; StoryState = StoryState.Dialog; } else { EndDialog(); } }
private void FirstMouseEvent() { storyUI.SetActive(false); SetUpFirstChoice(); optionUI.SetActive(true); statusUI.SetActive(true); _currState = StoryState.FirstChoice; }
public StoryStateWrapper(StoryState state) { cPath = state.currentPathString; if (cPath == null && state.currentChoices.Count > 0) { cPath = state.currentChoices[0].targetPath.ToString(); } }
public void Prepare(InputManager im) { inputManager = im; batterManager = inputManager.GetComponent <BattleManager> (); sceneManager = inputManager.GetComponent <SceneManager> (); mainCamera = GameObject.Find("Main Camera"); story = StoryState.fadein; }
public void Process(StoryState state) { this.storyState = state; for (int i = state.FNPCs.Count - 1; i >= 0; i--) { if (state.FNPCs[i].ID == id) { state.FNPCs.RemoveAt(i); } } }
public Caravan() { this.pawns = new ThingOwner <Pawn>(this, false, LookMode.Reference); this.pather = new Caravan_PathFollower(this); this.gotoMote = new Caravan_GotoMoteRenderer(); this.tweener = new Caravan_Tweener(this); this.trader = new Caravan_TraderTracker(this); this.storyState = new StoryState(this); }
public Alliance(string name, Faction faction, AllianceGoalDef goal) { Name = name; FactionOwner = faction; AllianceGoalDef = goal; storyState = new StoryState(this); InitializeStorytellerComps(); }
public void Process(StoryState state) { this.storyState = state; state.ResetWaitEvent(); Components.ScreenImageOverlay imageOverlay = new Components.ScreenImageOverlay(file, imageID, x, y); imageOverlay.LoadImage(); Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.ScreenImageOverlays.Add(imageOverlay); }
void Story_OnStateChanged(StoryState state) { if (!state.In(StoryState.Idle, StoryState.Paused)) { return; } RefreshText(); }
/// <summary> /// Setup and run the story using the parents cancellationTokenSource & refreshRate /// </summary> /// <returns></returns> public void Start(CancellationTokenSource cancellationTokenSource, RefreshRate refreshRate) { RefreshRate = refreshRate; StepCount = (int)Duration.TotalMilliseconds / (int)RefreshRate; CancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationTokenSource.Token); Setup(); State = StoryState.Running; OnStarted?.Invoke(this, EventArgs.Empty); Begin(); }
/// <summary> /// While the story is playing, pauses the execution of the current story thread. /// </summary> public void Pause() { if (this.State != StoryState.Playing && this.State != StoryState.Exiting) { throw new InvalidOperationException("Pause can only be called while a passage is playing or exiting."); } this.State = StoryState.Paused; _timeAccumulated = Time.time - _timeChangedToPlay; }
private void Awake() { Instance = this; storyState = StoryState.BeforeFirstTap; // Set up the camera correctly if (mainCamera == null) { mainCamera = Camera.main; } }
public static StoryCard Create(string title, string description, StoryState storyState) { return new StoryCard { Id = 1, Title = title, Description = description, State = storyState }; }
IEnumerator WaitForCamMoveAndPrintText(float cameraMoveTime) { SetActiveVirtualCamera(1); //DirectorCam.GetComponent<PlayableDirector>().Play(); yield return(new WaitForSeconds(cameraMoveTime)); storyText.fontStyle = FontStyle.Normal; storyText.text = story[nextLine++].ToString(); //yield return new WaitForSeconds(autoNextLineTime); _currState = StoryState.WaitForPlayerInput; }
private void Start() { mouseEventIndex = 0; GenerateStoryBlock1(); storyUI.SetActive(true); statusUI.SetActive(false); optionUI.SetActive(false); storyText.fontStyle = FontStyle.BoldAndItalic; storyText.text = story[nextLine++].ToString(); _currState = StoryState.WaitForPlayerInput; }
public void Process(StoryState state) { this.storyState = state; for (int i = 0; i < state.FNPCs.Count; i++) { if (state.FNPCs[i].ID == id) { state.FNPCs[i].Direction = direction; } } }
IEnumerator SneakingFirstToActualPress() { StartCoroutine(BlackScreenFadeIn(0.05f)); yield return(new WaitForSeconds(0.5f)); //backgroundNoise.Stop(); //sunLight.GetComponent<Light>().color = new Color(0.97f, 0.8f, 0.3f, 1.0f); sunLight.transform.rotation = new Quaternion(0.83256495f, -0.255243957f, -0.0428712703f, 0.489742935f); _currState = StoryState.DialogBeforeSecondChoice; StartCoroutine(StayAndListenDialog2()); }
public void Process(StoryState state) { storyState = state; for (int i = state.FNPCs.Count - 1; i >= 0; i--) { if (state.FNPCs[i].ID == id) { state.FNPCs.RemoveAt(i); } } }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; } else { Debug.LogError("We have a situation here " + StoryState.instance.gameObject.name + " and " + gameObject.name); } }
public static Story By(int id, StoryState state) { Story value = By(id); if(value != null && value.State == state) { return value; } return null; }
protected void Init() { _state = StoryState.Idle; this.Output = new List <StoryOutput>(); NumberOfLinksDone = 0; PassageHistory.Clear(); InsertStack.Clear(); CurrentPassage = null; }
public StoryStateWrapper(StoryState state) { cPath = state.currentPathString; if (cPath == null && state.currentChoices.Count > 0) { cPath = state.currentChoices[0].targetPath.ToString(); } if (cPath == null) // Again! Means that this is END/DONE { cPath = state.previousPointer.path.ToString(); } }
public void Process(StoryState state) { storyState = state; for (int i = 0; i < state.FNPCs.Count; i++) { if (state.FNPCs[i].ID == id) { state.FNPCs[i].X = x; state.FNPCs[i].Y = y; } } }
public void Process(StoryState state) { int index = -1; for (int i = 0; i < Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.ScreenImageOverlays.Count; i++) { if (Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.ScreenImageOverlays[i].ImageID == imageID) { index = i; break; } } if (index > -1) { Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.ScreenImageOverlays.RemoveAt(index); } }
public void TriggerUnderwater() { state = StoryState.Underwater; RenderSettings.skybox = underwaterSkybox; RenderSettings.fogColor = underwaterFogColor; RenderSettings.fogDensity = underwaterFogDensity; StartCoroutine( FadeInVolume( underwaterSFX ) ); StartCoroutine( FadeOutVolume( shipSFX ) ); StartCoroutine( FadeOutVolume( forestSFX ) ); StartCoroutine( FadeFog( underwaterFogColor, underwaterFogDensity ) ); }
public void TriggerForest() { state = StoryState.Forest; StartCoroutine( ForestTransition() ); }
public void Process(StoryState state) { state.ResetWaitEvent(); Music.Music.AudioPlayer.StopMusic(); }
public void Process(StoryState state) { Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.ScreenVisible = this.visible; }
public static IEnumerable<Story> In(StoryState state) { return All() .Where(s => s.State == state); }
public void Process(StoryState state) { this.storyState = state; this.storyState.CurrentSegment = segment - 1; }
public void Process(StoryState state) { this.storyState = state; FNPCs.FNPC fnpc = new FNPCs.FNPC(); fnpc.MapID = parentMapID; fnpc.X = x; fnpc.Y = y; fnpc.Sprite = sprite; fnpc.Form = form; fnpc.Shiny = shiny; fnpc.Sex = gender; fnpc.ID = id; state.FNPCs.Add(fnpc); }
public void Process(StoryState state) { Menus.MenuSwitcher.ShowBlankMenu(); Components.SpokenTextMenu textMenu; IMenu menuToFind = Windows.WindowSwitcher.GameWindow.MenuManager.FindMenu("story-spokenTextMenu"); if (menuToFind != null) { textMenu = (Components.SpokenTextMenu)menuToFind; } else { textMenu = new Components.SpokenTextMenu("story-spokenTextMenu", Windows.WindowSwitcher.GameWindow.MapViewer.Size); } textMenu.DisplayText(StoryProcessor.ReplaceVariables(question), mugshot); Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(textMenu, true); Components.OptionSelectionMenu optionMenu = new Components.OptionSelectionMenu("story-optionSelectionMenu", Windows.WindowSwitcher.GameWindow.MapViewer.Size, this.options); optionMenu.OptionSelected += new Components.OptionSelectionMenu.OptionSelectedDelegate(optionMenu_OptionSelected); Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(optionMenu, true); Windows.WindowSwitcher.GameWindow.MenuManager.SetActiveMenu(optionMenu); Windows.WindowSwitcher.GameWindow.MenuManager.BlockInput = true; this.storyState = state; state.Pause(); optionMenu.OptionSelected -= new Components.OptionSelectionMenu.OptionSelectedDelegate(optionMenu_OptionSelected); Windows.WindowSwitcher.GameWindow.MenuManager.RemoveMenu(optionMenu); //if (state.NextSegment == null || !state.NextSegment.UsesSpeechMenu) { Windows.WindowSwitcher.GameWindow.MenuManager.RemoveMenu(textMenu); //} }
public void Process(StoryState state) { Network.Messenger.SendPacket(PMDCP.Sockets.TcpPacket.CreatePacket("actonaction")); }
public void Process(StoryState state) { Logic.Graphics.Renderers.Screen.ScreenRenderer.RenderOptions.PlayersVisible = false; }
public void Process(StoryState state) { switch (this.state) { case Enums.PadlockState.Lock: { Players.PlayerManager.MyPlayer.MovementLocked = true; } break; case Enums.PadlockState.Unlock: { Players.PlayerManager.MyPlayer.MovementLocked = false; } break; } }
public void Process(StoryState state) { this.storyState = state; string fileToPlay = null; if (file == "%mapmusic%") { fileToPlay = Maps.MapHelper.ActiveMap.Music; } else { fileToPlay = file; } if (!string.IsNullOrEmpty(fileToPlay)) { Music.Music.AudioPlayer.PlayMusic(fileToPlay, this.loop ? -1 : 1, !honorSettings, true); } }
public void Process(StoryState state) { Menus.MenuSwitcher.ShowBlankMenu(); Components.SpokenTextMenu textMenu; IMenu menuToFind = Windows.WindowSwitcher.GameWindow.MenuManager.FindMenu("story-spokenTextMenu"); if (menuToFind != null) { textMenu = (Components.SpokenTextMenu)menuToFind; } else { textMenu = new Components.SpokenTextMenu("story-spokenTextMenu", Windows.WindowSwitcher.GameWindow.MapViewer.Size); } textMenu.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(textMenu_Click); textMenu.KeyDown += new EventHandler<SdlDotNet.Input.KeyboardEventArgs>(textMenu_KeyDown); textMenu.DisplayText(StoryProcessor.ReplaceVariables(text), speaker); Windows.WindowSwitcher.GameWindow.MenuManager.AddMenu(textMenu, true); Windows.WindowSwitcher.GameWindow.MenuManager.BlockInput = false; this.storyState = state; if (Windows.WindowSwitcher.GameWindow.BattleLog.Visible) { Windows.WindowSwitcher.GameWindow.BattleLog.Hide(); } state.Pause(); textMenu.Click -= new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(textMenu_Click); textMenu.KeyDown -= new EventHandler<SdlDotNet.Input.KeyboardEventArgs>(textMenu_KeyDown); if (state.NextSegment == null || !state.NextSegment.UsesSpeechMenu) { Windows.WindowSwitcher.GameWindow.MenuManager.RemoveMenu(textMenu); } }
public void Process(StoryState state) { Network.Messenger.SendPacket(PMU.Sockets.TcpPacket.CreatePacket("actonaction")); state.StoryPaused = true; state.Pause(); }
public void Process(StoryState state) { this.storyState = state; for (int i = 0; i < state.FNPCs.Count; i++) { if (state.FNPCs[i].ID == id) { state.FNPCs[i].TargetX = x; state.FNPCs[i].TargetY = y; } } if (this.pause) { state.StoryPaused = true; state.Pause(); state.StoryPaused = false; } }
public void Process(StoryState state) { this.storyState = state; Players.PlayerManager.MyPlayer.Direction = direction; Network.Messenger.SendPlayerDir(); }
public void Process(StoryState state) { this.storyState = state; Players.MyPlayer myPlayer = Players.PlayerManager.MyPlayer; myPlayer.TargetX = x; myPlayer.TargetY = y; myPlayer.StoryMovementSpeed = (Enums.MovementSpeed)speed; if (this.pause) { state.StoryPaused = true; state.Pause(); state.StoryPaused = false; } }
public void TriggerSurface() { state = StoryState.Surface; StartCoroutine(SurfaceTransition()); }
public void Process(StoryState state) { state.Pause(length); }
public void Process(StoryState state) { this.storyState = state; for (int i = 0; i < state.FNPCs.Count; i++) { if (state.FNPCs[i].ID == id) { state.FNPCs[i].X = x; state.FNPCs[i].Y = y; } } }