Page 1 of 1

Detaunt Helper - Lack of targeting functionality

Posted: Thu May 12, 2016 8:41 pm
by agarantia
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():

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
Nothing weird there, get the list, get the first name on the list and a call for another function - DetauntHelper.TargetPlayer(target_name).

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
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.

Re: Detaunt Helper - Lack of targeting functionality

Posted: Thu May 12, 2016 8:47 pm
by sullemunk
it tries to utilize the /target command wich is not implemented yet..

Re: Detaunt Helper - Lack of targeting functionality

Posted: Sun May 15, 2016 6:11 am
by agarantia
Well, that explains it...

Perhaps it is possible to do something with WindowSetGameActionData. Need to find some documentation of the API, if that even existed. Thanks for the info.

Re: Detaunt Helper - Lack of targeting functionality

Posted: Sun May 15, 2016 6:27 am
by wargrimnir
/target was actually removed by Mythic a long time ago because of addons like this. I wouldn't expect it to be enabled on our server either.