<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -35,6 +35,15 @@ frame:SetScript(&quot;OnShow&quot;, function()
 	end)
 
 
+	local bindwheel = tekcheck.new(frame, nil, &quot;Bind mousewheel&quot;, &quot;TOPLEFT&quot;, showunit, &quot;BOTTOMLEFT&quot;, 0, -GAP)
+	bindwheel.tiptext = &quot;Bind to mousewheel when out of combat and needs are present.&quot;
+	bindwheel:SetScript(&quot;OnClick&quot;, function(self)
+		checksound(self)
+		Cork.db.bindwheel = not Cork.db.bindwheel
+		Cork.UpdateMouseBinding()
+	end)
+
+
 	local tooltiplimit, tooltiplimittext, ttlcontainer = LibStub(&quot;tekKonfig-Slider&quot;).new(frame, &quot;Tooltip Limit: &quot; .. Cork.dbpc.tooltiplimit, 0, 40, &quot;TOP&quot;, showanchor, &quot;TOP&quot;)
 	ttlcontainer:SetPoint(&quot;LEFT&quot;, frame, &quot;CENTER&quot;, GAP*5/2, 0)
 	tooltiplimit.tiptext = &quot;The number of units to show in the Cork tooltip.&quot;
@@ -58,7 +67,7 @@ frame:SetScript(&quot;OnShow&quot;, function()
 		end)
 
 --~ 		castonpets = tekcheck.new(frame, nil, &quot;Cast on group pets&quot;, &quot;TOPLEFT&quot;, groupthreshcont, &quot;BOTTOMLEFT&quot;, -GAP*2, 0)
