• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - ImGui Launching UI-Intensive Tasks Freezes EQ

Joined
Jun 13, 2016
RedCents
31,901¢
Situation:
ImGui button kicks off a method which performs some UI-heavy stuff (specifically Overseer walking the agent list). With my agent count, this can take 30 seconds of UI interactions.

This works. Except the entire EQ UI freezes up for approx 2-3 seconds. Then snaps back with the task completed (30-second task done in 2. Handy, but), flooding the console window to catch up on any output generated.
mq.pause(), mq.parse('/delay xxx') seem ignored or have no impact.


This does sound like a single-UI thread block kinda thing. But not sure the solution.

I have separate modules, etc. Have tried quite a few variations of what goes where, but I assume I'm missing something fundamental here.

Lua:
local mq = require('mq')
local overseer = require('overseer.overseer')
local hasAction = false

function DrawMainWindow()
    Open, ShowUI = ImGui.Begin('Overseer', Open)
    if ShowUI then
        if ImGui.Button('Collect Statistics') then
            hasAction = true
        end
    end

    ImGui.End()

    if (hasAction) then
        hasAction = false
        overseer.CollectAgentStatistics()
    end
end
 
not sure mq.pause is a thing that exists, and mq.parse('/delay x') would be running a pause over in macro land unrelated to your Lua.

to delay in Lua it is mq.delay(timeMS)

generally you want to run stuff from the main while loop of the script rather than directly from the ImGui callback. the ImGui callback can just set a flag when the buttons clicked, so the main loop knows to execute some task. then you can have delays or whatever else you need in the main loop.
 
Thanks, aquietone. That's the concept I was just about to look into. Should have realized sooner. Your response helps a lot there.

Edit: and I got the pause/delay names wrong, but was intrigued that they had no impact. Was an unexpected result.
 
ImGui is immediate mode, so delays are ignored. Though, brainiac recently added a warning that will now tell you this.

oh, its way more than a warning now.

To the original point - you need to execute your work outside of the imgui callback. (not in DrawMainWindow)
 
Question - ImGui Launching UI-Intensive Tasks Freezes EQ

Users who are viewing this thread

Back
Top
Cart