MCPcopy Create free account
hub / github.com/Norbyte/bg3se / FireEvents

Method FireEvents

BG3Extender/Extender/Client/IMGUI/IMGUI.cpp:185–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184
185void StyledRenderable::FireEvents()
186{
187 if (OnClick && !OverridesClickEvent() && ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
188 Manager->GetEventQueue().Call(OnClick, lua::ImguiHandle(Handle));
189 }
190
191 if (OnRightClick && ImGui::IsItemClicked(ImGuiMouseButton_Right)) {
192 Manager->GetEventQueue().Call(OnRightClick, lua::ImguiHandle(Handle));
193 }
194
195 if (OnActivate && ImGui::IsItemActivated()) {
196 Manager->GetEventQueue().Call(OnActivate, lua::ImguiHandle(Handle));
197 }
198
199 if (OnDeactivate && ImGui::IsItemDeactivated()) {
200 Manager->GetEventQueue().Call(OnDeactivate, lua::ImguiHandle(Handle));
201 }
202
203 // IsItemHovered() is expensive so we need to make sure we have a handler before doing a hover check
204 if (OnHoverEnter || OnHoverLeave) {
205 auto hovered = ImGui::IsItemHovered();
206 if (WasHovered != hovered) {
207 if (hovered && OnHoverEnter) {
208 Manager->GetEventQueue().Call(OnHoverEnter, lua::ImguiHandle(Handle));
209 }
210 if (!hovered && OnHoverLeave) {
211 Manager->GetEventQueue().Call(OnHoverLeave, lua::ImguiHandle(Handle));
212 }
213 }
214 WasHovered = hovered;
215 }
216}
217
218
219void StyledRenderable::HandleDragDrop(DrawingContext& context)

Callers

nothing calls this directly

Calls 1

CallMethod · 0.45

Tested by

no test coverage detected