
.namespace Areas_Help

-- Ce script gère les boutons de la popup d'aide
function OnEnable()
end

function OnUpdate(dt)
end

function OnDisable()
end

function OnWbpMouseLUp()
	PlaySoundEffect("int_click")
	OPLog.Log("clicked")
	-- Bouton annuler
	if self.Name == "Help_popup_quit_area" then
		curseur.Flags_Visible = false
		
		-- Enlève la popup d'aide
		Help_popup.Enabled = false
		
		-- Active les boutons du menus principal
		Menu_StartGame_Parent.Enabled = true
	end
	if self.Name == "left_arrow" then
		if Help.g_page > 1 then
			Help.g_page = Help.g_page-1
			Help.OnEnable()
		end
	end
	if self.Name == "right_arrow" then
		if Help.g_page < Help.g_page_max then
			Help.g_page = Help.g_page+1
			Help.OnEnable()
		end
	end
end

function OnMouseOn()
	if not self.Name == "Help_popup_quit_area" then
		curseur.Position_X = self.Parent.Position_X + self.Position_X - 75
		curseur.Position_Y = self.Parent.Position_Y + self.Position_Y - 5
		curseur.Flags_Visible = true
	end
	return true
end

function OnMouseOff()
	curseur.Flags_Visible = false
	return true
end
