PSOBB Addon Plugin (Lua UI addons)

Started adding this to my local copy of my fork. I'll do some light sanity testing and push them to github in a day or two when I have time to test some more. Plain AddRect() is in the top right window (realized it's hard to see because I was making things blue after I finished checking the window).

View attachment 23369
Basically they need a window to render to, so you could create one imgui window that covers the entire screen, make it transparent, NoInputs, etc like you're already doing, and then render all of the primitives directly to it.

Would you be willing to quickly test if they fix the performance issue once I push the changes? You'll need to build the plugin from source. If they work fine, I can ask Soly to do a new release with these changes (this would also include my 2022 fix for 'white addons' at main menu and disappearing ingame in dark rooms).

There is a "require_version" function in the plugin's pso table. You can check if pso.require_version is nil or if pso.require_version(<whatever the next version is>) returns false to know if someone needs to update their addon plugin, in case you want to support the old way or tell people to upgrade.
absolutely, I can test it. Just ensure the build instructions are half decent if its anything more fragile than make build I can even look into using github actions to build for free on push or release tag. Also, as a feature request, would you include loading a texture/image? the addons could really benefit from loading little icons for sectionid, resta, s/d j/z, ect,ect. Its something I know the og imgui can do.
 
absolutely, I can test it. Just ensure the build instructions are half decent if its anything more fragile than make build I can even look into using github actions to build for free on push or release tag. Also, as a feature request, would you include loading a texture/image? the addons could really benefit from loading little icons for sectionid, resta, s/d j/z, ect,ect. Its something I know the og imgui can do.
My fork of the base plugin is here. It's only a few commits ahead of Soly's repo so checking out what changed should be pretty straightforward.

It should 'just work' if you try to build it via Visual Studio 2022. Just open the solution file and select Build>Build Solution. Make sure you compile Release because Debug build of ImGui code is pretty slow.

My example addon is here:

Regarding the image stuff, my knowledge of D3D8 is pretty bad and I don't think I have or want to spend the time to figure that out now. It seems like there's already an export in the Lua imgui table for AddImage, so presumably adding a way to load an image into a texture and give a unique ID back to Lua would suffice? Although I'm not sure if the plugin's implementation of RenderDrawLists() can handle it.

The addon plugin was originally created by HybridEidolon back in 2016. Soly and I are maintainers of a fork because we each made our own forks in 2018 and then fixed a bunch of issues in 2020. But yeah, there's a bunch of stuff that I don't really know in it because I didn't develop it /shrug
 
1731987614582.png

My fork of the base plugin is here. It's only a few commits ahead of Soly's repo so checking out what changed should be pretty straightforward.

It should 'just work' if you try to build it via Visual Studio 2022. Just open the solution file and select Build>Build Solution. Make sure you compile Release because Debug build of ImGui code is pretty slow.

My example addon is here:

Regarding the image stuff, my knowledge of D3D8 is pretty bad and I don't think I have or want to spend the time to figure that out now. It seems like there's already an export in the Lua imgui table for AddImage, so presumably adding a way to load an image into a texture and give a unique ID back to Lua would suffice? Although I'm not sure if the plugin's implementation of RenderDrawLists() can handle it.

The addon plugin was originally created by HybridEidolon back in 2016. Soly and I are maintainers of a fork because we each made our own forks in 2018 and then fixed a bunch of issues in 2020. But yeah, there's a bunch of stuff that I don't really know in it because I didn't develop it /shrug

Looks like it works
 
But does it fix the performance problems? I assume it does so maybe I'll just ask Soly to do a release anyway.
I haven't rewritten the dropbox tracker addon to make shape primitive calls, so when I do will post here, but adding those methods for use in lua can't hurt anything :cool:
 
sorry for the noob question but how i do use the addon pop up menu, i cant get any buttons or the mouse to go over to it
 
sorry for the noob question but how i do use the addon pop up menu, i cant get any buttons or the mouse to go over to it
Are you playing in Virtual Fullscreen? IIRC Exclusive Fullscreen (or whatever the other fullscreen is called) hides the mouse cursor ingame.
 
