private void Open() { if (this.isOpened) { return; } this.isOpened = true; this.UpdateLayout(); this.storyboardFadeIn?.Begin(this); Menu.CloseAll(); // ReSharper disable once CanExtractXamlLocalizableStringCSharp inputContext = ClientInputContext.Start("Respawn menu - intercept all other input") .HandleAll( () => { if (ClientInputManager.IsButtonDown(GameButton.CancelOrClose)) { MainMenuOverlay.Toggle(); } ClientInputManager.ConsumeAllButtons(); }); }
public static void Open() { if (!isClosed) { return; } isClosed = false; var menu = new MenuCharacterCreation(); instance = menu; Api.Client.UI.LayoutRootChildren.Add(instance); Menu.CloseAll(); // ReSharper disable once CanExtractXamlLocalizableStringCSharp inputContext = ClientInputContext.Start("Character creation menu - intercept all other input") .HandleAll( () => { if (ClientInputManager.IsButtonDown(GameButton.CancelOrClose)) { MainMenuOverlay.Toggle(); } ClientInputManager.ConsumeAllButtons(); }); }
private void InputCallback() { var keyDown = Client.Input .GetAllKeysDown(evenIfHandled: true) .FirstOrDefault(); if (keyDown != InputKey.None) { this.HandleKeyDown(keyDown); } ClientInputManager.ConsumeAllButtons(); }
protected override void WindowOpening() { this.suppressInputContext = ClientInputContext .Start("Window items browser - intercept all other input") .HandleAll(() => { if (ClientInputManager.IsButtonDown(GameButton.CancelOrClose)) { this.CloseWindow(); } ClientInputManager.ConsumeAllButtons(); }); this.DataContext = this.viewModel = new ViewModelWindowEditorItemsBrowser( closeCallback: () => this.CloseWindow()); }
public ViewModelFeaturesSlideshow() { this.inputContext = ClientInputContext .Start(nameof(ViewModelFeaturesSlideshow)) .HandleAll( () => { if (ClientInputManager.IsButtonDown(GameButton.CancelOrClose) && (this.IsCloseButtonVisible // for debug purposes allow to skip the slideshow // in a debug build or when the Shift key is held || Api.Shared.IsDebug || Api.Client.Input.IsKeyHeld(InputKey.Shift))) { this.ExecuteCommandClose(); } ClientInputManager.ConsumeAllButtons(); }); this.Entries = FeaturesSlideshowEntries .Entries .Select(e => new ViewModelFeaturesSlideshowEntry( e.Title, e.Description, new TextureResource(e.TextureImagePath))) .ToArray(); this.IsCloseButtonVisible = FeaturesSlideshow.IsSlideShowFinishedAtLeastOnce; if (this.IsCloseButtonVisible) { this.maxDisplayedEntryIndex = this.Entries.Count - 1; } else { this.maxDisplayedEntryIndex = -1; } this.RefreshNavigationButtons(); }