Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CursorGlow_OnLoad()
- CursorGlowGlow:SetAlpha(0.5);
- CursorGlowGlow:SetVertexColor(0.7,0.7,1);
- this:SetAlpha(0);
- this.lastX = 0;
- this.lastY = 0;
- this.angle = 0;
- end
- local origSetCursor = SetCursor;
- function SetCursor(cursor)
- if ( cursor == "CAST_CURSOR" ) then
- CursorGlowFrame.nofade = 1;
- else
- CursorGlowFrame.nofade = nil;
- end
- return origSetCursor(cursor);
- end
- local origResetCursor = ResetCursor;
- function ResetCursor()
- CursorGlowFrame.nofade = nil;
- return origResetCursor();
- end
- function CursorGlow_OnUpdate(elapsed)
- local curX, curY = GetCursorPosition();
- if ( curX ~= this.lastX or curY ~= this.lastY ) then
- local scale = UIParent:GetScale();
- this:SetPoint("CENTER", "UIParent", "BOTTOMLEFT", curX/scale, curY/scale );
- this.fade = nil;
- elseif ( not this.fade ) then
- this.fade = 1.5;
- end
- CursorGlowGlow:Hide();
- local r,g,b = 0.5,0.5,0.5;
- if ( SpellIsTargeting() ) then
- CursorGlowGlow:Show();
- CursorGlowTexture:SetTexture("Spells\\AuraRune8");
- if ( SpellCanTargetUnit("mouseover") or this.nofade ) then
- CursorGlowGlow:SetAlpha(0.5);
- r,g,b=0.3,0.3,1;
- else
- CursorGlowGlow:SetAlpha(0.15);
- r,g,b=0.8,0.8,0.8;
- end
- this.fade = nil;
- else
- CursorGlowTexture:SetTexture("Spells\\AuraRune256");
- if ( UnitIsEnemy("player","mouseover") ) then
- r,g,b=0.5,0,0;
- elseif ( UnitIsFriend("player","mouseover") ) then
- r,g,b=0.25,0.75,0.25;
- end
- if ( IsControlKeyDown() ) then
- r,g,b=r*2,g*2,b*2;
- this.fade = nil;
- end
- end
- CursorGlowTexture:SetVertexColor(r,g,b);
- if ( this.fade and not this.nofade ) then
- this.fade = this.fade - elapsed;
- if ( this.fade > 0 ) then
- this:SetAlpha(1 * min((this.fade/1),1));
- else
- this:SetAlpha(0);
- end
- else
- this:SetAlpha(1);
- end
- this.lastX = curX;
- this.lastY = curY;
- -- Iriel's spinny code
- this.angle = this.angle + (arg1 / 30);
- local a = math.deg(this.angle - 45);
- local l = 1;
- local s = math.sin(a) * 0.75;
- local c = math.cos(a) * 0.75;
- local f = CursorGlowTexture;
- f:SetTexCoord(0.5-s, 0.5+c,
- 0.5+c, 0.5+s,
- 0.5-c, 0.5-s,
- 0.5+s, 0.5-c);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement