doubleclick pause for options#5279
Conversation
accessibility
|
Is pause button the "right place" to put options toggling? Doesn't pause usually toggle pause/unpause? Alternative solution:
@nozmajner thoughts? EDIT: Ah, re-reading the title, I assume double click isn't same as toggle, if so, then please disregard my text above. |
|
It was on the pause button in Frontier as far as I can remember. Or rather it turned into a stop button that would bring the settings up. Which made sense to me back then. |
|
altered as requested @impaktor pause button does not toggle (in pioneer) enforcing options to be open always on pause would interfere with screenshots |
|
Have the requested changes by @Web-eWorks been addressed? |
|
@impaktor the changes have been made but now for some reason "IsMouseDoubleClicked" doesnt exist on my copy of pioneer. im baffled. |
|
@impaktor simply reversing the order made it exist again. pigui is a fickle beast! |
I get |
|
@zonkmachine is that with patch "unknown issue" of this patch? |
|
Yes, with that one too, but the issue shows up in one way or the other since the introduction of |
|
changed it back to manual doubleclick |
|
OK, I think I found it. There is no diff --git a/data/pigui/libs/forwarded.lua b/data/pigui/libs/forwarded.lua
index aca3706ef..af377f37d 100644
--- a/data/pigui/libs/forwarded.lua
+++ b/data/pigui/libs/forwarded.lua
@@ -54,6 +54,7 @@ ui.getTextLineHeightWithSpacing = pigui.GetTextLineHeightWithSpacing
ui.lowThrustButton = pigui.LowThrustButton
ui.thrustIndicator = pigui.ThrustIndicator
ui.isMouseClicked = pigui.IsMouseClicked
+ui.isMouseDoubleClicked = pigui.IsMouseDoubleClicked
ui.isMouseDown = pigui.IsMouseDown
ui.getMousePos = pigui.GetMousePos
ui.getMouseWheel = pigui.GetMouseWheel
diff --git a/src/lua/LuaPiGui.cpp b/src/lua/LuaPiGui.cpp
index 42d26744e..6dc982ec2 100644
--- a/src/lua/LuaPiGui.cpp
+++ b/src/lua/LuaPiGui.cpp
@@ -1517,6 +1517,14 @@ static int l_pigui_is_mouse_clicked(lua_State *l)
return 1;
}
+static int l_pigui_is_mouse_doubleclicked(lua_State *l)
+{
+ PROFILE_SCOPED()
+ int button = LuaPull<int>(l, 1);
+ LuaPush(l, ImGui::IsMouseDoubleClicked(button));
+ return 1;
+}
+
static int l_pigui_push_font(lua_State *l)
{
PROFILE_SCOPED()
@@ -2875,6 +2883,7 @@ void LuaObject<PiGui::Instance>::RegisterClass()
{ "PopID", l_pigui_pop_id },
{ "IsMouseReleased", l_pigui_is_mouse_released },
{ "IsMouseClicked", l_pigui_is_mouse_clicked },
+ { "IsMouseDoubleClicked", l_pigui_is_mouse_doubleclicked },
{ "IsMouseDown", l_pigui_is_mouse_down },
{ "IsMouseHoveringRect", l_pigui_is_mouse_hovering_rect },
{ "IsWindowHovered", l_pigui_is_window_hovered },
(END)
|
|
that doesnt explain why it DID work in some cases even before it was exposed, a real mystery |
patch by Oscar W
|
hopefully thats the last time this patch needs to be revisited |
sturnclaw
left a comment
There was a problem hiding this comment.
Code looks good to me, thanks for the many iterations!
|
Thanks to @zonkmachine too for testing and fixing |
accessibility: open options by mouse actions
instead of needing keyboard + mouse