/// <summary>Show a confirmation message for the given noclip mode, if enabled.</summary> /// <param name="noclipEnabled">Whether noclip was enabled; else noclip was disabled.</param> /// <param name="keybind">The keybind that was pressed.</param> private void ShowConfirmationMessage(bool noclipEnabled, KeybindList keybind) { // skip if message not enabled if (noclipEnabled && !this.Config.ShowEnabledMessage) { return; } if (!noclipEnabled && !this.Config.ShowDisabledMessage) { return; } // show message Game1.hudMessages.RemoveAll(p => p.number == ModEntry.MessageID); string keybindStr = keybind.GetKeybindCurrentlyDown().ToString(); string text = noclipEnabled ? I18n.EnabledMessage(keybindStr) : I18n.DisabledMessage(keybindStr); Game1.addHUDMessage(new HUDMessage(text, HUDMessage.error_type) { noIcon = true, number = ModEntry.MessageID }); }