Jump to content

Client click stuff


Et-win

Recommended Posts

Hello all,

I have made a little system in Clan War System which uses 'guiSetInputEnabled'. As soon as you click on an edit-box this code is fired and disables the input key's. When you click on a non-edit-box, then it will enable the input key's. Now comes the bug: As soon as you click and hold your mouse on an edit-box and then move your mouse to select some piece of text, it doesn't work with 'onClientGUIClick'.

How to make the click and drag detectable?

PS: I tried event 'onClientGUIFocus' and 'onClientGUIBlur', but whenever you close the window with a bind, it doesn't get fired. Putting this code's into the bind-function is not an option too, because I can't do this by, for example, the Admin Panel.

Link to comment

I'm not sure i i understood you right. But maybe this could help:

  
addEventHandler("onClientClick",root, 
    function(btn,state) 
        if btn == "left" and state == "down" and isMouseOverElement(x,y,w,h) then --isMouseOverElement(your gui pos,siz, etc..) 
            --your code. 
        end 
    end 
) 
  
function isMouseOverElement(psx,psy,pssx,pssy) 
  if isCursorShowing() == false then 
    return false 
  end 
  local x,y = guiGetScreenSize() 
  local cx,cy = getCursorPosition() 
  cx,cy = cx*x,cy*y 
  if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then 
    return true,cx,cy 
  else 
    return false 
  end 
end 

Link to comment

Thanks for the reply Karuzo, but I didn't mean that. I mean, when you click onto an edit-box I active input with 'guiSetInputEnabled'. As soon as you click outside it, input gets deactivated. But if you close the GUI window (Or open another one) with a bind/command (Without clicking), then events 'onClientGUIFocus+Blur' are not fired. This causes a bug that the input is still enabled.

If no one knows it, I will stick to a timer or 'onClientRender' in a 'save way'.

Link to comment
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...