Difference between revisions of "NDDynamicSpawnerHUDVars"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
Line 14: Line 14:
 
     dynWindow:AddLabel(0,50,desc,0,0,18,"center",false,true,"SpectralSC-SemiBold")
 
     dynWindow:AddLabel(0,50,desc,0,0,18,"center",false,true,"SpectralSC-SemiBold")
 
     dynWindow:AddLabel(0,65,"["..COLORS.FloralWhite.."]".."Stage: [-]"..stage.." of ".. maxStage,0,0,18, "center", false,true,"SpectralSC-SemiBold")
 
     dynWindow:AddLabel(0,65,"["..COLORS.FloralWhite.."]".."Stage: [-]"..stage.." of ".. maxStage,0,0,18, "center", false,true,"SpectralSC-SemiBold")
 
+
 
     if( endTime ) then
 
     if( endTime ) then
 
         local timeLeft = TimeSpanToWords(endTime:Subtract(DateTime.UtcNow), nil, {Seconds = true})
 
         local timeLeft = TimeSpanToWords(endTime:Subtract(DateTime.UtcNow), nil, {Seconds = true})

Revision as of 06:25, 9 December 2019

[Main] [Dynamic Spawners]

About HUDVars

HudVars is the way to tell the new HUD element what to display when players are near your dynamic spawner. The dynamic window function UpdateDynamicEventHUD is located in the hud.lua here is the function as of P8 release.

function UpdateDynamicEventHUD(playerObj,vars)		
    local title = vars.Title or "Dynamic Event Title"
    local desc = vars.Description or "Dynamic Event Description."
    local endTime = vars.EndTime or nil
    local stage = vars.Stage or 0
    local maxStage = vars.MaxStage or 0
    local progress = vars.Progress or 0
    local dynWindow = DynamicWindow("DynamicEventHUD","",0,0,0,0,"Transparent","Top")
    dynWindow:AddLabel(0,30,title,0,0,24,"center",false,true,"SpectralSC-SemiBold")
    dynWindow:AddLabel(0,50,desc,0,0,18,"center",false,true,"SpectralSC-SemiBold")
    dynWindow:AddLabel(0,65,"["..COLORS.FloralWhite.."]".."Stage: [-]"..stage.." of ".. maxStage,0,0,18, "center", false,true,"SpectralSC-SemiBold")

    if( endTime ) then
        local timeLeft = TimeSpanToWords(endTime:Subtract(DateTime.UtcNow), nil, {Seconds = true})
        dynWindow:AddLabel(0,80,timeLeft .. " Remaining",0,0,18,"center",false,true,"SpectralSC-SemiBold")
    end

    playerObj:OpenDynamicWindow(dynWindow)
end

function CloseDynamicEventHUD( playerObj )
    playerObj:CloseDynamicWindow("DynamicEventHUD")
end