don't close the logo menu on mouseout

now that we no longer open on hover, it doesn't make as much sense, and
the behavior can be frustrating when the mouse is moved unintentionally
develop
Myk Taylor 2023-09-14 11:46:30 -07:00
parent 04999cae8d
commit fc88bfcbbc
No known key found for this signature in database
2 changed files with 11 additions and 15 deletions

@ -19,14 +19,17 @@ Usage
Menu overlay widget
-------------------
The in-game hotkeys menu is registered with the `overlay` framework and can be
enabled as a hotspot in the upper-left corner of the screen. You can bring up
the menu by hovering the mouse cursor over the hotspot and can select a command
to run from the list by clicking on it with the mouse or by using the keyboard
to select a command with the arrow keys and hitting :kbd:`Enter`.
The in-game hotkeys menu is registered with the `overlay` framework and appears
as a DFHack logo in the upper-left corner of the screen. You can bring up the
menu by clicking on the logo or by hitting the global :kbd:`Ctrl`:kbd:`Shift`:kbd:`c` hotkey. You can select a command to run from
the list by clicking on it with the mouse or by using the keyboard to select a
command with the arrow keys and hitting :kbd:`Enter`.
The menu closes automatically when an action is taken or when you click or
right click anywhere else on the screen.
A short description of the command will appear in a nearby textbox. If you'd
like to see the full help text for the command or edit the command before
running, you can open it for editing in `gui/launcher` by right clicking on the
running, you can open it for editing in `gui/launcher` by shift clicking on the
command, left clicking on the arrow to the left of the command, or by pressing
the right arrow key while the command is selected.

@ -297,7 +297,7 @@ function Menu:onRenderFrame(dc, rect)
self.initialize()
self.initialize = nil
end
Menu.super.onRenderFrame(dc, rect)
Menu.super.onRenderFrame(self, dc, rect)
end
function Menu:getMouseFramePos()
@ -306,7 +306,7 @@ function Menu:getMouseFramePos()
end
function Menu:onRenderBody(dc)
local panel = self.subviews.list_panel
Menu.super.onRenderBody(self, dc)
local list = self.subviews.list
local idx = list:getIdxUnderMouse()
if idx and idx ~= self.last_mouse_idx then
@ -316,13 +316,6 @@ function Menu:onRenderBody(dc)
list:setSelected(idx)
self.last_mouse_idx = idx
end
if self:getMouseFramePos() then
self.mouseover = true
elseif self.mouseover then
-- once the mouse has entered the list area, leaving the frame should
-- close the menu screen
self.parent_view:dismiss()
end
end
-- ---------- --