Detaunt Helper - Lack of targeting functionality
Posted: Thu May 12, 2016 8:41 pm
So, did anyone managed to get the "click on the list to target" functionality to work? IIRC, you could click on the top name of the list to target.
I'm extremely rusty in my coding skills, but looking at the mod's code, it seems that functionality is not actually there.
You can macro DetauntHelper.TargetTop():
Nothing weird there, get the list, get the first name on the list and a call for another function - DetauntHelper.TargetPlayer(target_name).
It takes the first name on the list from .TargetTop() as an argument, assign the value at DetauntHelper.DetauntTargetName and does a conditional which if positive means the current target is the same as the one at the top of the list. Ok, I'd imagine it should also have a false result, an else, that switches the target to the one you clicked or the one a the top.
Again, i'm very rusty so most likely I must have missed something.
I'm extremely rusty in my coding skills, but looking at the mod's code, it seems that functionality is not actually there.
You can macro DetauntHelper.TargetTop():
Code: Select all
function DetauntHelper.TargetTop()
local LL = DetauntHelper.GetTargetList();
if #LL>0 then
local target_name = LL[1].name;
DTHCommon.Print(DHLang.GetString(DHStrings.TARGET_MSG)..StringToWString(target_name));
DetauntHelper.TargetPlayer(target_name);
end
end
Code: Select all
function DetauntHelper.TargetPlayer(playerName)
DetauntHelper.DetauntTargetName = playerName;
if DetauntHelper.CurrentTargetName == DetauntHelper.DetauntTargetName then
if DHSLocal["SoundOn"] then
PlaySound(DHSLocal["TargetAcquiredSound"]);
end
end
SystemData.UserInput.ChatText = towstring("/target "..playerName)
BroadcastEvent(SystemData.Events.SEND_CHAT_TEXT)
end
Again, i'm very rusty so most likely I must have missed something.