From 292695a7b5bbc876682af4b8ad1dac1c488fdcce Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 23 Dec 2020 12:37:50 +0000 Subject: [PATCH] Mouse-mode feedback message adjusts based on trigger When triggering mouse-mode switching with right-click instead of Tab, adjust the visual feedback to reflect this. Suggested by Huntley Palmer. Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2484/ --- Nasal/controls.nas | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Nasal/controls.nas b/Nasal/controls.nas index a7deac4b8..9e982e3ab 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -725,10 +725,20 @@ var cycleMouseMode = func(node) } var msg = ""; - if (mode == 1) - msg = "Mouse is controlling flight controls. Press TAB to change."; - else - msg = "Mouse is controlling view direction. Press TAB to change."; + + # give correct feedback for the UI action which prompted this + var suffix = "Press TAB to change."; + if (reason == "right-click") { + suffix = "Right-click to change."; + } + + if (mode == 1) { + msg = "Mouse is controlling flight controls."; + } else { + msg = "Mouse is controlling view direction."; + } + + msg = msg ~ " " ~ suffix; fgcommand("show-message", props.Node.new({ "label": msg, "id":"mouse-mode" })); }