Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

User Window questions

CaelanCaelan Member Posts: 2,835 @@ - Legendary Achaean

How do you set fields in a user window? I was looking at some GUIs and am trying to re-write my own system which doesn't really have any GUI stuff, just a target window, a chat window, and a personal detail window (planned).


If I want to track which limb I'm parrying in a window (or the limb I'm targetting, or just about anything), do I just trigger the line, assign it to a variable, and call the window, with the window itself displaying the variable ? I know I can use GMCP but I don't see any GMCP for targetting or limb parrying.


Or is there a better way? I'd like one that doesn't make a lot of unnecessary calls and whatnot. Would prefer an efficient re-write as that is half the reason I'm currently re-doing stuff. If there's a way to just throw it to the window or that one section of the window, without re-drawing the whole thing every time a value/variable changes, that would be preferred.


Comments

  • CaelanCaelan Member Posts: 2,835 @@ - Legendary Achaean

    Screw you guys, Im going home.



    Went w what I knew. Local variables where possible, gmcp elsewhere.


    I still would like to know how to line up rows and columns in windows so it isnt a bunch of \t and spaces but...


  • CaelanCaelan Member Posts: 2,835 @@ - Legendary Achaean

    Actually wouldn't mind some help @Saonji or anyone with messing with json (never have before). I want to pull the data to populate a user window. If you want to, please msg me instead of posting. I just need to know wtf I need


  • SaonjiSaonji Member Posts: 972 ✭✭✭✭ - Eminent
    edited April 30
    local f, s = io.open(filepath)
    --Open the downloaded json file.
    
    if f then s = f:read("*l"); io.close(f) end
    --s now has the table in json format.
    
    local t = yajl.to_value(s)
    --t now has the table in Lua format.
    

    Now you can access table 't' through normal table means. t.name t.class etc.

  • CaelanCaelan Member Posts: 2,835 @@ - Legendary Achaean
    edited May 1

    Lua syntax error:[string "Script: target_data"]:4: unexpected symbol near '�'


    Copied it into a function since I want it called when I change targets, so it updates the target window. Like I said, I never messed with this and hate to bother folks with it but if I have to rewrite the Lua, I figured this would be a fun update shrug.


    It doesn't seem to like the ("*l")


    @Saonji tagged just so you see it.


Sign In to Comment.