protected MenuButtonWidget(MenuButtonWidget other) : base(other) { MenuContainer = other.MenuContainer; Pause = other.Pause; HideIngameUI = other.HideIngameUI; }
void OpenMenuPanel(MenuButtonWidget button, WidgetArgs widgetArgs = null) { disableSystemButtons = true; var cachedPause = world.PredictedPaused; if (button.HideIngameUI) worldRoot.IsVisible = () => false; if (button.Pause && world.LobbyInfo.IsSinglePlayer) world.SetPauseState(true); widgetArgs = widgetArgs ?? new WidgetArgs(); widgetArgs.Add("onExit", () => { if (button.HideIngameUI) worldRoot.IsVisible = () => true; if (button.Pause && world.LobbyInfo.IsSinglePlayer) world.SetPauseState(cachedPause); menuRoot.RemoveChild(currentWidget); disableSystemButtons = false; }); currentWidget = Game.LoadWidget(world, button.MenuContainer, menuRoot, widgetArgs); }