Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: zamknięcie
1. Button nie reaguje na zamknięcie
Witam, przychodz? mo?e i ze zbyt prostym problemem, ale podczas nauki LUA nie mog? zamkn?? gui, a przycisk nie reaguje. GUI zrobione jest w dxdraw.


addEvent
("okno",true)
addEventHandler("okno", root, function(value)
if 
not value then return end
tekst 
= value
showCursor
(true)
addEventHandler("onClientRender", root, ostrzezenie)
        function 
warnClose()
            if 
isMouseIn(screenW * 0.5555, screenH * 0.5875, screenW * 0.1008, screenH * 0.0653) then -- miejsce buttona
            
if value then
                removeEventHandler
("onClientRender", root, ostrzezenie)
                
end
            end
        end
       end
)


isMouseIn jakby kto? potrzebowa?, ale jestem pewny, ?e to dzia?a:

function isMouseIn ( x, y, width, height )
    if ( 
not isCursorShowing( ) ) then
        
return false
    end
    local sx
, sy = guiGetScreenSize ( )
    
local cx, cy = getCursorPosition ( )
    
local cx, cy = ( cx * sx ), ( cy * sy )
    if ( 
cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
        
return true
    
else
        return 
false
    end
end


Za pomoc stawiam :piwo: