fix(compat): fix YimLuaAPI compatibility issues by xesdoog · Pull Request #99 · YimMenu-Lua/Samurais-Scripts

  • Attempting to set a keybind gives an ImGui error (I've been trying to figure out how to correctly use ImGui.Dummy() as before this I just copied the function call until the error went away lol).

Thanks! I only briefly tested the keybinds UI and didn't actually change any keybinds. I only made sure it works and tested the reserved keybinds to make sure it displays an error message if you try to use a reserved key like F or INSERT. I'll fully test it more thoroughly later today.

As for ImGui.Dummy, think of it as adding an invisible item that does nothing other than occupy screen space. It takes a width and height params so you can make it as big as you want. It's main use (at least for me) is to reserve space after drawing primitive widgets. For example, the vertical progress bars in the the nightclub cargo section are custom manually drawn rectangles. You must reserve the total space you use after you're done drawing otherwise the next item will overlap. As for the use inside normal UIs like the one you saw in the keybinds UI, that's just a lazy way of adding spacing. You can achieve the same result by calling ImGui.Spacing() but this adds a fixed number determined by the current theme's style. You can also manually advance the cursor by calling ImGui.SetCursorPos but Dummy is simpler in these scenarios. If you'd like you can join our discord and discuss this further.