Thread Rating:
  • 3 Vote(s) - 4.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UI fields not updating with new values.
#1
Trying to learn how to write scripts for mmominion, and I am having trouble interacting with the ui

Code:
fiveminqq={ }

-- module settings
fiveminqq.mainwindow = { name="5minqq", x=550, y=100, w=200, h=280 }
fiveminqq.tickRate = 2000

-- init & ui
function fiveminqq.ModuleInit()
    GUI_NewWindow(fiveminqq.mainwindow.name,fiveminqq.mainwindow.x,fiveminqq.mainwindow.y,fiveminqq.mainwindow.w,fiveminqq.mainwindow.h)

    GUI_NewField(fiveminqq.mainwindow.name,"Target:","fiTargetName")    
end

-- main loop
fiveminqq.lastTick = 0
fiveminqq.lastKnownTarget = ""

function fiveminqq.OnUpdateHandler( Event, ticks )

    if (ticks - fiveminqq.lastTick > fiveminqq.tickRate) then
        fiveminqq.lasttick = ticks

        -- monitior target
        local mytarget = Player:GetTarget()
        if(mytarget) then
            if(mytarget.name ~= fiveminqq.lastKnownTarget) then
                d("[Last known target: " .. fiveminqq.lastKnownTarget .. "] [New target: " .. mytarget.name .. "]")
                fiveminqq.lastKnownTarget = mytarget.name;
                fiTargetName = mytarget.name; -- why does this not update the gui field???
            end
        end

    end
end

-- subscriptions
RegisterEventHandler("Module.Initalize",fiveminqq.ModuleInit)
RegisterEventHandler("Gameloop.Update",fiveminqq.OnUpdateHandler)

the values and behaviour is correct when i am looking at the console, but the ui never updates, what am I doing wrong?
Reply
#2
It's a known bug, you need to put it in a group and the wiki needs to be updated. I feel ya, I banged my head against this for awhile too lol.

http://mmominion.com/Thread-GUI-NewField-BUG
Reply
#3
Gahhhhhh........... I want my brain power back Devil

thanks for speeding up the debug process devek,
much appreciated.
Reply
 


Forum Jump:


Users browsing this thread: 3 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products