Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the MouseButtonInput event to subscribe to only exist once mouse button events occur? #482

Open
FineRedMist opened this issue Dec 9, 2024 · 1 comment

Comments

@FineRedMist
Copy link
Contributor

I have attempted solutions to common problems

Yes

I have checked that my game version is supported

Yes

OS

Windows 10

Platform

Steam

Description

I'm trying to subscribe to the mouse button events. I initially tried the Ext.Events.EclLuaMouseButton and Ext.Events.MouseButtonEvent (I looked in the code and saw a ThrowEvent for "MouseButtonEvent" and Ext.Events.EclLuaKeyInput didn't work, but Ext.Events.KeyInput did).

Both Ext.Events.EclLuaMouseButton and Ext.Events.MouseButtonEvent generated the message:

Attempted to subscribe to nonexistent event: ...

Can those events only be subscribed to once an event of the given type has occurred? I had previously tried to bind to viewport resized to scale my UI, but also failed with the same reason.

Indications

The log is reporting it cannot bind to events, though the name I'm attempting to bind to may be incorrect. What was in ExtIdeHelpers.lua didn't work, the code reference only worked for KeyInput (which I think is because I pressed keys during startup to tab between windows), and I didn't find online documentation with working information.

Diagnostic Files

No response

Steps to Reproduce

local function OnMouseButton(e)
_D(e)
end

Ext.Events.EclLuaMouseButton:Subscribe(OnMouseButton)

Expected Behavior

The event is registered successfully, and the function is called when those events occur.

Actual Behavior

Attempting to register an event results in an error.

@FineRedMist
Copy link
Contributor Author

Ahh, I managed to get the controller axis, controller button, and key input working, but the controller axis doesn't allow preventing the action. I suspect the mouse would be the same. I was hoping to reduce game interaction while the UI was up so you can't trigger unexpected events while the screen is partly covered. I'm not sure what a good solution to that would be.

The code is at the bottom of https://github.com/FineRedMist/bg3_mod_epic6/blob/main/DnD-Epic6/Mods/DnD-Epic6/ScriptExtender/Lua/Client/UI/E6_FeatSelectorUI.lua. Suggestions appreciated for making this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant