lotrointerface.com
Search Downloads

LoTROInterface SVN KragenBars

[/] [branches/] [3.12/] [KragenBars/] [Timer.lua] - Rev 40

Compare with Previous | Blame | View Log

import "Turbine.UI";
import "Turbine.UI.Lotro";
import "Turbine.Gameplay";
import "KragenPlugs.Utils";
import "KragenPlugs.KragenBars";

Timer = class( Turbine.UI.Control );

function Timer:Constructor()
    Turbine.UI.Control.Constructor( self );
    self:SetWantsUpdates(true);
    self.AutoReset=false;
    self.Enabled=false;
    self.Interval=15;
    self.count = 0;
    self.seconds=0;
    self.initTime=Turbine.Engine.GetGameTime();

    self.Start=function()
        self.Enabled=true;
        self.initTime=Turbine.Engine.GetGameTime();
    end

    self.Stop=function()
        self.Enabled=false;
        self.count=0;
        self.seconds=0;

    end
    
    self.Close=function()
        --self=nil;
    end

    self.TimerElapsed=function(sender,args)

    end

    self.Update=function(sender,args)
        if(self.Enabled==true)then

            self.seconds = Turbine.Engine.GetGameTime() - self.initTime;

            if(self.seconds >= self.Interval)then

                self:TimerElapsed(self,nil);
                self.count = self.count+1
                if (self.AutoReset==false)then
                    self:Stop();
                end
                self.seconds=0;
                self.initTime=Turbine.Engine.GetGameTime();
            end

        end

    end

end

function Timer:SetInterval(value)
        self.Interval = value;
end

Compare with Previous | Blame


All times are GMT -5. The time now is 04:43 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui