public void RecalculateHudVisibility() { HUD hUD = Service.Get <UXController>().HUD; if (!hUD.ReadyToToggleVisiblity) { return; } bool flag = true; for (int i = this.screens.Count - 1; i >= 0; i--) { ScreenBase screenBase = this.screens[i].Screen as ScreenBase; if (screenBase != null) { if (!screenBase.IsClosing) { flag = UXUtils.ShouldShowHudBehindScreen(screenBase.AssetName); if (!flag) { break; } } else { flag = !UXUtils.ShouldHideHudAfterClosingScreen(screenBase.AssetName); if (!flag) { break; } } } } if (hUD.Visible != flag) { hUD.Visible = flag; } }