You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ProditorMagnus opened this issue
Apr 27, 2024
· 0 comments
Labels
BugIssues involving unexpected behavior.InputIssues that involve the handling of user input and input devices.Lua APIIssues with the Lua engine and API.
After running code, dialog appears. When pressing any regular key, (not esc, not enter), on_left_click triggers and chats. When using left click on widget, nothing happens.
Steps to reproduce the behavior
# lua wesnoth.require("wml-utils").handle_event_commands(wml.load("~add-ons/EventLoader/action.cfg"))
[lua]
code=<<
local T = wml.tag
local chat = wesnoth.interface.add_chat_message
local sf = string.format
function wesnoth.wml_actions.stacked_widget_gui()
local dialogDefinition = {
wml.tag.tooltip { id = "tooltip_large" },
wml.tag.helptip { id = "helptip_large" },
wml.tag.grid { wml.tag.row { wml.tag.column {
wml.tag.stacked_widget {
id = "stacker",
definition = "default",
T.layer {
T.row { T.column { T.label { id="my_label1",label = "Hello world" } } }
},
T.layer {
T.row { T.column { T.text_box { id="my_tb" } } }
}
}
} } },
}
local function preshow(dialog)
dialog.my_tb:focus()
dialog.stacker.my_tb.on_left_click = function()
chat("left click")
end
end
gui.show_dialog(dialogDefinition,preshow)
end
wesnoth.wml_actions.stacked_widget_gui()
>>
[/lua]
Expected behavior
From documentation I would expect on_left_click trigger when left click is used, and not trigger when keyboard is used.
BugIssues involving unexpected behavior.InputIssues that involve the handling of user input and input devices.Lua APIIssues with the Lua engine and API.
Game and System Information
Description of the bug
After running code, dialog appears. When pressing any regular key, (not esc, not enter), on_left_click triggers and chats. When using left click on widget, nothing happens.
Steps to reproduce the behavior
Expected behavior
From documentation I would expect on_left_click trigger when left click is used, and not trigger when keyboard is used.
Additional context
https://forums.wesnoth.org/viewtopic.php?p=689120#p689120
https://wiki.wesnoth.org/LuaAPI/types/widget
The text was updated successfully, but these errors were encountered: