Jump to content
WobLight

[Addon] ActionMirroringFrame (also good for Screencasting!)

Recommended Posts

Hi there,

just something I wanted to share, enjoy!

It creates a floating Action Button which shows the currently used action.

Now also shows Cooldown/Missing power: ActionMirroringFrameTips.jpeg.ef31de9a600a3fa75eee89dca9bb5ca8.jpeg

actionfeedback_opt.gif.c7d21a26057fe9be3baaef3310ad6b86.gif

Addon DOWNLOAD

Old macro:

Spoiler

Extended lua for SuperMacro

Spoiler


if ActionFeedback == nil then
  ActionFeedback = {current = {}}
end

function ActionFeedback:new()
  local o = CreateFrame("CheckButton","ActionFeedback"..ActionFeedback.id,UIParent,"ActionButtonTemplate")
  o.id = ActionFeedback.id
  ActionFeedback.id = ActionFeedback.id + 1
  o.init = ActionFeedback.init
  o.overflow = ActionFeedback.overflow
  o.getFirst = ActionFeedback.getFirst
  o.hold = ActionFeedback.hold
  o.isCurrent = ActionFeedback.isCurrent
  o:init()
  return o
end

if ActionFeedback.id == nil then
  ActionFeedback.id = 0
end

function ActionFeedback:init()
  self:SetPoint("CENTER",UIParent)
  self:SetMovable(true)
  self:EnableMouse()
  self:RegisterForDrag("LeftButton")
  self:SetScript("OnDragStart",function()
    ActionFeedback.dragging = true
    ActionFeedback.root:StartMoving()
  end)
  self:SetScript("OnDragStop",function()
    ActionFeedback.root:StopMovingOrSizing()
    ActionFeedback.dragging = false
  end)
  self:SetScript("OnUpdate",function()
    this:SetScale(ActionFeedback.scale)
    ActionButton_OnUpdate(arg1)
    
    this:SetChecked(this.timer + arg1 <= ActionFeedback.flashtime or this:isCurrent())
      
    if this.timer + arg1 > ActionFeedback.timeout and not this:hold() then
      this:Hide()
    else
      this.timer = this.timer + arg1
    end
  end)
  self:SetScript("OnEvent",function()
    ActionButton_OnEvent(event)
  end)
  self:SetScript("OnClick",function()
    ActionButton_Update();
    ActionButton_UpdateState();
    this:SetChecked()
  end)
  self:SetScript("OnEnter",function()
    ActionFeedback.hovering = true
    ActionButton_SetTooltip()
  end)
  self:SetScript("OnLeave",function()
    this.updateTooltip = nil
    GameTooltip:Hide()
    ActionFeedback.hovering = false
  end)
  this = self
  ActionButton_OnLoad()
  this = nil
  self.timer = ActionFeedback.timeout
end

function ActionFeedback:hold()
  if self.dragging or self.hovering then
    return true
  end
  local o = ActionFeedback.root
  while o ~= nil do
    if o:GetButtonState() == "PUSHED" then
      return true
    end
    o = o.next
  end
  return self:isCurrent() and ActionFeedback.stickyActive
end

if ActionFeedback.f == nil then
  ActionFeedback.f = UseAction
end

function ActionFeedback:overflow(nid)
  local sid = self:GetID()
  if self:IsShown() and sid ~= 0 and sid ~= nid and (ActionFeedback.overflowing > self.id or self:isCurrent() and ActionFeedback.stickyActive) then
    if self.next == nil then
      self.next = ActionFeedback:new()
      self.next:SetPoint("TOPRIGHT", self, "TOPLEFT", -4, 0)
    end
    self.next:overflow()
    self.next:SetID(self:GetID())
    self.next.timer = self.timer
    if self:isCurrent() then
      ActionFeedback.current[self:GetID()] = self.next.id
    end
    self.next:Show()
    self.next:Click()
  end
end

function ActionFeedback:getFirst(id)
  if self:GetID() == id then
    return self.id
  end
  if self.next then
    return self.next:getFirst(id)
  end
  return -1
end

function ActionFeedback:isCurrent()
  if ActionFeedback.current[self:GetID()] == self.id then
    if IsCurrentAction(self:GetID()) then
      return true
    else
      ActionFeedback.current[self:GetID()] = nil
      return false
    end
  elseif ActionFeedback.current[self:GetID()] then
    return false
  end
  
  if IsCurrentAction(self:GetID()) and self.id == ActionFeedback.root:getFirst(self:GetID()) then
    ActionFeedback.current[self:GetID()] = self.id
    return true
  end
  return false
end

UseAction = function(...)
  if not ActionFeedback.standby then
    local o = ActionFeedback.root
    o:overflow(arg[1])
    o:SetID(arg[1])
    o.timer = 0
    o:Show()
    o:Click()
  end
    ActionFeedback.f(unpack(arg))
end

-- SETTINGS
ActionFeedback.standby = false -- disable by default
ActionFeedback.timeout = 1.00 -- time before hiding after an action is used
ActionFeedback.flashtime = 0.20 -- duration of hightlight when an action is used
ActionFeedback.scale = 1.00 -- frame scale, to change it size
ActionFeedback.overflowing = 2 -- create additional frames when actions are used closely
ActionFeedback.overflowTime = 0.66 -- time window to overflow
ActionFeedback.stickyActive = true -- will prevent active actions from hiding
-- END OF SETTINGS

if ActionFeedback.root == nil then
  ActionFeedback.root = ActionFeedback:new()
end

 

Macro to enable/disable it:


/run ActionFeedback.standby = not ActionFeedback.standby

Note that this have no memory and the frame is enabled by default, edit `ActionFeedback.standby` line in the SETTING section of extended lua.

 

 

The frame can be moved by just dragging it.

Edited by WobLight
updated links

Share this post


Link to post
Share on other sites

Looks like a fine addon for me.

Did you consider to make some little addon out of it?

cheers!

Share this post


Link to post
Share on other sites
1 hour ago, Shino said:

Looks like a fine addon for me.

Did you consider to make some little addon out of it?

cheers!

Yes, if there's enough interest I'll do it.

 

37 minutes ago, meridaw said:

Feels like i seen this before. Is it old?

Nope, fresh stuff. No clue if there's something like around though.

Share this post


Link to post
Share on other sites

Added overflow list, to update replace the Extended LUA code and send following code in chat

/run ReloadUI()

 

Share this post


Link to post
Share on other sites

Update: current action (e.g. currently casting) won't fade.

 

... this thing become outrageously complex for a "macro", I'll turn it into an addon one of these days.

Share this post


Link to post
Share on other sites

Well it took more time than expected, but now it's a addon!

Please report any bug here or (even better) on the github page.

Link it the post above.

Share this post


Link to post
Share on other sites
6 hours ago, Salvia said:

What is good about this addon? What does it actually do?

 

On 7/8/2017 at 1:45 AM, WobLight said:

It creates a floating Action Button which shows the currently used action.

 

Share this post


Link to post
Share on other sites
8 hours ago, Salvia said:

What is good about this addon? What does it actually do?

There's also a GIF I believe? The point is to have a fixed point showing the action the player is attempting to use, this can help streamers easing spectators following his actions. Also can be useful to have a fixed place to look at if you're action is failing, for instance when you forgot it is on CD or you didn't noticed you're low on mana. Could also help those who just started using keybinds I guess.

Mostly a fancy gadget for most people probably.

Share this post


Link to post
Share on other sites
48 minutes ago, Nihlo said:

Tried 1.0.3 today and got an error while casting thorns.

Zwischenablage03.jpg

looks like I forgot a debug print somewhere, I'll get rid of it right away

Share this post


Link to post
Share on other sites

v1.0.4

fixed error when picking up an action before hooking

fixed a debug print

now will not show when placing items/spells in actions

Share this post


Link to post
Share on other sites

v1.1.0

Improved mirrors' hightlights:

  • different color for cast (green) and clicks (red)
  • to change colors see /amf or readme file

Share this post


Link to post
Share on other sites

v1.3.0

  • Cooldown and missing power are shown over mirrors
  • Mirrors are now click through!
  • Empty actions won't be mirrored anymore

Share this post


Link to post
Share on other sites

v1.3.1

  • Spell cost tip should now be less impacting performances
  • Tips now follow mirror rotation
  • Usage chat print should now easier to view
  • fixed missing settings (cooldownTip and costTip)

Share this post


Link to post
Share on other sites

v1.3.2

  • Added a configurable threshold for cooldownTip
  • Tweaking to cooldown tip time formats
  • Fixed various issues for settings

Share this post


Link to post
Share on other sites

It should be stable now, no more features currently planned. If anyone have some request/suggestion about new features for this addon is welcome.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×