I have my ClientManager, which manages basically everything inside the UI. It then requires each Module that controls it’s own section of the UI.
local infoManager = require(info.YY.InfoManager)
local mainManager = require(main.YY.MainManager)
However, from within these modules, I’m trying to return values back, so I don’t have to use the same functions over and over again. For example of infoManager
local infoManager = {}
local frame = script.Parent
local info = frame.Parent
local hud = info.Parent
local clientManager = require(hud.ClientManager)
local back = frame:WaitForChild('Back')
back.Activated:Connect(function()
clientManager:Button(back, info)
end)
return infoManager
And back inside the ClientManager;
function clientManager:Button(button, frame)
tween:New(button):Play()
if button.Name == 'Back' then
frame:TweenPosition(UDim2.new(0, 0, -1, 0), 'In', 'Back', 1, false)
wait(1)
main:TweenPosition(UDim2.new(0, 0, 0.5, 0), 'Out', 'Back', 1, false)
elseif button.Name == 'Play' then
frame:TweenPosition(UDim2.new(0, 0, 1.25, 0), 'In', 'Back', 1, false)
wait(1)
load:TweenPosition(UDim2.new(0, 0, 0.5, 0), 'Out', 'Back', 1, false)
elseif button.Name == 'Info' then
frame:TweenPosition(UDim2.new(0, 0, 1.25, 0), 'In', 'Back', 1, false)
wait(1)
info:TweenPosition(UDim2.new(0, 0, 0.4, 0), 'Out', 'Back', 1, false)
end
end
I do not want this all done in the seperate modules, because then I’d need to have multiple tween modules (or else a ton of .Parent.Parent.Parent to get to the TweenModule)
Any tips would be greatly appreacited!