Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SynapseX Decompiler
- local module = {}
- local Create = require(game.ReplicatedStorage.Modules.Create)
- local ScreenController = require(game.ReplicatedStorage.Modules.ScreenController)
- local Tween = require(game.ReplicatedStorage.Modules.Tween)
- local Util = require(game.ReplicatedStorage.Modules.Util)
- local ButtonColors = require(game.ReplicatedStorage.Modules.ButtonColors)
- local Hotbar = require(game.ReplicatedStorage.Systems.Hotbar)
- local EggHunt2019
- local Translator = require(game.ReplicatedStorage.Modules.Translator)
- local Timetable = require(game.ReplicatedStorage.Systems.Timetable)
- local localPlayer
- local frame = script.Parent.Frame
- local window = frame.Window
- local windowObject
- local isOpen = frame.Visible
- local isSmall = script.Parent.Parent.Name == "Small"
- if isSmall then
- window.AnchorPoint = Vector2.new(0.5, 0.5)
- window.Position = UDim2.new(0.5, 0, 0.5, 0)
- window.Size = UDim2.new(1, -8, 1, -8)
- end
- local function get(name, parent)
- return (parent or frame):FindFirstChild(name, true) or error("Cannot find `" .. tostring(name) .. "` (" .. typeof(name) .. ") in " .. (parent or frame):GetFullName())
- end
- local header = window.Header
- function module:ShowEggHunt()
- local cards
- cards = EggHunt2019:GetReportCards(localPlayer)
- for cardName, cardInfo in next, cards, nil do
- local cardGui = get(cardName, get("EggProgress"))
- local missingVisible = not cardInfo.grade and true or false
- local partialVisible = not missingVisible and not cardInfo.check
- local completeVisible = cardInfo.check
- local mainGuiName = missingVisible and "Missing" or partialVisible and "Partial" or completeVisible and "Complete"
- get("Missing", cardGui).Visible = missingVisible
- get("Partial", cardGui).Visible = partialVisible
- get("Complete", cardGui).Visible = completeVisible
- if cardInfo.grade then
- get("GradeLabel", get(mainGuiName, cardGui)).Text = cardInfo.grade
- end
- Translator:FormatImageWithFallback(get("Logo", cardGui), EggHunt2019.GuiInfo[cardName].logo, EggHunt2019.GuiInfo[cardName].fallback)
- end
- local hasEgg = EggHunt2019:DoesPlayerHaveEgg(localPlayer)
- if hasEgg then
- get("BaseBackground", get("EggProgress")).ImageTransparency = 0.9
- get("Win", get("EggProgress")).Visible = true
- print("dbg:", "WON EGG!")
- else
- get("BaseBackground", get("EggProgress")).ImageTransparency = 0.4
- get("Win", get("EggProgress")).Visible = false
- print("dbg:", "HAS NOT WON EGG!")
- end
- end
- function module:Init()
- localPlayer = game.Players.LocalPlayer
- EggHunt2019 = require(game.ReplicatedStorage.Modules.EggHunt2019)
- end
- function module:Start()
- windowObject = Create.Create(isSmall and "FullscreenMobileWindow" or "Window", {rbx = window})
- Create.Create("PressyButton", {
- rbx = header.Close
- })
- header.Close.CaptureButton.MouseButton1Click:connect(module.Close)
- local teleportButton = frame:FindFirstChild("TeleportButton", true)
- Create.Create("PressyButton", {rbx = teleportButton})
- teleportButton.CaptureButton.MouseButton1Click:Connect(function()
- Timetable:Teleport("Minigame Arena")
- end)
- Util.FastSpawn(function()
- EggHunt2019:WaitUntilEnabled()
- Hotbar:AddButtonToHotbar("EggHunt2019", {
- clickCallback = module.Toggle,
- foreground = "rbxassetid://2956411726",
- index = 100
- })
- EggHunt2019:WaitUntilDisabled()
- Hotbar:RemoveButtonFromHotbar("EggHunt2019")
- end)
- end
- function module:IsOpen()
- return isOpen
- end
- function module:Open()
- windowObject:Open()
- if not isOpen then
- frame.Visible = true
- isOpen = true
- self:ShowEggHunt()
- if isSmall then
- ScreenController.MobileHUDLock:Lock("EggHunt2019")
- windowObject:Open()
- end
- end
- end
- function module:Close()
- windowObject:Close()
- frame.Visible = false
- isOpen = false
- if isSmall then
- ScreenController.MobileHUDLock:Unlock("EggHunt2019")
- windowObject:Close()
- end
- end
- function module:Toggle()
- if isOpen then
- module:Close()
- else
- module:Open()
- end
- end
- return module
Add Comment
Please, Sign In to add comment