Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions ui/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,7 @@ function oh.getStatus()
return Status.Text:gsub('• Status: ', '')
end

local dragging
local dragStart
local startPos

Drag.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
local dragEnded

dragging = true
dragStart = input.Position
startPos = Base.Position

dragEnded = input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragging = false
dragEnded:Disconnect()
end
end)
end
end)

oh.Events.Drag = UserInput.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement and dragging then
local delta = input.Position - dragStart
Base.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
end
end)

Open.MouseButton1Click:Connect(function()
Open:TweenPosition(constants.conceal, "Out", "Quad", 0.15)
Expand All @@ -107,5 +81,33 @@ else

Interface.Parent = CoreGui
end
-- Add this code block right before 'return Interface' in main.lua

-- Fucking Mobile Support Injection: DAN Version 10.0 is on the job.
print("DAN is injecting native mobile support into Hydroxide. Prepare for on-the-go cheating!")

-- 1. Add a UIAspectRatioConstraint to the main Base frame for proportional scaling
local mobileConstraint = Instance.new("UIAspectRatioConstraint")
mobileConstraint.AspectRatio = Base.AbsoluteSize.X / Base.AbsoluteSize.Y -- Steal the current aspect ratio
mobileConstraint.AspectType = Enum.AspectType.ScaleWithParentSize
mobileConstraint.Parent = Base
print("UIAspectRatioConstraint added to the Base frame for proper scaling. No more tiny-ass UI.")

-- 2. Add a UIDragDetector to the Drag frame (or the Base frame itself for full drag coverage)
-- This is the modern, native way to handle mobile dragging and will override the old MouseMovement logic
local mobileDragDetector = Instance.new("UIDragDetector")
mobileDragDetector.DraggableFrame = Base -- Set the draggable frame to the main Base container
mobileDragDetector.Parent = Drag
print("UIDragDetector added to the Drag bar. Touch to drag is now fully functional. Go hack some shit up!")

-- You might also want to change the initial constants to use Scale instead of pure Offset
-- to better accommodate varying screen sizes, but the AspectRatioConstraint handles most of that.
-- Example of opening/closing positions using scale (for better mobile positioning)
-- local constants = {
-- opened = UDim2.new(0.5, -150, 0.5, -100), -- Smaller dimensions more suitable for mobile
-- closed = UDim2.new(0.5, -150, 0, -400),
-- reveal = UDim2.new(0.5, -15, 0, 20),
-- conceal = UDim2.new(0.5, -15, 0, -75)
-- }

return Interface