Фух блядь

This commit is contained in:
IgorTimofeev 2024-01-27 19:26:12 +03:00
parent 1b686708ea
commit 7f36d4f7a1
2 changed files with 89 additions and 101 deletions

View File

@ -376,7 +376,6 @@ local function workspaceStart(workspace, eventPullTimeout)
local local
e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32,
isScreenEvent, isScreenEvent,
checkBounds,
roundedX, roundedX,
roundedY, roundedY,
capturedObject, capturedObject,
@ -385,92 +384,93 @@ local function workspaceStart(workspace, eventPullTimeout)
animationOnFinishMethodsIndex, animationOnFinishMethodsIndex,
animationOnFinishMethods animationOnFinishMethods
local processObject, processContainer local function processObject(object, boundsX1, boundsY1, boundsX2, boundsY2)
local govno = false
processObject = function(child, boundsX1, boundsY1, boundsX2, boundsY2) if isScreenEvent then
-- Container if workspace.capturedObject then
if child.children then if workspace.capturedObject == object then
newBoundsX1, newBoundsY1, newBoundsX2, newBoundsY2 = getRectangleBounds(
boundsX1,
boundsY1,
boundsX2,
boundsY2,
child.x,
child.y,
child.x + child.width - 1,
child.y + child.height - 1
)
if elseif object.ignoresCapturedObject then
newBoundsX1 if not boundsX1 or not (
and processContainer( roundedX >= boundsX1
child, and roundedX <= boundsX2
newBoundsX1, and roundedY >= boundsY1
newBoundsY1, and roundedY <= boundsY2
newBoundsX2, ) then
newBoundsY2 goto pizda
) end
then else
return true goto pizda
end
else
if
not boundsX1 or not (
roundedX >= boundsX1
and roundedX <= boundsX2
and roundedY >= boundsY1
and roundedY <= boundsY2
)
then
goto pizda
else
govno = not object.passScreenEvents
end
end end
-- Not container if object.eventHandler and not object.disabled then
object.eventHandler(workspace, object, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32)
end
else else
if isScreenEvent then if
if not checkBounds or child:isPointInside(roundedX, roundedY)then not workspace.capturedObject
if child.eventHandler and not child.disabled then or workspace.capturedObject == object
child.eventHandler(workspace, child, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32) or object.ignoresCapturedObject
end then
if object.eventHandler and not object.disabled then
object.eventHandler(workspace, object, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32)
end
end
end
if not child.passScreenEvents then
-- Container
::pizda::
if object.children and boundsX1 then
local child, newBoundsX1, newBoundsY1, newBoundsX2, newBoundsY2
for i = #object.children, 1, -1 do
child = object.children[i]
if not child.hidden then
newBoundsX1, newBoundsY1, newBoundsX2, newBoundsY2 = getRectangleBounds(
boundsX1,
boundsY1,
boundsX2,
boundsY2,
child.x,
child.y,
child.x + child.width - 1,
child.y + child.height - 1
)
if processObject(
child,
newBoundsX1,
newBoundsY1,
newBoundsX2,
newBoundsY2
) then
return true return true
end end
end end
elseif child.eventHandler then
child.eventHandler(workspace, child, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32)
end
end
end
processContainer = function(currentContainer, boundsX1, boundsY1, boundsX2, boundsY2)
local currentContainerPassed, child, newBoundsX1, newBoundsY1, newBoundsX2, newBoundsY2
if isScreenEvent then
if checkBounds and not (
roundedX >= boundsX1
and roundedX <= boundsX2
and roundedY >= boundsY1
and roundedY <= boundsY2
) then
return
end
if currentContainer.eventHandler and not currentContainer.disabled then
currentContainer.eventHandler(workspace, currentContainer, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32)
end
currentContainerPassed = not currentContainer.passScreenEvents
elseif currentContainer.eventHandler then
currentContainer.eventHandler(workspace, currentContainer, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31, e32)
end
for i = #currentContainer.children, 1, -1 do
child = currentContainer.children[i]
if not child.hidden then
checkBounds = true
if processObject(child, boundsX1, boundsY1, boundsX2, boundsY2) then
return true
end
end end
end end
if currentContainerPassed then if govno then
return true return true
end end
end end
@ -491,31 +491,13 @@ local function workspaceStart(workspace, eventPullTimeout)
roundedX, roundedY = math.ceil(e3), math.ceil(e4) roundedX, roundedY = math.ceil(e3), math.ceil(e4)
end end
capturedObject = workspace.capturedObject processObject(
workspace,
if capturedObject then workspace.x,
if not capturedObject.hidden then workspace.y,
checkBounds = false workspace.x + workspace.width - 1,
workspace.y + workspace.height - 1
processObject( )
capturedObject,
workspace.x,
workspace.y,
workspace.x + workspace.width - 1,
workspace.y + workspace.height - 1
)
end
else
checkBounds = true
processContainer(
workspace,
workspace.x,
workspace.y,
workspace.x + workspace.width - 1,
workspace.y + workspace.height - 1
)
end
if workspace.animations then if workspace.animations then
animationIndex, animationOnFinishMethodsIndex, animationOnFinishMethods = 1, 1, {} animationIndex, animationOnFinishMethodsIndex, animationOnFinishMethods = 1, 1, {}

View File

@ -1333,6 +1333,8 @@ local function iconFieldUpdateFileList(iconField)
) )
anyIconFieldAddIcon(iconField, icon) anyIconFieldAddIcon(iconField, icon)
icon.ignoresCapturedObject = true
icon.eventHandler = iconFieldIconEventHandler icon.eventHandler = iconFieldIconEventHandler
iconField:addChild(icon) iconField:addChild(icon)
@ -2934,9 +2936,13 @@ function system.updateWorkspace()
-- Clearing workspace -- Clearing workspace
workspace:removeChildren() workspace:removeChildren()
workspace.ignoresCapturedObject = true
-- Creating desktop background object -- Creating desktop background object
local oldDraw = desktopBackground and desktopBackground.draw
desktopBackground = workspace:addChild(GUI.object(1, 1, workspace.width, workspace.height)) desktopBackground = workspace:addChild(GUI.object(1, 1, workspace.width, workspace.height))
desktopBackground.ignoresCapturedObject = true
local oldDraw = desktopBackground and desktopBackground.draw
desktopBackground.draw = oldDraw or desktopBackgroundAmbientDraw desktopBackground.draw = oldDraw or desktopBackgroundAmbientDraw
end end