Пример #1
0
 /*********
 ** Private methods
 *********/
 /// <summary>The method invoked when the player presses a button.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void Input_ButtonPressed(object sender, InputButtonPressedEventArgs e)
 {
     // print list of loaded assets
     if (e.Button == SButton.F12)
     {
         string[] assets = this.LoadedAssets.OrderBy(p => p).ToArray();
         this.Monitor.Log($"CanLoad<T> was called for these assets:\n   {string.Join("\n   ", assets)}", LogLevel.Info);
     }
 }
Пример #2
0
 /// <summary>The method invoked when the player presses a button.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void Input_ButtonPressed(object sender, InputButtonPressedEventArgs e)
 {
     try
     {
         // toggle overlay
         if (Context.IsPlayerFree && this.Config.Controls.ToggleOverlay.Contains(e.Button))
         {
             if (this.CurrentOverlay != null)
             {
                 this.DisableOverlay();
             }
             else
             {
                 this.EnableOverlay();
             }
         }
     }
     catch (Exception ex)
     {
         this.HandleError(ex, "handling key input");
     }
 }