public override void callNode() { GameObject bubble = Instantiate(speechBubblePrefab, cutsceneManager.gameManager.uiParent); Typewriter writer = bubble.GetComponent <Typewriter>(); writer.talkSound = talkSound; writer.skipSound = skipSound; writer.OnPageFinished += pageFinished; writer.bubbleImage.color = bubbleTint; writer.textComponent.color = textTint; writer.startWriting(questionText); }
void Update() { if (running) { if (currentTypewriter == null) { if (currentSentence < sentences.Length) { currentTypewriter = Instantiate(typewriterPrefab, canvas).GetComponent <Typewriter>(); sentence = sentences[currentSentence++]; currentTypewriter.Setup(sentence.text, sentence.Speed, sentence.MaxPitch, sentence.MinPitch, sentence.Voice); } else { running = false; SystemsController.RunningDialogue(running); if (currentDialogue.OnEndDialogue != null) { currentDialogue.OnEndDialogue.Invoke(); } } } else { if (sentence.origin != null) { currentTypewriter.transform.position = cam.WorldToScreenPoint(sentence.origin.position); } else { // system message } if (currentTypewriter.Done) { if (Input.GetMouseButtonDown(0)) { Destroy(currentTypewriter.gameObject); currentTypewriter = null; } } else { if (Input.GetMouseButtonDown(0)) { currentTypewriter.JumpToEnd(); } } } } }
IEnumerator waitForBlockAnimation() { animator.SetTrigger("Hit"); yield return(new WaitForSeconds(textDelay)); GameObject bubble = Instantiate(speechBubble, uiParent); Typewriter writer = bubble.GetComponent <Typewriter>(); writer.talkSound = talkSound; writer.skipSound = skipSound; writer.textComponent.color = textTint; writer.OnPageFinished += pageFinished; writer.startWriting(genText); currentBubble = bubble; blockAnimPlaying = false; }
private void yesSelected(PopupMenuOption option) { bool success = backpack.saveData(); GameObject bubble = Instantiate(speechBubble, uiParent); Typewriter writer = bubble.GetComponent <Typewriter>(); writer.OnBubbleClosed += resultBubbleClose; if (success) { writer.startWriting(saveText); } else { writer.startWriting(errorText); } }
public override IEnumerator PlayInternal(CinematicDirector player) { Typewriter target = player.objectMap.GetObjectByName(mTarget).GetComponent <Typewriter>(); if (!mWaitForInteraction) { yield return(target.ShowTextCoroutine(mText, 1f)); } else { target.ShowText(mText, 1f); // Provide a little lag time yield return(new WaitForSeconds(0.25f)); bool keepWaiting = true; BasicActionSet actionSet = Game.instance.actionSet; while (keepWaiting) { if (target.isAnimating) { if (actionSet.Activate.WasPressed || actionSet.Spell.WasPressed) { target.ForceFinish(); } } else { if (actionSet.Activate.WasPressed || actionSet.Spell.WasPressed) { keepWaiting = false; if (!mKeepOpen) { target.HideText(); } } } yield return(null); } } yield break; }
private void YesSelected(PopupMenuOption option) { gameManager.GetBackpack().playerSpawnPosition.Value = player.transform.position + new Vector3(0, 0.1f, 0); bool success = SaveManager.SaveContainers("save.spdat"); GameObject bubble = Instantiate(speechBubble, uiParent); Typewriter writer = bubble.GetComponent <Typewriter>(); writer.OnBubbleClosed += ResultBubbleClose; if (success) { writer.StartWriting(saveText); } else { writer.StartWriting(errorText); } }
public override void Interact(GameObject playerObject) { base.Interact(playerObject); if (currentBubble == null) { player = playerObject.GetComponent <PlayerMachine>(); GameObject bubble = Instantiate(speechBubble, player.gameManager.uiParent); Typewriter writer = bubble.GetComponent <Typewriter>(); writer.talkSound = talkSound; writer.skipSound = skipSound; writer.OnPageFinished += PageFinished; writer.OnBubbleClosed += BubbleClosed; writer.bubbleImage.color = bubbleTint; writer.textComponent.color = textTint; writer.StartWriting(text); currentBubble = bubble; player.SetCutsceneMode(true); } }
private void ProcessTypingInput() { //iterate through the alphabet for (int i = 44; i <= 69; i++) { if (Keyboard.IsKeyDown((Key)i)) { Typewriter.AddLetter((Key)i); } } if (Keyboard.IsKeyDown(Key.Back)) { Typewriter.DeleteLastLetter(); } if (Keyboard.IsKeyDown(Key.Space)) { Typewriter.AddSpace(); } }
protected override void Load() { Title = "Thn Player"; LibreLancer.Shaders.AllShaders.Compile(); guiHelper = new ImGuiHelper(this, DpiScale); FileDialog.RegisterParent(this); RenderContext.PushViewport(0, 0, 800, 600); Billboards = new Billboards(); Nebulae = new NebulaVertices(); Resources = new GameResourceManager(this); Audio = new AudioManager(this); Sounds = new SoundManager(Audio, this); Services.Add(Sounds); Services.Add(Billboards); Services.Add(Nebulae); Services.Add(Resources); fontMan = new FontManager(); fontMan.ConstructDefaultFonts(); Services.Add(fontMan); Services.Add(new GameConfig()); Typewriter = new Typewriter(this); Services.Add(Typewriter); Keyboard.KeyDown += KeyboardOnKeyDown; }
public void Start() { typewriter = GetComponent <Typewriter>() ?? GetComponentInChildren <Typewriter>(); originalCharactersPerSecond = typewriter.charactersPerSecond; }
protected override void Load() { Thread.CurrentThread.Name = "FreelancerGame UIThread"; //Move to stop _TSGetMainThread error on OSX MinimumWindowSize = new Point(640, 480); SetVSync(Config.VSync); new IdentityCamera(this); uithread = Thread.CurrentThread.ManagedThreadId; useintromovies = _cfg.IntroMovies; FLLog.Info("Platform", Platform.RunningOS.ToString() + (IntPtr.Size == 4 ? " 32-bit" : " 64-bit")); FLLog.Info("Available Threads", Environment.ProcessorCount.ToString()); //Cache ResourceManager = new GameResourceManager(this); //Init Audio FLLog.Info("Audio", "Initialising Audio"); Audio = new AudioManager(this); Audio.MasterVolume = _cfg.MasterVolume; Audio.Music.Volume = _cfg.MusicVolume; //Load data FLLog.Info("Game", "Loading game data"); GameData = new GameDataManager(_cfg.FreelancerPath, ResourceManager); IntroMovies = GameData.GetIntroMovies(); MpvOverride = _cfg.MpvOverride; Thread GameDataLoaderThread = new Thread(() => { GameData.LoadData(); Sound = new SoundManager(GameData, Audio); Services.Add(Sound); FLLog.Info("Game", "Finished loading game data"); InitialLoadComplete = true; }); GameDataLoaderThread.Name = "GamedataLoader"; GameDataLoaderThread.Start(); // Renderer2D = new Renderer2D(RenderState); Fonts = new FontManager(); Billboards = new Billboards(); Nebulae = new NebulaVertices(); ViewportManager = new ViewportManager(RenderState); ViewportManager.Push(0, 0, Width, Height); Screenshots = new ScreenshotManager(this); Typewriter = new Typewriter(this); Services.Add(Billboards); Services.Add(Nebulae); Services.Add(ResourceManager); Services.Add(Renderer2D); Services.Add(Config); Services.Add(Fonts); Services.Add(GameData); Services.Add(Sound); Services.Add(Typewriter); if (useintromovies && IntroMovies.Count > 0) { ChangeState(new IntroMovie(this, 0)); } else { ChangeState(new LoadingDataState(this)); } }
// Use this for initialization void Start() { _animator = GetComponent <Animator>(); _typewriter = GetComponent <Typewriter>(); _animator.SetBool("Play", play); }
// Use this for initialization void Start() { _animator = GetComponent <Animator>(); _typewriter = GetComponent <Typewriter>(); }
// Use this for initialization void Start() { typewriter = (Typewriter)gameObject.GetComponent(typeof(Typewriter)); }
private void LoadNextLevel() { // Move to the next level levelIndex = (levelIndex + 1) % numberOfLevels; //Level.LoadFromSubLevel = false; --> might need to put this back in // Unloads the content for the current level before loading the next one. if (level != null) level.Dispose(); // Load the level. string levelPath = string.Format("Content/Levels/{0}.txt", levelIndex); using (Stream fileStream = TitleContainer.OpenStream(levelPath)) level = new Level(Services, fileStream, levelIndex); LoadCrossHair(); // Credit typewriter for last level if (levelIndex == 13) typewriter = new Typewriter(this); }
// Loads a specified level public void LoadLevel(int index) { // Unloads the content for the current level before loading the next one. if (level != null) level.Dispose(); if (index < -1) ReloadCurrentLevel(); else { levelIndex = index; string levelPath = "Content/Levels/" + levelIndex.ToString() + ".txt"; using (Stream fileStream = TitleContainer.OpenStream(levelPath)) level = new Level(Services, fileStream, levelIndex); } Level.LoadMainWorldFromLevel = true; LoadCrossHair(); // Credit typewriter for last level if (index == 13) typewriter = new Typewriter(this); }
protected IEnumerator Stall(Typewriter p) { while (p.typing || p.fading) yield return new WaitForSeconds(0.1f); }
// Use this for initialization void Start() { typewriter = (Typewriter)gameObject.GetComponent(typeof(Typewriter)); dialog = txml.getDialogFromXML(name); }
void Awake() { uitext = GetComponent <Typewriter>(); StartCoroutine(_Speak()); }
static void Main(string[] args) { Assembly assembly = Assembly.GetExecutingAssembly(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); string version = fvi.FileVersion; Console.Title = $"GetBootstrap v{version}"; Bootstrap.Logger = Logger.GetLogger("GetBootstrap"); Bootstrap.Write("DEVELOPER:", BootstrapType.Info, BootsrapStyle.Alert); Bootstrap.Write(" Leonel Sarmiento - "); Bootstrap.WriteLine("*****@*****.**", BootstrapType.Success); Bootstrap.Write("BOOTSTRAP:", BootstrapType.Magenta, BootsrapStyle.Alert); Bootstrap.WriteLine($" Build {Assembly.GetEntryAssembly().GetName().Version}"); Bootstrap.Write("BOOTSTRAP:", BootstrapType.Magenta, BootsrapStyle.Alert); Bootstrap.WriteLine($" Release {version}"); Console.ReadKey(); Bootstrap.WriteLine("Customize Progress Bar", type: BootstrapType.Info); ProgressBar pb = new ProgressBar(Enum.GetNames(typeof(BootstrapType)).Length * 3); pb.Width = 50; pb.DrawProgressBar(); ProgressBar pb1 = new ProgressBar(Enum.GetNames(typeof(BootstrapType)).Length * 2); pb1.ProgressColor = ConsoleColor.DarkBlue; pb1.Width = 75; pb1.DrawProgressBar(); ProgressBar pb2 = new ProgressBar(Enum.GetNames(typeof(BootstrapType)).Length * 1); pb2.ProgressColor = ConsoleColor.DarkMagenta; pb2.Width = 100; pb2.DrawProgressBar(); Bootstrap.WriteLine("Adjustable Typewriter Speed", type: BootstrapType.Info); foreach (var name in Enum.GetNames(typeof(BootstrapType))) { pb.Increment(); pb1.Increment(); pb2.Increment(); Typewriter.WriteLine($"{name}", style: BootsrapStyle.Alert, type: (BootstrapType)Enum.Parse(typeof(BootstrapType), name), fill: true); } Bootstrap.WriteLine("Light and Dark Themes", type: BootstrapType.Info); foreach (var name in Enum.GetNames(typeof(BootstrapType))) { pb.Increment(); pb1.Increment(); Typewriter.Write($"{name}", style: BootsrapStyle.Alert, type: (BootstrapType)Enum.Parse(typeof(BootstrapType), name), fill: true); } Console.WriteLine(); foreach (var name in Enum.GetNames(typeof(BootstrapType))) { pb.Increment(); Bootstrap.Write($"{name}", type: (BootstrapType)Enum.Parse(typeof(BootstrapType), name)); } Console.ReadLine(); }