--[[################################################################################]]--
--[[#                                                                              #]]--
--[[# File      :  /hook/lua/modlocator.lua                                        #]]--
--[[#                                                                              #]]--
--[[# Author    : GPG Devs + Manimal                                               #]]--
--[[#                                                                              #]]--
--[[# Version   : 1                                                                #]]--
--[[#                                                                              #]]--
--[[# Revision  : 10 mars 2008                                                     #]]--
--[[#                                                                              #]]--
--[[# Summary   : Mod  Location scripts.                                           #]]--
--[[#                                                                              #]]--
--[[# Copyright : © 2008 Gas Powered Games, Inc. & Manimal  All rights reserved.   #]]--
--[[#                                                                              #]]--
--[[################################################################################]]--

-- given a MOD UID , returns mod location
local TVfound = 'nottrue'

function TVisactive()
	if TVfound == 'nottrue' then
		TVfound = GetActiveModLocation("77775cf2-9b8b-11dc-8314-0800200c9a66")
	end
	return TVfound
end


function GetActiveModLocation( mod_Id )
   for i, mod in __active_mods do
      if  mod_Id == mod.uid then
         LOG("MANIMAL\'s MOD LOCATOR INFO:  Active Mod Found (name="..(mod.name or 'unknown')..", UID="..(mod.uid or 'none')..", location = "..mod.location..")  .")
         return mod.location
      end
   end
    -- Signaler Echec  !
    LOG("MANIMAL\'s MOD LOCATOR WARNING:  Unable to get Mod Location ! Wrong or missing UID.")
   return nil #{}
end

#examples
#myModLocation =  GetActiveModLocation("edf9fefc-a091-457c-8781-e837710f3c6A")
#local Modpath = import('/Mods/yourmodname/modlocator.lua').GetActiveModLocation("edf9fefc-a091-457c-8781-e837710f3c6A")