-		castonpets = tekcheck.new(frame, nil, &quot;Cast on group pets&quot;, &quot;TOPLEFT&quot;, showunit, &quot;BOTTOMLEFT&quot;, 0, -GAP)
+		castonpets = tekcheck.new(frame, nil, &quot;Cast on group pets&quot;, &quot;TOPLEFT&quot;, bindwheel, &quot;BOTTOMLEFT&quot;, 0, -GAP)
 		castonpets.tiptext = &quot;Pets need buffs too!  When disabled you can still cast on a pet by targetting it directly.&quot;
 		castonpets:SetScript(&quot;OnClick&quot;, function(self)
 			checksound(self)
@@ -68,7 +77,7 @@ frame:SetScript(&quot;OnShow&quot;, function()
 	end
 
 
-	local group = LibStub(&quot;tekKonfig-Group&quot;).new(frame, &quot;Modules&quot;, &quot;TOP&quot;, castonpets or showunit, &quot;BOTTOM&quot;, 0, -27)
+	local group = LibStub(&quot;tekKonfig-Group&quot;).new(frame, &quot;Modules&quot;, &quot;TOP&quot;, castonpets or bindwheel, &quot;BOTTOM&quot;, 0, -27)
 	group:SetPoint(&quot;LEFT&quot;, EDGEGAP, 0)
 	group:SetPoint(&quot;BOTTOMRIGHT&quot;, -EDGEGAP, EDGEGAP)
 
@@ -121,6 +130,7 @@ frame:SetScript(&quot;OnShow&quot;, function()
 	local function Update(self)
 		showanchor:SetChecked(Cork.db.showanchor)
 		showunit:SetChecked(Cork.db.showunit)
+		bindwheel:SetChecked(Cork.db.bindwheel)
 		if castonpets then castonpets:SetChecked(Cork.dbpc.castonpets) end
 		if groupthresh then groupthresh:SetValue(Cork.dbpc.multithreshold) end
 		for i,row in pairs(rows) do</diff>
      <filename>Config.lua</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ local ldb, ae = LibStub:GetLibrary(&quot;LibDataBroker-1.1&quot;), LibStub(&quot;AceEvent-3.0&quot;)
 
 Cork = {petmappings = {player = &quot;pet&quot;}, defaultspc = {castonpets = false, multithreshold = 2, tooltiplimit = 10}, corks = {}, petunits = {pet = true}, keyblist = {CorkIt = true, type = true, Scan = true, Init = true, configframe = true}}
 local corks = Cork.corks
-local defaults = {point = &quot;TOP&quot;, x = 0, y = -100, showanchor = true, showunit = false}
+local defaults = {point = &quot;TOP&quot;, x = 0, y = -100, showanchor = true, showunit = false, bindwheel = false}
 local tooltip, anchor
 
 for i=1,4 do Cork.petmappings[&quot;party&quot;..i], Cork.petunits[&quot;partypet&quot;..i] = &quot;partypet&quot;..i, true end</diff>
      <filename>Cork.lua</filename>
    </modified>
    <modified>
      <diff>@@ -1,49 +1,26 @@
 
 -- Dynamic mousewheel binding module, originally created by Adirelle &lt;gperreal@free.fr&gt;
 
-local CORKNAME = &quot;Mousewheel Bindings&quot;
-
-local dataobj =  LibStub('LibDataBroker-1.1'):NewDataObject(&quot;Cork &quot;..CORKNAME, {type='cork'})
-local frame
-local keys = { 'MOUSEWHEELUP', 'MOUSEWHEELDOWN' }
-
-------------------------------------------------------------------------------
--- Binding update
-------------------------------------------------------------------------------
-
 local function ClearBindings()
 	if InCombatLockdown() then return end
-	ClearOverrideBindings(frame)
+	ClearOverrideBindings(CorkFrame)
 end
 
-local function UpdateBindings()
+function Cork:UpdateMouseBinding(event, unit)
 	if InCombatLockdown() then return end
-	if Cork.dbpc[CORKNAME..&quot;-enabled&quot;] and Corkboard:IsVisible() and not IsStealthed() and not IsFlying() and not IsMounted() then
-		for i,key in ipairs(keys) do
-			SetOverrideBindingClick(frame, true, key, 'CorkFrame')
-		end
+	if Cork.db.bindwheel and (event ~= &quot;PLAYER_REGEN_DISABLED&quot;) and Corkboard:IsVisible() then
+		SetOverrideBindingClick(CorkFrame, true, 'MOUSEWHEELUP', 'CorkFrame')
+		SetOverrideBindingClick(CorkFrame, true, 'MOUSEWHEELDOWN', 'CorkFrame')
 	else
-		ClearBindings()
+		ClearOverrideBindings(CorkFrame)
 	end
 end
 
-------------------------------------------------------------------------------
--- Addon setup
-------------------------------------------------------------------------------
 
-function dataobj:Init()
-	Cork.defaultspc[CORKNAME..'-enabled'] = true
-
-	frame = CreateFrame('Frame', 'CorkWheelFrame', Corkboard)
-	frame:SetAllPoints(Corkboard)
-	frame:SetScript('OnShow', UpdateBindings)
-	frame:SetScript('OnHide', ClearBindings)
-	frame:Show()
-
-	local AE = LibStub('AceEvent-3.0')
-	AE.RegisterEvent(self, 'PLAYER_AURAS_CHANGED', UpdateBindings)
-	AE.RegisterEvent(self, 'PLAYER_REGEN_ENABLED', UpdateBindings)
-	AE.RegisterEvent(self, 'PLAYER_REGEN_DISABLED', ClearBindings)
-end
+local frame = CreateFrame('Frame', nil, Corkboard)
+frame:SetScript('OnShow', Cork.UpdateMouseBinding)
+frame:SetScript('OnHide', ClearBindings)
 
-dataobj.Scan = UpdateBindings
+frame:SetScript(&quot;OnEvent&quot;, Cork.UpdateMouseBinding)
+frame:RegisterEvent('PLAYER_REGEN_ENABLED')
+frame:RegisterEvent('PLAYER_REGEN_DISABLED')</diff>
      <filename>Mousewheel.lua</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6fd4c085ccaacb6f8bb6765f8a873babd8e46849</id>
    </parent>
  </parents>
  <author>
    <name>Tekkub</name>
    <email>tekkub@gmail.com</email>
  </author>
  <url>http://github.com/tekkub/cork/commit/7cecf3e3753e6515086c201af9034d957e244269</url>
  <id>7cecf3e3753e6515086c201af9034d957e244269</id>
  <committed-date>2008-09-15T00:40:12-07:00</committed-date>
  <authored-date>2008-09-15T00:40:12-07:00</authored-date>
  <message>Simplify mousewheel binding</message>
  <tree>2288cc646bc398c2c5a1a8e51fa129c75125863b</tree>
  <committer>
    <name>Tekkub</name>
    <email>tekkub@gmail.com</email>
  </committer>
</commit>
