#Conditional Hooks
$Application: FS2_Open

$On Game Init:
[
	function NUiObjectives:Init()
		self:SetupUI()
	end
]

$State: GS_STATE_GAME_PLAY
$On Gameplay Start:
[
	NUiObjectives:Init()
	NUiObjectives:Setup()
]

$On State End:
[
	NUiObjectives.Active = false
]

$On HUD Draw:
[
	if NUiObjectives.Active then

		local canDraw = true

		if not hu.HUDDrawn then
			canDraw = false
		end

		if hu.HUDDisabledExceptMessages then
			canDraw = false
		end

		if not (gr.hasViewmode(VM_INTERNAL) or gr.hasViewmode(VM_CHASE)) then
			canDraw = false
		end

		if PromptBox and PromptBox.Visible then
			canDraw = false
		end

		if canDraw then
			NUiObjectives:Poll()
			NUiObjectives:Draw()
		end
	end
]

#End
