libsota - a helper library in lua for Shroud in lua.

Discussion in 'Lua Discussions' started by CatweazleX, Nov 14, 2019.

Thread Status:
Not open for further replies.
  1. CatweazleX

    CatweazleX Avatar

    Messages:
    653
    Likes Received:
    777
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
    fixed.

    The changeset is not sorted. You may sort the result after filtering. This event was intended to help to write a loot counter (action = added/changed) or watch consumeables (action = removed/changed). So to say, call other functions depending on action and/or item name.
     
  2. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    FrostII likes this.
  3. DavidDC

    DavidDC Programmer Moderator SOTA Developer

    Messages:
    1,532
    Likes Received:
    3,236
    Trophy Points:
    113
    Gender:
    Male
    not ready to hold dependency yet, im working on another project for now so might take a while
     
    FrostII likes this.
  4. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    Reagent tracker is what I'm working on, same kind of thing though.
     
  5. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    True, but users can still add deps manually.
     
  6. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    greetings @CatweazleX! its been a long time i hope all is well :) i was hoping to utilize your window-related functionality but it appears to only be in dev currently. also dev does not appear to have the new module functionality. did you have any plans to progress version 5? just looking to see if i move forward with v4 and manually build windows or leverage v5. i do need the module functionality though.

    thank you!
     
    Rentier and Archer like this.
  7. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    As of yesterday (2021-04-29) the patch with build number 1379 has fixed the path issue with ShroudLoadTexture() so that the symbolic link work-around for Linux and Mac is no longer needed.
     
    Last edited: Jun 11, 2021
    Aleksander and Feldon Grimshaw like this.
  8. Drakkim

    Drakkim Avatar

    Messages:
    5
    Likes Received:
    1
    Trophy Points:
    3
    I was looking into this because another the Buff Monitor System depends on it, but it seems that all the download links are broken. I see an older version is typed out in a post, but is this still available or being maintained?
     
  9. CatweazleX

    CatweazleX Avatar

    Messages:
    653
    Likes Received:
    777
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
    May it is time to continue working on it....

    Sorry. Here is a new link: https://cloud.tunipages.de/s/c2RT5wjNSKmZBsw hope it works
     
    Tirrag likes this.
  10. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    @CatweazleX! been a long time great to see you :) that would be wonderful i have been hoping that you would continue the work on the UI/windows system.

    that link has a lot of different files but they are there. i am going to update my mod distribution to include the two it needs for ease of distribution (the license appears to be ok with that).

    @Drakkim expect a new mod release within 30 mins.
     
  11. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    Great to see you you again @CatweazleX

    Please, please start by putting this on Github or some other SCM.

    There are are number of additions and improvements that are possible with newer functionality. Being able to provide pull requests would make helping much easier.
     
    Tirrag likes this.
  12. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    If you would like/need help doing that, I am more than willing. To be honest, I have been tempted to put up a Github repository of the 0.5.d version and commit some minor changes myself. Only thing that stopped me was not want to step on your toes :)
     
  13. CatweazleX

    CatweazleX Avatar

    Messages:
    653
    Likes Received:
    777
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
    The 5.0.d Version is still a development version. (the d in the version number). What's about the 4.x.x Version? is this "branch" still needed? (The 4.x.x is without window support but with module loaders.)
    I know i do not worked on it for about 2 years... the 4.xx branch is the current production version...

    Who all is using this library as library? (not as code base)
    What you want to see added to the library?
     
  14. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    i use it as a library for my lua mods. my public Lua mod that uses it is the Buff Monitor System. personally, i would really like to see the UI/window system completed. there are though a lot more Lua functions since you last worked on it that could be incorporated into the library as well.
     
  15. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    I use it as a library for my own simple scripts. None released yet at I haven't spent any time on making them pretty with UI code you added.

    First additions that immediately spring to mind are:
    * Expose a LoggedIn property, so it is easy to know when we're on the menu without the need to spend time parsing scene names.
    * Use ShroudOnSceneEntry/Exit to similarly avoid continually checking/parsing scene names, and provide a property for InScene.

    Not sure if it is possible, as I haven't looked at the UI stuff yet, but it would be nice if all UI stuff honoured the Hide UI toggle (ShroudIsUIActive()). I know that currently when Hide UI is enabled the Lua icon stays on screen.
     
  16. tervalas

    tervalas Avatar

    Messages:
    50
    Likes Received:
    9
    Trophy Points:
    8
    Quick question. I'm modifying an old addon to use this library. In it, part of a table is displayed along with buttons next to each line. The user can switch pages. The buttons only go with how many lines are displayed.

    Do I need to delete the buttons between each 'page' since I'm calling them using guiButton.add?
     
  17. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    i use the remove function on the button to remove them.

    button_object:remove()

    but if you are implementing a paging functionality you may just hide them when they are not on the active tab.

    button_object:visible(false)
     
    Elgarion likes this.
  18. tervalas

    tervalas Avatar

    Messages:
    50
    Likes Received:
    9
    Trophy Points:
    8
    Not sure if I'm not doing this right or not. So the buttons get created in a loop, 1 per line up to 10 lines. If I then hit the button to change pages, I essentially want to remove all those already created buttons, then run the loop again to recreate the buttons (mostly to ensure that if there are less than 10 rows then there aren't 10 rows of buttons).

    So for example:

    buttonTable = {}
    for i, v in ipairs(some_table) do
    buttonTable = ui.guiButton.add(......)

    end

    This creates the buttons perfectly fine. But when I do something like this:

    for i, v in ipairs(buttonTable) do
    buttonTable.remove()

    end

    It's throwing an error in libsota.lua for the remove function stating it's attempting to index a nil value


    Is it just that this way won't work and I should simply make buttons for each row and don't worry about deleting them or am I approaching this wrong?
     
  19. Tirrag

    Tirrag Avatar

    Messages:
    853
    Likes Received:
    1,820
    Trophy Points:
    93
    Location:
    Iowa, USA
    greetings! without seeing the full code i think there are some things that may need to be addressed to remedy.

    the ui.guiButton.add() function will return a single object. inside of that first loop you are re-setting buttonTable to a single button so at the end of the loop it will only have a single value and will not be an iterable table. i would try updating the first loop to be something like:

    for i, v in ipairs(some_table) do
    table.insert(buttonTable, ui.guiButton.add(......))
    end

    at the end of that you should have a buttonTable filled with all the button. for the second loop, it should now loop but the remove will not work because of the value and call style. you should update the second loop to something like:

    for i, v in ipairs(buttonTable) do
    v:remove()
    end


    let me know how it goes :)
     
Thread Status:
Not open for further replies.