View Feature Request
Friend and Guild Check
Feature #: 26
File: Foundry Tactical Combat (FTC)
Date: 04/01/14 06:45 PM
By: Mitazaki
Status: Under Review
I was really looking for something that would indicate if a target was a friend or guild member. I was really wanting to create an add on for this and despite my background with other languages I'm new to lua and was unsure how to go about this so I figured the best way was to modify your target frames ( really luv FTC ).

This is what I came up with:

Blue text for friend and Green for guild

frames/Functions.lua
----------------------------------------------------
-FIND-

-- Populate the frame nameplate
Code:
local name 		= FTC.Target.name
-REMOVE-

Code:
local name 		= FTC.Target.name
----------------------------------------------------

-FIND-

Code:
-- Populate the frame nameplate
-INSERT BEFORE -

Code:
-- Friend and Guild Check 
isguild = 0
for xguildid = 1, GetNumGuilds(), 1 do
	for xmemberid = 1, GetNumGuildMembers(xguildid), 1 do
		charvar = {GetGuildMemberCharacterInfo(xguildid, xmemberid)}
		if charvar[2] == GetRawUnitName('reticleover') then
			isguild = 1
		end
	end
end

if IsUnitFriend( 'reticleover' ) then
	FTC_TargetFrameName:SetText( "|c5555FF" .. name .. " (" .. level .. ")" .. "|r" )
elseif isguild == 1 then
	FTC_TargetFrameName:SetText( "|c55FF55" .. name .. " (" .. level .. ")" .. "|r" )
else 
	FTC_TargetFrameName:SetText( name .. " (" .. level .. ")" )
end
----------------------------------------------------

There might be better ways todo it but Im new to lua and the teso api.

But feel free to add this in another version of whatever credit me or not. Either way I hope it's useful to you. :banana: