PSOBB Addon Plugin (Lua UI addons)

Maybe you have a different keyboard layout. The code to change it is in ...\addons\core_mainmenu\init.lua. It looks like this.

key_pressed = function(key)
if (key == 192) then
window_open = not window_open
end
end

You'll need to figure out the code for the key you want to use. My best advice is to first modify the function with a print statement and check the log window to see what gets printed.

key_pressed = function(key)
print(key)
end
 
Ok will look into that then. Another thing, its possible to filter what items appear on the Item Checker Floor Window? Would be nice to just have show certain items
 
For that you'll need to edit ...\addons\solylib\items\items_list.lua. To hide individual item types, you can change "true" to "false" before the last curly brace.
 
yes. are you comfortable editing code? if so, i will happily explain how to do it. it's not too complicated.
 
Last edited:
So I haven't played in a couple of months, but was wanting to get this running on my new pc. I installed bbmod 0.3.5.6 from Soly's github page and it is working great with the xpbar plugin. The problem I'm having is with item reader and monster reader (haven't tried player reader yet). I copied the solylib, Timer, Item Reader, and Monster Reader directories out of the zip file and into the addons folder.

Monster reader crashes pso (actually it is crashing wine!) as soon as I try and make a room. Item reader doesn't crash wine, but it also fails to actually start. Timer exhibits the same behavior. When I open up the log I get this:

https://drive.google.com/file/d/1GU9_9fr0Iy5vzbifa3-2UoREN7t-0RhD/view?usp=sharing

I'm not sure if I'm forgetting a step (like I said, the xpbar plugin is working fine) or if there's some new incompatibility or something?
 
So I haven't played in a couple of months, but was wanting to get this running on my new pc. I installed bbmod 0.3.5.6 from Soly's github page and it is working great with the xpbar plugin. The problem I'm having is with item reader and monster reader (haven't tried player reader yet). I copied the solylib, Timer, Item Reader, and Monster Reader directories out of the zip file and into the addons folder.

Monster reader crashes pso (actually it is crashing wine!) as soon as I try and make a room. Item reader doesn't crash wine, but it also fails to actually start. Timer exhibits the same behavior. When I open up the log I get this:

https://drive.google.com/file/d/1GU9_9fr0Iy5vzbifa3-2UoREN7t-0RhD/view?usp=sharing

I'm not sure if I'm forgetting a step (like I said, the xpbar plugin is working fine) or if there's some new incompatibility or something?
Those addons aren't working because they depend on changes in the base plugin from more recent releases of the base plugin: https://github.com/Solybum/psobbaddonplugin/releases/latest

I believe updating the base plugin should fix it. Although it's a little surprising they can crash wine.
 
You know, I copied that version into the folder multiple times (or so I thought), but I wiped everything out and redid it and it is working now. Maybe it only installed some weird combination of 0.3.4 and 0.3.5.6 with me moving files around haha.
 
yes. are you comfortable editing code? if so, i will happily explain how to do it. it's not too complicated.

I am interested in this, I would like to change the players names to a different color so it stands out a little from the actual text they are typing.

string.format("%s", msg.name)
 
Also is there a way to add the option to hide window when menu is open. Scape doll addon has it implemented and it would be lovely for everything else as it sucks when trying to find a spot that doesn't hurt the view of your game and doesn't get in the way of the menus.
 
Also is there a way to add the option to hide window when menu is open. Scape doll addon has it implemented and it would be lovely for everything else as it sucks when trying to find a spot that doesn't hurt the view of your game and doesn't get in the way of the menus.

I have an addon that might help. The idea was to be able to configure the visibility of all my addon windows whether those addons support it or not.

This addon overrides the backtick/tilde key to toggle its own visibility. The configuration window starts out hidden so you'll need to press that key to start configuring things.

I use this addon all the time, and it seems to work okay for me. However, I had to use some fairly invasive and experimental techniques to pull this off so it might mess up your other addons. It won't mess up anything permanently, though, so rest assured that you can simply remove it if anything (or everything :eek:) stops working.

...\EphineaPSO\addons\Window Visibility\init.lua:
Code:
local fontScale = 1.0

local info = {
    name = "Window Visibility",
    version = "1.0.0",
    author = "staphen",
    description = ""
}

local self = {
    __addon = {
        init = function() return info end
    },
    windowOpen = false
}

local Visibility = {
    NotConfigured = 1,
    ShowWithGameMenu = 2,
    HideWithGameMenu = 3,
    ShowWithAddonMenu = 4,
    ShowNever = 5
}

local Configuration = function()
    local function getAddonPath()
        local psointernal = require("psointernal")
        local addons = psointernal.get_addons()
        
        for _,addon in pairs(addons) do
            if (addon.module == self) then
                return addon.path
            end
        end
        
        return "Window Visibility"
    end

    local addonPath = getAddonPath()
    local requirePath = string.format("%s.configuration", addonPath)
    local filePath = string.format("addons/%s/configuration.lua", addonPath)
    
    local success,config = pcall(require, requirePath)
    config = success and config or {}
    
    for k,v in pairs(config) do
        if (type(v == "string")) then
            config[k] = Visibility[v]
        end
    end
    
    local modified = false
    local wrapper = {}
    
    wrapper.path = addonPath
    
    wrapper.get = function(key)
        return config[key]
    end
    
    wrapper.set = function(key, value)
        config[key] = value
        modified = true
    end
    
    wrapper.save = function()
        if (not modified) then
            return
        end
        
        local visibilities = {}
        for k,v in pairs(Visibility) do visibilities[v] = k end
        
        local file = io.open(filePath, "w+")

        if file ~= nil then
            local rows = {}
            
            for k,v in pairs(config) do
                local key = tostring(k)
                local value = tostring(visibilities[v])
                local row = string.format("    [\"%s\"] = \"%s\"", key, value)
                table.insert(rows, row)
            end
        
            io.output(file)

            io.write("return {\n")
            io.write(table.concat(rows, ",\n") .. "\n")
            io.write("}\n")

            io.close(file)
        end
        
        modified = false
    end
    
    wrapper.iterate = function()
        return pairs(config)
    end
    
    return wrapper
