View Single Post
  #15  
Unread 06-02-2011, 01:16 PM
Fortunis's Avatar
Fortunis Fortunis is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Location: Leeds, UK
Posts: 72
Ok, i got it to work and tweaked it to do everything i need it to for Mouse Cursor Highlighter Advanced.

Decided to post my part of the code for others to get an idea of what to add/do..
  • OptionsWindow is the menu window
  • mcha is the mouse cursor highlighter
  • WasOn and WasOnn are variables to help the code know that they were on previously, so they appear when F12 brings the UI back to visible.
The two IF statement parts at the bottom (outside the function) couldnt be introduced into the function code as this contradicted each other and caused either the option window to stay on even after trying to close it via the cross in its upper right, or do a few other anomolies.

Code:
self:SetWantsKeyEvents(true);
    
    self.KeyDown = function(sender,args)
    
        if (args.Action == 268435635)then
            if(OptionsWindow:IsVisible() == true)then
                WasOn = 1;
            elseif WasOn == 1 then
                OptionsWindow:SetVisible(true);
                WasOn = 0;
            end
            if(mcha:IsVisible() == true)then
                WasOnn = 1;
            elseif WasOnn == 1 then
                WasOnn = 0;
            end
        end
    
    end
    
    if WasOn == 1 then
        OptionsWindow:SetVisible(false);
    end
    
    if WasOnn == 1 then
        mcha:SetVisible(false);
    else
        mcha:SetVisible(true);
    end

Last edited by Fortunis : 06-03-2011 at 03:16 AM.
Reply With Quote