Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjt authored Feb 12, 2022
1 parent 870452b commit 6ae46f8
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion ClippyAssistBCC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,36 @@ function ClippyAssist.SetText(msg, duration)
end)
end

-- Display a speech bubble for the specified duration with an animation.
function ClippyAssist.SetTextAnimation(msg, animation, duration)
balloon.text:SetText(msg)

-- Resize balloon to fit text.
balloon:SetHeight(
balloon.text:GetHeight() +
balloon.text:GetLineHeight() +
2 * balloon_corner_size
)

-- Position balloon depending on Clippy's location.
ClippyAssist.PositionBalloon()

-- Display balloon.
balloon:Show()
if (animation) then
SingleAnimation(animation)
else
IdleAnimation("Explain")
end

-- Set up hiding for balloon.
time_hide_text = GetTime() + duration
C_Timer.After(duration, function()
balloon:Hide()
balloon.text:SetText("")
end)
end

------------
-- Events --
------------
Expand Down Expand Up @@ -565,7 +595,7 @@ function SlashCmdList.CLIPPY(msg, editBox)
end
if msg == "-help" or msg == "-h" or msg == "-?" then
print("You are currently using Clippy Assist v" ..
GetAddOnMetadata("ClippyAssist", "Version") .. ".")
GetAddOnMetadata("ClippyAssistBCC", "Version") .. ".")
print("It looks like you're trying to use Clippy Assist. " ..
"Would you like some help with that?")
print(" -help: Shows this text.")
Expand Down

0 comments on commit 6ae46f8

Please sign in to comment.