I pushed a pull request for this update. However, I am not sure if it will be accepted or not. I just prefer to have my chat look the way I want.

1742697244567.png
 
Last edited:
I pushed a pull request for this update. However, I am not sure if it will be accepted or not. I just prefer to have my chat look the way I want.

View attachment 24004
Your changes broke message highlighting when it has your name in it and also broke word wrapping when custom name colors are enabled.

Before:
7jnXTlz.png


After:
aP2J35z.png
 
Your changes broke message highlighting when it has your name in it and also broke word wrapping when custom name colors are enabled.

Before:
7jnXTlz.png


After:
aP2J35z.png
so after some debugging it was actually broken in a commit before I even touched the addon. This commit happened on Mar 8

https://github.com/jtuu/psochatlogaddon/commit/538f306642d275acbf93e76a6c2f1c6c411f00d5

I will need to figure out why stuff was changed here. The issue is with the changes in this commit say my name is Bennylava its reading it as EBennylav which ofc will not match
 
so after some debugging it was actually broken in a commit before I even touched the addon. This commit happened on Mar 8

https://github.com/jtuu/psochatlogaddon/commit/538f306642d275acbf93e76a6c2f1c6c411f00d5

I will need to figure out why stuff was changed here. The issue is with the changes in this commit say my name is Bennylava its reading it as EBennylav which ofc will not match
Oops, I broke how it strips the language code out of the name. I'll fix it and submit a PR soon after some more testing

1744427239934.png
 
I'll take a look I just noticed word wrapping and pushed a fix for it.
432993990-ff7e68a5-4e95-4c7f-be01-d02cc07fa5cb.png
This is the word wrap functionality that I would like, the way that it previously was. Also looks like some letter on the far right are cut off a little bit. Thanks for your work.
 
View attachment 24126
This is the word wrap functionality that I would like, the way that it previously was. Also looks like some letter on the far right are cut off a little bit. Thanks for your work.
I am not sure if ill be able to figure that out maybe @Ender has an idea I think the way my current name coloring works doesnt allow for that.

Also after enders PR ill prob add a setting so players can choose their highlight color.
 
I am not sure if ill be able to figure that out maybe @Ender has an idea I think the way my current name coloring works doesnt allow for that.
Nah no idea. Looks like this is how imgui just renders text when it starts at a specific X pos. The highlighted lines are a single text call so it wraps back to the beginning.

You would probably have to add something new to the base plugin to get around this that specifies the cursor's X position for lines after the wrap.

Maybe there's a way to calculate the text extent and split it into two strings--one for the first part and then a new line that starts with X pos == 0 for the wrapped text call. But I don't know if Imgui provides the text extent somewhere and the font size isn't really the width of the text.
 
I am not sure if ill be able to figure that out maybe @Ender has an idea I think the way my current name coloring works doesnt allow for that.

Also after enders PR ill prob add a setting so players can choose their highlight color.
I've figured out how to get the text to wrap the way I want it to but I don't use github. I also wouldn't say that its a good solution.
local namePadding = ""
while imgui.CalcTextSize(namePadding) < imgui.CalcTextSize(nameFormat)-imgui.CalcTextSize(" ") do
namePadding = namePadding .. " "
end
imgui.SetCursorPos(imgui.GetCursorPosX()-imgui.CalcTextSize(namePadding), imgui.GetCursorPosY())
imgui.TextWrapped(namePadding .. options.clMessageSeparator .. formattedText)
The idea is to start the text portion of the message at the same place as the name starts so the line wrap starts at the far left and just add spaces to the beginning so that the messages text doesn't overlap the name.
One issue is that a bunch of spaces won't always line up nicely with the end of the name to place the separator so I've dynamically moved the starting position so that the separator does line up but the wrapped text might be a tiny bit indented. I couldn't figure out a way to get both to line up every time so I had to pick one.
 
Back
Top