end

local MainWindow = function(config)
    local addonModule = self
    local self = { name = config.path }
    local psoMenuAddress = 0x00A97F44
    local imguiBegin = imgui.Begin
    local hideAll = false
    
    local beginHidden = function(name, open, flags)
        local hiddenName = string.format("Hidden - %s", name)
        local hiddenFlags = flags or {}
        table.insert(hiddenFlags, "NoSavedSettings")
        imgui.SetNextWindowPos(-100, -100)
        imgui.SetNextWindowSize(1, 1)
        return imguiBegin(hiddenName, open, hiddenFlags)
    end
    
    local actions = {
        [Visibility.NotConfigured] = function(...)
            return imguiBegin(...)
        end,
        
        [Visibility.ShowWithGameMenu] = function(name, open, ...)
            local isMenuOpen = (pso.read_u32(psoMenuAddress) == 1)
            local beginFunction = isMenuOpen and imguiBegin or beginHidden
            local success = beginFunction(name, nil, ...)
            return success, open
        end,
        
        [Visibility.HideWithGameMenu] = function(name, open, ...)
            local isMenuOpen = (pso.read_u32(psoMenuAddress) == 1)
            local beginFunction = isMenuOpen and beginHidden or imguiBegin
            local success = beginFunction(name, nil, ...)
            return success, open
        end,
        
        [Visibility.ShowWithAddonMenu] = function(name, open, ...)
            local beginFunction = addonModule.windowOpen and imguiBegin or beginHidden
            local success = beginFunction(name, nil, ...)
            return success, open
        end,
        
        [Visibility.ShowNever] = function(...)
            return beginHidden(...)
        end
    }

    imgui.Begin = function(name, ...)
        local visibility = config.get(name)
        
        if hideAll then
            visibility = Visibility.ShowNever
        end
        
        if (name == self.name) then
            visibility = Visibility.ShowWithAddonMenu
        end
    
        if (name == "Main") then
            visibility = Visibility.ShowWithAddonMenu
        end
        
        if (visibility == nil) then
            visibility = Visibility.NotConfigured
            config.set(name, visibility)
        end
        
        local action = actions[visibility]
        return action(name, ...)
    end

    self.update = function()
        local windows = {}
        for window in config.iterate() do table.insert(windows, window) end
        table.sort(windows)
        
        local visibilities = {}
        for k,v in pairs(Visibility) do visibilities[v] = k end
        
        imgui.SetNextWindowSize(650, 235, "FirstUseEver")
        imgui.Begin(self.name, true)
        imgui.SetWindowFontScale(fontScale)
        
        if imgui.Checkbox("Hide all windows temporarily", hideAll) then
            hideAll = not hideAll
        end

        local maxTextWidth = 0
        
        for _,window in ipairs(windows) do
            local textWidth = imgui.CalcTextSize(window)
            
            if (textWidth > maxTextWidth) then
                maxTextWidth = textWidth
            end
        end
        
        imgui.Columns(2)
        imgui.SetColumnOffset(1, maxTextWidth + 15)

        for _,window in ipairs(windows) do
            local visibility = config.get(window)
            imgui.Text(window)
            imgui.NextColumn()
            
            imgui.PushID(window)
            
            for v,k in ipairs(visibilities) do
                local active = (visibility == v)
                
                if imgui.RadioButton(string.format("%s", k), active) then
                    config.set(window, v)
                end
                
                imgui.SameLine()
            end
            
            imgui.PopID()
            imgui.NextColumn()
        end
        
        imgui.End()
        
        config.save()
    end
    
    return self
end

do
    local core_mainmenu = require("core_mainmenu")
    local init = core_mainmenu.__addon.init
    
    core_mainmenu.__addon.init = function(...)
        local conf = init(...)
        conf.key_pressed = nil
        return conf
    end
end

do
    local present

    present = function()
        local config = Configuration()
        local mainWindow = MainWindow(config)
        present = mainWindow.update
    end
    
    info.present = function() present() end

    info.key_pressed = function(key)
        if (key == 192) then
            self.windowOpen = not self.windowOpen
        end
    end
end

return self
 
Does the lua environment have network access? I have an idea, but being able to send data on the network is required.
 
I am also under the impression that addons do not have network access. It's a bit of a hack, but perhaps you could marshal data to/from an external app via the filesystem and do all your network activities in that app.
 
New stupid-simple utility plugin: system clock display.

Nice, but sadly its a few beats off comparing to ingame. Would there be a way to sync it whenever you type /time? THAT would be unbelieveable awesome. Would buy you a coffee or more for it :)

I have an addon that might help. The idea was to be able to configure the visibility of all my addon windows whether those addons support it or not.
THX sooo much, I was looking for sth. like that for long....
 
@KeShadow @Ryangosling

I've modified the Chatlog addon to allow customizing the colors a bit (see attachment). It was a fairly simple modification, but I haven't tested it very much, so there may or may not be bugs.

The original feature of highlighting messages that mention your character's name is no longer present. (well, it's commented out anyway.) It kind of conflicted with the new behavior, but I could probably make it work if anyone really wants it.

If you find any bugs, or have any other problems, let me know - I can't promise to respond quickly, but I will get back to you eventually.
 

Attachments

  • psochatlogaddon-color.zip
    6.6 KB · Views: 13
Last edited:
I love the clock add-on but I would like it tbh to have the option of being transparent
 
Back
Top