public void CloseScroll(string key) { if (this.GameState.ActiveScroll == null) { return; } if (string.IsNullOrEmpty(key)) { this.GameState.ActiveScroll.Close(); this.GameState.ActiveScroll.NextScroll = (TextScroll)null; } else if (this.GameState.ActiveScroll.Key == key) { this.GameState.ActiveScroll.Close(); } else { TextScroll textScroll = this.GameState.ActiveScroll; for (TextScroll nextScroll = textScroll.NextScroll; nextScroll != null; nextScroll = nextScroll.NextScroll) { if (nextScroll.Key == key) { textScroll.NextScroll = nextScroll.NextScroll; break; } else { textScroll = nextScroll; } } } }
private void CloseScroll(TextScroll scroll) { if (this.GameState.ActiveScroll == null) { return; } if (this.GameState.ActiveScroll == scroll) { this.GameState.ActiveScroll.Close(); } else { TextScroll textScroll = this.GameState.ActiveScroll; for (TextScroll nextScroll = textScroll.NextScroll; nextScroll != null; nextScroll = nextScroll.NextScroll) { if (nextScroll == scroll) { textScroll.NextScroll = nextScroll.NextScroll; break; } else { textScroll = nextScroll; } } } }
public override void Update(GameTime gameTime) { if (this.GameState.Loading || this.GameState.Paused) { return; } if (!this.Ready) { this.LateLoadContent(); } this.ScrollMesh.Scale = new Vector3(96f / (float)this.GraphicsDevice.Viewport.Width, 96f / (float)this.GraphicsDevice.Viewport.Height, 1f) * SettingsManager.GetViewScale(this.GraphicsDevice); this.TextGroup.Scale = !Culture.IsCJK ? new Vector3(1f / SettingsManager.GetViewScale(this.GraphicsDevice)) : new Vector3(1f / SettingsManager.GetViewScale(this.GraphicsDevice)) / 2f; this.ScrollMesh.Position = new Vector3(0.01f, this.OnTop ? 0.6125f : -0.6125f, 0.0f); if (this.Timeout.HasValue) { TextScroll textScroll = this; float? timeout = textScroll.Timeout; float num = (float)gameTime.ElapsedGameTime.TotalSeconds; float? nullable = timeout.HasValue ? new float?(timeout.GetValueOrDefault() - num) : new float?(); textScroll.Timeout = nullable; if ((double)this.Timeout.Value <= 0.0) { SoundEffectExtensions.Emit(this.sClose); this.Closing = true; this.Timeout = new float?(); this.SinceClose = TimeSpan.Zero; } } if (this.SinceOpen.TotalSeconds < 0.5) { this.SinceOpen += gameTime.ElapsedGameTime; this.OpenOrClose(Easing.EaseInOut(this.SinceOpen.TotalSeconds / 0.5, EasingType.Cubic, EasingType.Sine)); } else { if (!this.Closing) { return; } this.SinceClose += gameTime.ElapsedGameTime; this.OpenOrClose(Easing.EaseInOut(1.0 - this.SinceClose.TotalSeconds / 0.5, EasingType.Cubic, EasingType.Sine)); if (this.SinceClose.TotalSeconds <= 0.5) { return; } ServiceHelper.RemoveComponent <TextScroll>(this); } }
public override void Initialize() { base.Initialize(); SharedContentManager.Preload(); Logger.Log("StaticPreloader", "SharedContentManager preloaded."); this.SoundManager.InitializeLibrary(); Logger.Log("StaticPreloader", "Music library initialized."); this.SoundManager.ReloadVolumeLevels(); Logger.Log("StaticPreloader", "Volume levels loaded."); this.PlayerManager.FillAnimations(); Logger.Log("StaticPreloader", "Animations filled."); TextScroll.PreInitialize(); Logger.Log("StaticPreloader", "Text scroll pre-initialized."); WorldMap.PreInitialize(); Logger.Log("StaticPreloader", "World map pre-initialized."); PauseMenu.PreInitialize(); Logger.Log("StaticPreloader", "Pause menu pre-initialized."); }
public LongRunningAction ShowScroll(string localizedString, float forSeconds, bool onTop, bool onVolume) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type TrialAndAwards.\u003C\u003Ec__DisplayClass19 cDisplayClass19 = new TrialAndAwards.\u003C\u003Ec__DisplayClass19(); // ISSUE: reference to a compiler-generated field cDisplayClass19.localizedString = localizedString; // ISSUE: reference to a compiler-generated field cDisplayClass19.\u003C\u003E4__this = this; if (this.GameState.ActiveScroll != null) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type TrialAndAwards.\u003C\u003Ec__DisplayClass1b cDisplayClass1b = new TrialAndAwards.\u003C\u003Ec__DisplayClass1b(); // ISSUE: reference to a compiler-generated field cDisplayClass1b.CS\u0024\u003C\u003E8__locals1a = cDisplayClass19; TextScroll textScroll = this.GameState.ActiveScroll; while (textScroll.NextScroll != null) { textScroll = textScroll.NextScroll; } // ISSUE: reference to a compiler-generated field if (textScroll.Key == cDisplayClass19.localizedString && !textScroll.Closing) { return((LongRunningAction)null); } textScroll.Closing = true; textScroll.Timeout = new float?(); // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field cDisplayClass1b.nextScroll = new TextScroll(this.Game, GameText.GetString(cDisplayClass19.localizedString), onTop) { Key = cDisplayClass19.localizedString }; if ((double)forSeconds > 0.0) { // ISSUE: reference to a compiler-generated field cDisplayClass1b.nextScroll.Timeout = new float?(forSeconds); } // ISSUE: reference to a compiler-generated field this.GameState.ActiveScroll.NextScroll = cDisplayClass1b.nextScroll; if (onVolume) { // ISSUE: reference to a compiler-generated method return(new LongRunningAction(new Action(cDisplayClass1b.\u003CShowScroll\u003Eb__17))); } else { return((LongRunningAction)null); } } else { // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field ServiceHelper.AddComponent((IGameComponent)(this.GameState.ActiveScroll = new TextScroll(this.Game, GameText.GetString(cDisplayClass19.localizedString), onTop) { Key = cDisplayClass19.localizedString })); if ((double)forSeconds > 0.0) { this.GameState.ActiveScroll.Timeout = new float?(forSeconds); } if (onVolume) { // ISSUE: reference to a compiler-generated method return(new LongRunningAction(new Action(cDisplayClass19.\u003CShowScroll\u003Eb__18))); } else { return((LongRunningAction)null); } } }
private void CloseScroll(TextScroll scroll) { if (this.GameState.ActiveScroll == null) return; if (this.GameState.ActiveScroll == scroll) { this.GameState.ActiveScroll.Close(); } else { TextScroll textScroll = this.GameState.ActiveScroll; for (TextScroll nextScroll = textScroll.NextScroll; nextScroll != null; nextScroll = nextScroll.NextScroll) { if (nextScroll == scroll) { textScroll.NextScroll = nextScroll.NextScroll; break; } else textScroll = nextScroll; } } }
public void ShowScroll(string actualString, float forSeconds, bool onTop) { if (this.ActiveScroll != null) { TextScroll textScroll1 = this.ActiveScroll; while (textScroll1.NextScroll != null) textScroll1 = textScroll1.NextScroll; if (textScroll1.Key == actualString && !textScroll1.Closing) return; textScroll1.Closing = true; textScroll1.Timeout = new float?(); TextScroll textScroll2 = new TextScroll(ServiceHelper.Game, actualString, onTop) { Key = actualString }; if ((double) forSeconds > 0.0) textScroll2.Timeout = new float?(forSeconds); this.ActiveScroll.NextScroll = textScroll2; } else { ServiceHelper.AddComponent((IGameComponent) (this.ActiveScroll = new TextScroll(ServiceHelper.Game, actualString, onTop) { Key = actualString })); if ((double) forSeconds <= 0.0) return; this.ActiveScroll.Timeout = new float?(forSeconds); } }