Thread Tools Display Modes
Prev Previous Post   Next Post Next
04/05/15, 09:40 PM   #1
CrazyJay
Join Date: Apr 2015
Posts: 2
Move PC 'F' Hold to Interact [SOLVED]

So, I tried a few searches looking for an addon that moves the 'F' Hold to Interact pop-up when you approach a player character. Found nothing (weird). I did find this thread: http://www.esoui.com/forums/showthread.php?p=7956


Rather than bumping a near 1 year old thread, this sub-forum seemed more appropriate. If not, please help me redirect.

But, I really want this functionality for the same reason as the OP in that thread. I really Like FTCs Player and Target frames, And I really like having them right at the bottom and center next to each other just above the action bar.

Problem is, the damn vanilla 'F' Hold to Interact' prompt with a players name is in that exact spot. I would love if it was moved to where the NPC version is (I have no idea why it's not by default... but I digress)

Rather than request someone else make the addon I want, I though I would man up and try making it myself. Anyways, just tried doing a crash course in addon creation, and boy did I fail. I successfully made an addon that ESO recognizes and is up to date, but it doesn't do what I want. Here are my files. I am a noob when it comes to coding, so I am 100% sure I screwed it up somewhere (probably obvious to veterans). Browsing the API list in the Wiki got me nowhere, as I don't really even know what I'm looking for.

Addon Folder Name: MoveHoldToInteractPlayer

MoveHoldToInteractPlayer.txt
## Title: MoveHoldToInteractPlayer
## APIVersion: 100011

MoveHoldToInteractPlayer.lua
MoveHoldToInteractPlayer.lua

(Edit: and now it appears as though Forum posts don't recognize tabs from my code, trying to fix now. GOT IT! lua wrap function right in my face. Files are still attached anyways)

Attempt 1:
Lua Code:
  1. function MoveHoldToInteractPlayer:Initialize()
  2.     if name ~= "MoveHoldToInteractPlayer" then return end
  3.     ZO_PlayerToPlayerAreaPromptContainer:ClearAnchors()
  4.     ZO_PlayerToPlayerAreaPromptContainer:SetAnchor(BOTTOM, ZO_PlayerToPlayerArea, BOTTOM, 0, -600)
  5.     end
  6.  
  7. function MoveHoldToInteractPlayer.OnAddOnLoaded(event, addonName)
  8.   if addonName == MoveHoldToInteractPlayer.name then
  9.     MoveHoldToInteractPlayer:Initialize()
  10.   end
  11. end
  12.  
  13. EVENT_MANAGER:RegisterForEvent(MoveHoldToInteractPlayer.name, EVENT_ADD_ON_LOADED, MoveHoldToInteractPlayer.OnAddOnLoaded)

Attempt 2:
Lua Code:
  1. EVENT_MANAGER:RegisterForEvent("MoveInteract_OnLoad", EVENT_ADD_ON_LOADED,
  2.    function(code, name)
  3.       if name ~= "MoveHoldToInteractPlayer" then return end
  4.       ZO_PlayerToPlayerAreaPromptContainer:ClearAnchors()
  5.       ZO_PlayerToPlayerAreaPromptContainer:SetAnchor(BOTTOM, ZO_PlayerToPlayerArea, BOTTOM, 0, -350)
  6.       EVENT_MANAGER:UnregisterForEvent("MoveInteract_OnLoad", EVENT_ADD_ON_LOADED)
  7.    end)

Thanks in advance for your help. And if this is the wrong sub-forum. My apologies. Brand new to this game and loving it so far!

-CrazyJay
Attached Files
File Type: txt MoveHoldToInteractPlayer.txt (89 Bytes, 393 views)
File Type: lua MoveHoldToInteractPlayer.lua (1.0 KB, 378 views)

Last edited by CrazyJay : 04/05/15 at 10:29 PM.
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » Move PC 'F' Hold to Interact


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off