<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -48,9 +48,15 @@ frame:SetScript(&quot;OnShow&quot;, function(frame)
 	compactmode:SetChecked(ControlFreak.db.char.compactmode)
 
 
+	local textpopup = tekcheck.new(frame, nil, &quot;Expiration warning&quot;, &quot;TOPLEFT&quot;, compactmode, &quot;BOTTOMLEFT&quot;, 0, -GAP)
+	textpopup.tiptext = &quot;Show warning text when spell is about to break.  Uses the value set for break threshold.&quot;
+	textpopup:SetScript(&quot;OnClick&quot;, function(self) checksound(self); ControlFreak.db.char.textpopup = not ControlFreak.db.char.textpopup end)
+	textpopup:SetChecked(ControlFreak.db.char.textpopup)
+
+
 	local threshslider, threshslidertext, threshcontainer = tekslider.new(frame, &quot;Break Threshold: &quot;..ControlFreak.db.char.breakthreshold..&quot; sec&quot;, 0, 50, &quot;LEFT&quot;, frame, &quot;TOP&quot;, GAP, 0)
 	threshcontainer:SetPoint(&quot;TOP&quot;, lockpos, &quot;TOP&quot;, 0, 0)
-	threshslider.tiptext = &quot;Time (in seconds) before spell breaks to unfade frame.&quot;
+	threshslider.tiptext = &quot;Time (in seconds) before spell breaks to unfade frame.  Also shows warning text if enabled.&quot;
 	threshslider:SetValue(ControlFreak.db.char.breakthreshold)
 	threshslider:SetValueStep(1)
 	threshslider:SetScript(&quot;OnValueChanged&quot;, function()</diff>
      <filename>Config.lua</filename>
    </modified>
    <modified>
      <diff>@@ -235,7 +235,7 @@ function ControlFreak:StopTimer()
 end
 
 
-local shortnotes = {[&quot;Control Freak&quot;] = &quot;CF&quot;, Invalid = &quot;Inv&quot;, Controlled = &quot;Ctr&quot;, Damage = &quot;Dmg&quot;, Loose = &quot;L&quot;, Ready = &quot;Rdy&quot;, Dead = &quot;D&quot;}
+local pastthreshold, shortnotes = false, {[&quot;Control Freak&quot;] = &quot;CF&quot;, Invalid = &quot;Inv&quot;, Controlled = &quot;Ctr&quot;, Damage = &quot;Dmg&quot;, Loose = &quot;L&quot;, Ready = &quot;Rdy&quot;, Dead = &quot;D&quot;}
 function ControlFreak:OnUpdate(elapsed)
 	local self = ControlFreak
 	self.elapsed = self.elapsed or 0
@@ -261,7 +261,7 @@ function ControlFreak:OnUpdate(elapsed)
 				timeLeft = select(7, UnitDebuff(unit, controlled[unit]))
 				if timeLeft then timeLeft = timeLeft - GetTime() end
 				color, note = &quot;cyan&quot;, timeLeft and string.format(&quot;Controlled (%ds)&quot;, timeLeft) or &quot;Controlled&quot;
-				if timeLeft and timeLeft &lt;= self.db.char.breakthreshold then alpha = 1.0 end
+				if timeLeft and timeLeft &lt;= (self.db.char.breakthreshold + .5) then alpha = 1.0 end
 			elseif lasthptime and lasthptime &gt;= (GetTime()-damageinterval) then alpha, color, note = 1.0, &quot;red&quot;, &quot;Damage&quot;
 			elseif UnitAffectingCombat(unit) then alpha, color, note = 1.0, &quot;orange&quot;, &quot;Loose&quot;
 			else alpha, color, note = 1.0, &quot;green&quot;, &quot;Ready&quot; end
@@ -283,6 +283,12 @@ function ControlFreak:OnUpdate(elapsed)
 		(clearfocus1 and L[&quot;Click to clear focus\n&quot;] or &quot;&quot;).. (clearfocus2 and L[&quot;Shift-click to clear focus\n&quot;] or &quot;&quot;)..
 		L[&quot;Type /freak or right-click to open config&quot;])
 
+	local nowpastthreshold = timeLeft and timeLeft &lt;= (self.db.char.breakthreshold + .5)
+	if nowpastthreshold and not pastthreshold and self.db.char.textpopup then
+		PlaySound(&quot;RaidBossEmoteWarning&quot;)
+		RaidNotice_AddMessage(RaidBossEmoteFrame, &quot;Crowd control will expire in &quot;..math.floor(timeLeft)..&quot; seconds&quot;, ChatTypeInfo[&quot;RAID_BOSS_EMOTE&quot;])
+	end
+	pastthreshold = nowpastthreshold
 	lego:SetAlpha(alpha)
 	lego:SetBackdropBorderColor(unpack(colors[color]))
 	if self.db.char.compactmode then note = timeLeft and string.format(&quot;%ds&quot;, timeLeft) or shortnotes[note] end</diff>
      <filename>ControlFreak.lua</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ae3841936295255ebf1f0bc54ebf2dad8703a6dd</id>
    </parent>
  </parents>
  <author>
    <name>Tekkub</name>
    <email>tekkub@gmail.com</email>
  </author>
  <url>http://github.com/tekkub/controlfreak/commit/fa827916bffdd4c72e6bc6d0c757ef2ee3823ddd</url>
  <id>fa827916bffdd4c72e6bc6d0c757ef2ee3823ddd</id>
  <committed-date>2008-12-21T13:29:53-08:00</committed-date>
  <authored-date>2008-12-21T13:29:53-08:00</authored-date>
  <message>Add text popup warning when CC is about to expire</message>
  <tree>a29092c23bf9a2d0154d75bdd2e9aa674251b044</tree>
  <committer>
    <name>Tekkub</name>
    <email>tekkub@gmail.com</email>
  </committer>
</commit>
