Advertisement
Happygamer1983

Untitled

Nov 14th, 2021
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.80 KB | None | 0 0
  1. local WindowHandlerModule = {}
  2. local SaveFolder = game.Players.LocalPlayer:WaitForChild("2DGMProjects")
  3. local ContextMenu = script.Parent.Parent["2DGMContextMenu"]
  4. local SendCodeToServer = game.ReplicatedStorage.WebhookEvent
  5. local Mouse = game.Players.LocalPlayer:GetMouse()
  6.  
  7. local DataModule = require(script.Parent.Parent.Parent.Parent.SystemFiles.DLLs.LimeDataModule)
  8. local LimeErrorModule = require(script.Parent.Parent.Parent.Parent.SystemFiles.DLLs.LimeErrorModule)
  9. local HTTPGuiEncoder = require(script.Parent.Parent.Parent.Parent.SystemFiles.DLLs.HTTPGuiEncoder)
  10. local LimeExplorer = require(script.Parent.Parent.Parent.Parent.SystemFiles.DLLs.LimeExplorer)
  11.  
  12. local GameEditor = script.Parent.MainFrame.GameEditor
  13. local GameExplorer = GameEditor.Explorer
  14. local GameUI = GameEditor.GameUI
  15. local Props = GameEditor.Properties
  16. local SaveButton = GameEditor.Save
  17. local DeleteButton = GameEditor.Delete
  18.  
  19. local Run = script.Parent.OptionsBar.Run
  20. local OCE = script.Parent.OptionsBar.OpenCodeEditor
  21. local SaveProButton = script.Parent.OptionsBar.Save
  22.  
  23. local NewProjectPage = script.Parent.MainFrame.NewProject
  24. local LoadingScreen = script.Parent.MainFrame.LoadingScreen
  25. local GameEditorPage = script.Parent.MainFrame.GameEditor
  26. local CreateProjectPage = script.Parent.MainFrame.CreateProject
  27. local CodeEditorPage = script.Parent.MainFrame.CodeEditor
  28. local OpenProjectPage = script.Parent.MainFrame.OpenProject
  29.  
  30. local GameName = "Default"
  31. local LoadedSave = nil
  32.  
  33. --TODO////////////////////////////////////////////////////////////////////////////-- Publish Project
  34. local PublishProjectFunc = function(Data,ProjectScript)
  35.     local EncodedData = HTTPGuiEncoder.Encrypt(Data)
  36.    
  37.     SendCodeToServer:FireServer(EncodedData,"2DGM",ProjectScript)
  38. end
  39.  
  40. local PubButton = script.Parent.OptionsBar.Publish
  41.  
  42. PubButton.MouseButton1Click:Connect(function()
  43.     if LoadedSave == nil then
  44.         warn("No save loaded cannot publish")
  45.     elseif LoadedSave == "1" then
  46.         print("1 is loaded")
  47.         print(script.Parent.MainFrame.GameEditor.GameUI:GetChildren())
  48.         PublishProjectFunc(script.Parent.MainFrame.GameEditor.GameUI:GetChildren(),SaveFolder.Project_1_Script.Value)
  49.     elseif LoadedSave == "2" then
  50.         print("2 is loaded")
  51.        
  52.     elseif LoadedSave == "3" then
  53.         print("3 is loaded")
  54.        
  55.     elseif LoadedSave == "4" then
  56.         print("4 is loaded")
  57.        
  58.     end
  59. end)
  60.  
  61.  
  62. --TODO////////////////////////////////////////////////////////////////////////////-- Open Project stuff
  63. local OpenProButton = script.Parent.OptionsBar.Open
  64. local OpenProButton2 = script.Parent.MainFrame.NewProject.OpenExistingProject
  65. local OpenButton1 = script.Parent.MainFrame.OpenProject.Project1.TextButton
  66. local OpenButton2 = script.Parent.MainFrame.OpenProject.Project2.TextButton
  67. local OpenButton3 = script.Parent.MainFrame.OpenProject.Project3.TextButton
  68. local OpenButton4 = script.Parent.MainFrame.OpenProject.Project4.TextButton
  69.  
  70. local EraseButton1 = script.Parent.MainFrame.OpenProject.Project1.TextButton2
  71. local EraseButton2 = script.Parent.MainFrame.OpenProject.Project2.TextButton2
  72. local EraseButton3 = script.Parent.MainFrame.OpenProject.Project3.TextButton2
  73. local EraseButton4 = script.Parent.MainFrame.OpenProject.Project4.TextButton2
  74.  
  75. local SaveInfo1 = script.Parent.MainFrame.OpenProject.Project1.TextLabel2
  76. local SaveInfo2 = script.Parent.MainFrame.OpenProject.Project2.TextLabel2
  77. local SaveInfo3 = script.Parent.MainFrame.OpenProject.Project3.TextLabel2
  78. local SaveInfo4 = script.Parent.MainFrame.OpenProject.Project4.TextLabel2
  79.  
  80. local OpenOpen = false
  81.  
  82. OpenProButton.MouseButton1Click:Connect(function()
  83.     if OpenOpen == false then
  84.         OpenProjectPage.Visible = true
  85.         OpenProButton.Text = "Close"
  86.         OpenOpen = true
  87.     else
  88.         OpenProjectPage.Visible = false
  89.         OpenProButton.Text = "Open"
  90.         OpenOpen = false
  91.     end
  92. end)
  93.  
  94. OpenProButton2.MouseButton1Click:Connect(function()
  95.     OpenProjectPage.Visible = true
  96.     OpenOpen = true
  97.     OpenProButton.Text = "Close"
  98. end)
  99.  
  100. if SaveFolder.Project_1.Value ~= "" then
  101.     SaveInfo1.Text = "Savedata"
  102.     SaveInfo1.TextColor3 = Color3.fromRGB(85, 170, 0)
  103. end
  104.  
  105. if SaveFolder.Project_2.Value ~= "" then
  106.     SaveInfo2.Text = "Savedata"
  107.     SaveInfo2.TextColor3 = Color3.fromRGB(85, 170, 0)
  108. end
  109.  
  110. if SaveFolder.Project_3.Value ~= "" then
  111.     SaveInfo3.Text = "Savedata"
  112.     SaveInfo3.TextColor3 = Color3.fromRGB(85, 170, 0)
  113. end
  114.  
  115. if SaveFolder.Project_4.Value ~= "" then   
  116.     SaveInfo4.Text = "Savedata"
  117.     SaveInfo4.TextColor3 = Color3.fromRGB(85, 170, 0)
  118. end
  119.  
  120. OpenButton1.MouseButton1Click:Connect(function()
  121.     OpenProjectPage.Visible = false
  122.     OpenOpen = false
  123.     OpenProButton.Text = "Open"
  124.     for i,v in pairs(GameExplorer:GetChildren()) do
  125.         if v:IsA("UIListLayout") then
  126.         else
  127.             v.Value.Value:Destroy()
  128.             v:Destroy()
  129.         end
  130.     end
  131.     GameEditor.Visible = false
  132.     OpenProjectPage.Visible = false
  133.     LoadingScreen.Visible = true
  134.     wait(3)
  135.     LoadingScreen.Visible = false
  136.     GameEditor.Visible = true
  137.     HTTPGuiEncoder.Decrypt(SaveFolder.Project_1.Value,GameUI)
  138.     script.Parent.MainFrame.CodeEditor.Frame.Scroll.TextBox.Text = SaveFolder.Project_1_Script.Value
  139.     Run.Visible = true
  140.     OCE.Visible = true
  141.     SaveProButton.Visible = true
  142.     LoadedSave = "1"
  143. end)
  144.  
  145. OpenButton2.MouseButton1Click:Connect(function()
  146.     OpenProjectPage.Visible = false
  147.     OpenOpen = false
  148.     OpenProButton.Text = "Open"
  149.     for i,v in pairs(GameExplorer:GetChildren()) do
  150.         if v:IsA("UIListLayout") then
  151.         else
  152.             v.Value.Value:Destroy()
  153.             v:Destroy()
  154.         end
  155.     end
  156.     GameEditor.Visible = false
  157.     OpenProjectPage.Visible = false
  158.     LoadingScreen.Visible = true
  159.     wait(3)
  160.     LoadingScreen.Visible = false
  161.     GameEditor.Visible = true
  162.     HTTPGuiEncoder.Decrypt(SaveFolder.Project_2.Value,GameUI)
  163.     script.Parent.MainFrame.CodeEditor.Frame.Scroll.TextBox.Text = SaveFolder.Project_2_Script.Value
  164.     Run.Visible = true
  165.     OCE.Visible = true
  166.     SaveProButton.Visible = true
  167.     LoadedSave = "2"
  168. end)
  169.  
  170.  
  171. OpenButton3.MouseButton1Click:Connect(function()
  172.     OpenProjectPage.Visible = false
  173.     OpenOpen = false
  174.     OpenProButton.Text = "Open"
  175.     for i,v in pairs(GameExplorer:GetChildren()) do
  176.         if v:IsA("UIListLayout") then
  177.         else
  178.             v.Value.Value:Destroy()
  179.             v:Destroy()
  180.         end
  181.     end
  182.     GameEditor.Visible = false
  183.     OpenProjectPage.Visible = false
  184.     LoadingScreen.Visible = true
  185.     wait(3)
  186.     LoadingScreen.Visible = false
  187.     GameEditor.Visible = true
  188.     HTTPGuiEncoder.Decrypt(SaveFolder.Project_3.Value,GameUI)
  189.     script.Parent.MainFrame.CodeEditor.Frame.Scroll.TextBox.Text = SaveFolder.Project_3_Script.Value
  190.     Run.Visible = true
  191.     OCE.Visible = true
  192.     SaveProButton.Visible = true
  193.     LoadedSave = "3"
  194. end)
  195.  
  196.  
  197. OpenButton4.MouseButton1Click:Connect(function()
  198.     OpenProjectPage.Visible = false
  199.     OpenOpen = false
  200.     OpenProButton.Text = "Open"
  201.     for i,v in pairs(GameExplorer:GetChildren()) do
  202.         if v:IsA("UIListLayout") then
  203.         else
  204.             v.Value.Value:Destroy()
  205.             v:Destroy()
  206.         end
  207.     end
  208.     GameEditor.Visible = false
  209.     OpenProjectPage.Visible = false
  210.     LoadingScreen.Visible = true
  211.     wait(3)
  212.     LoadingScreen.Visible = false
  213.     GameEditor.Visible = true
  214.     HTTPGuiEncoder.Decrypt(SaveFolder.Project_4.Value,GameUI)
  215.     script.Parent.MainFrame.CodeEditor.Frame.Scroll.TextBox.Text = SaveFolder.Project_4_Script.Value
  216.     Run.Visible = true
  217.     OCE.Visible = true
  218.     SaveProButton.Visible = true
  219.     LoadedSave = "4"
  220. end)
  221.  
  222. EraseButton1.MouseButton1Click:Connect(function()
  223.     DataModule.SendProjectDataToServer("1","","","")
  224. end)
  225.  
  226. EraseButton2.MouseButton1Click:Connect(function()
  227.     DataModule.SendProjectDataToServer("2","","","")
  228. end)
  229.  
  230. EraseButton3.MouseButton1Click:Connect(function()
  231.     DataModule.SendProjectDataToServer("3","","","")
  232. end)
  233.  
  234. EraseButton4.MouseButton1Click:Connect(function()
  235.     DataModule.SendProjectDataToServer("4","","","")
  236. end)
  237.  
  238. --TODO////////////////////////////////////////////////////////////////////////////-- Save Project stuff
  239. local GuiData = GameUI:GetChildren()
  240. local SaveMenu = script.Parent.MainFrame.SaveMenu
  241. local SaveButton1 = script.Parent.MainFrame.SaveMenu.Project1.TextButton
  242. local SaveButton2 = script.Parent.MainFrame.SaveMenu.Project2.TextButton
  243. local SaveButton3 = script.Parent.MainFrame.SaveMenu.Project3.TextButton
  244. local SaveButton4 = script.Parent.MainFrame.SaveMenu.Project4.TextButton
  245.  
  246. local Info1 = script.Parent.MainFrame.SaveMenu.Project1.TextLabel2
  247. local Info2 = script.Parent.MainFrame.SaveMenu.Project2.TextLabel2
  248. local Info3 = script.Parent.MainFrame.SaveMenu.Project3.TextLabel2
  249. local Info4 = script.Parent.MainFrame.SaveMenu.Project4.TextLabel2
  250. local SaveOpen = false
  251.  
  252. if SaveFolder.Project_1.Value ~= "" then
  253.     Info1.Text = "Savedata"
  254.     Info1.TextColor3 = Color3.fromRGB(85, 170, 0)
  255. end
  256.  
  257. if SaveFolder.Project_2.Value ~= "" then
  258.     Info2.Text = "Savedata"
  259.     Info2.TextColor3 = Color3.fromRGB(85, 170, 0)
  260. end
  261.  
  262. if SaveFolder.Project_3.Value ~= "" then
  263.     Info3.Text = "Savedata"
  264.     Info3.TextColor3 = Color3.fromRGB(85, 170, 0)
  265. end
  266.  
  267. if SaveFolder.Project_4.Value ~= "" then   
  268.     Info4.Text = "Savedata"
  269.     Info4.TextColor3 = Color3.fromRGB(85, 170, 0)
  270. end
  271.  
  272.  
  273. local Save = function(Number)
  274.     local HTTPEncodedData = HTTPGuiEncoder.Encrypt(script.Parent.MainFrame.GameEditor.GameUI:GetChildren())
  275.     DataModule.SendProjectDataToServer(Number,HTTPEncodedData,script.Parent.MainFrame.CodeEditor.Frame.Scroll.TextBox.Text)
  276. end
  277.  
  278. SaveProButton.MouseButton1Click:Connect(function()
  279.     if SaveOpen == false then
  280.         SaveMenu.Visible = true
  281.         SaveProButton.Text = "Close"
  282.         SaveOpen = true
  283.     else
  284.         SaveMenu.Visible = false
  285.         SaveProButton.Text = "Save"
  286.         SaveOpen = false
  287.     end
  288.    
  289. end)
  290.  
  291. SaveButton1.MouseButton1Click:Connect(function()
  292.     Save("1")
  293.     Info1.Text = "Savedata"
  294.     Info1.TextColor3 = Color3.fromRGB(85, 170, 0)
  295. end)
  296.  
  297. SaveButton2.MouseButton1Click:Connect(function()
  298.     Save("2")
  299.     Info2.Text = "Savedata"
  300.     Info2.TextColor3 = Color3.fromRGB(85, 170, 0)
  301. end)
  302.  
  303. SaveButton3.MouseButton1Click:Connect(function()
  304.     Save("3")
  305.     Info3.Text = "Savedata"
  306.     Info3.TextColor3 = Color3.fromRGB(85, 170, 0)
  307. end)
  308.  
  309. SaveButton4.MouseButton1Click:Connect(function()
  310.     Save("4")
  311.     Info4.Text = "Savedata"
  312.     Info4.TextColor3 = Color3.fromRGB(85, 170, 0)
  313. end)
  314.  
  315. --TODO////////////////////////////////////////////////////////////////////////////-- Execute Game stuff
  316. local Open = false
  317.  
  318. OCE.MouseButton1Click:Connect(function()
  319.     if Open == false then
  320.         CodeEditorPage.Visible = true
  321.         OCE.Text = "Close Code Editor"
  322.         Open = true
  323.     else
  324.         CodeEditorPage.Visible = false
  325.         OCE.Text = "Open Code Editor"
  326.         Open = false
  327.     end
  328. end)
  329.  
  330. Run.MouseButton1Click:Connect(function()
  331.     wait(0.4)
  332.     LimeExplorer.StartUserApp(script.Parent.Parent.Window, GameName)
  333.     wait()
  334.     local Window = script.Parent.Parent:FindFirstChild(GameName)
  335.     for i,v in pairs(GameUI:GetChildren()) do
  336.         local Clone = v:Clone()
  337.         Clone.Parent = Window.MainFrame
  338.     end
  339.     local Code = script.Parent.MainFrame.CodeEditor.Frame.Scroll.TextBox
  340.     local FormatedCode = Code.Text:gsub("<font.->",""):gsub("</font>","")
  341.     local loadstring = require(script.Parent.Parent.Parent.Parent.SystemFiles.DLLs.Loadstring)
  342.     local executable, compileFailReason = loadstring(FormatedCode)
  343.     print(compileFailReason)
  344.     executable()
  345. end)
  346.  
  347.  
  348.  
  349.  
  350. --TODO////////////////////////////////////////////////////////////////////////////-- Create Project stuff
  351. local StartNewProjectButton = script.Parent.MainFrame.NewProject.StartNewProject
  352. local GameNameBox = CreateProjectPage.TextBox
  353. local Next = CreateProjectPage.Next
  354.  
  355. StartNewProjectButton.MouseButton1Click:Connect(function()
  356.     LoadingScreen.Visible = true
  357.     wait(2)
  358.     LoadingScreen.Visible = false
  359.     CreateProjectPage.Visible = true
  360. end)
  361.  
  362. Next.MouseButton1Click:Connect(function()
  363.     if GameNameBox.Text == "" then
  364.         GameNameBox.PlaceholderText = "Please enter a project name"
  365.         wait(2)
  366.         GameNameBox.PlaceholderText = "Enter your project name here"
  367.     else
  368.         GameName = GameNameBox.Text
  369.         CreateProjectPage.Visible = false
  370.         LoadingScreen.Visible = true
  371.         wait(2)
  372.         LoadingScreen.Visible = false
  373.         GameEditorPage.Visible = true
  374.         Run.Visible = true
  375.         OCE.Visible = true
  376.         SaveProButton.Visible = true
  377.     end
  378.  
  379. end)
  380.  
  381.  
  382.  
  383. --TODO////////////////////////////////////////////////////////////////////////////-- Game Editor stuff
  384.  
  385. --Property Boxes
  386. local NameBox = Props.NameBox
  387. local SizeBox = Props.SizeBox
  388. local PositionBox = Props.PositionBox
  389. local TextColorBox = Props.TextColorBox
  390. local BGcolorBox = Props.BGcolorBox
  391. local TextColorBox = Props.TextColorBox
  392. local VisibleBox = Props.VisibleBox
  393. local TextScaledBox = Props.TextScaledBox
  394. local BorderColorBox = Props.BorderColorBox
  395. local TextSizeBox = Props.TextSizeBox
  396. local BorderSizeBox = Props.BorderSizeBox
  397. local TextBox = Props.TextBox
  398. local ZIndexBox = Props.ZIndexBox
  399.  
  400. --Functions
  401. local ExplorerObjVar
  402.  
  403. local SaveProperties = function(obj,ExplorerObj)
  404.     local PosString = string.split(PositionBox.Text, ",")
  405.     local SizeString = string.split(SizeBox.Text, ",")
  406.     local BackGroundString = string.split(BGcolorBox.Text, ",")
  407.     local TextColorString = string.split(TextColorBox.Text, ",")
  408.     local BorderColorString = string.split(BorderColorBox.Text, ",")
  409.    
  410.     ExplorerObj.Name = NameBox.Text
  411.     ExplorerObj.Text = NameBox.Text
  412.  
  413.     obj.Name = NameBox.Text
  414.     obj.Position = UDim2.new(table.unpack(PosString))
  415.     obj.Size = UDim2.new(table.unpack(SizeString))
  416.     obj.BackgroundColor3 = Color3.fromRGB(table.unpack(BackGroundString))
  417.     obj.BorderColor3 = Color3.fromRGB(table.unpack(BorderColorString))
  418.     obj.BorderSizePixel = BorderSizeBox.Text
  419.     obj.ZIndex = tostring(ZIndexBox.text)
  420.    
  421.     if obj:IsA("Frame") then
  422.     else
  423.         obj.TextColor3 = Color3.fromRGB(table.unpack(TextColorString))
  424.         obj.TextSize = TextSizeBox.Text
  425.         obj.Text = TextBox.Text
  426.         if TextScaledBox.Text == "true" then
  427.             obj.TextScaled = true
  428.         else
  429.             obj.TextScaled = false
  430.         end
  431.     end
  432.    
  433.     if VisibleBox.Text == "true" then
  434.         obj.Visible = true
  435.     else
  436.         obj.Visible = false
  437.     end
  438.    
  439. end
  440.  
  441. local SetPropertiesforPropertiesMenu = function(obj)
  442.     local SizeProp1 = string.gsub(tostring(obj.Size), "{", "")
  443.     local PosProp1 = string.gsub(tostring(obj.Position), "{", "")
  444.     local BackProp1 = string.gsub(tostring(obj.BackgroundColor3), "{", "")
  445.     local BorderColor1 = string.gsub(tostring(obj.BorderColor3), "{", "")
  446.    
  447.     local SizeProp2 = string.gsub(SizeProp1, "}", "")
  448.     local PosProp2 = string.gsub(PosProp1, "}", "")
  449.     local BackProp2 = string.gsub(BackProp1, "}", "")  
  450.     local BorderColor2 = string.gsub(BorderColor1, "}", "")
  451.    
  452.     local ToRGB = function(string)
  453.         local strTable = string:split(",")
  454.         local R = strTable[1]*255
  455.         local G = strTable[2]*255
  456.         local B = strTable[3]*255
  457.         local FinalRGBValue = table.concat({R,G,B}, " ,")
  458.         return FinalRGBValue
  459.     end
  460.    
  461.     NameBox.Text = obj.Name
  462.     SizeBox.Text = SizeProp2
  463.     PositionBox.Text = PosProp2
  464.     BGcolorBox.Text = ToRGB(BackProp2)
  465.     BorderColorBox.Text = ToRGB(BorderColor2)
  466.     BorderSizeBox.Text = obj.BorderSizePixel
  467.     ZIndexBox.Text = obj.ZIndex
  468.    
  469.    
  470.     if obj:IsA("Frame") then
  471.         TextColorBox.Text = "N/A"
  472.         TextSizeBox.Text = "N/A"
  473.         TextScaledBox.Text = "N/A"
  474.         TextBox.Text = "N/A"
  475.     else
  476.         local TextColor1 = string.gsub(tostring(obj.TextColor3), "{", "")
  477.         local TextColor2 = string.gsub(TextColor1, "}", "")
  478.         TextColorBox.Text = ToRGB(TextColor2)
  479.         TextSizeBox.Text = obj.TextSize
  480.         TextBox.Text = obj.Text
  481.         if obj.TextScaled == true then
  482.             TextScaledBox.Text = "true"
  483.         else
  484.             TextScaledBox.Text = "false"
  485.         end
  486.     end
  487.    
  488.     if obj.Visible == true then
  489.         VisibleBox.Text = "true"
  490.     else
  491.         VisibleBox.Text = "false"
  492.     end
  493.    
  494. end
  495.  
  496. local EnabelButtonPress = function()
  497.     for i,v in pairs(GameExplorer:GetChildren()) do
  498.         if v:IsA("UIListLayout") then
  499.         else
  500.             v.MouseButton1Click:Connect(function()
  501.                 SetPropertiesforPropertiesMenu(v.Value.Value)
  502.                 Props.SelectedInstance.Value = v.Value.Value
  503.                 ExplorerObjVar = v
  504.             end)
  505.         end
  506.     end
  507. end
  508.  
  509. local DeleteExplorerObjs = function(obj,ExplorerObj)
  510.     ExplorerObj.Value.Value:Destroy()
  511.     ExplorerObj:Destroy()
  512. end
  513.  
  514. WindowHandlerModule.AddExplorerObjs = function(obj)
  515.     local UIElement = Instance.new("TextButton",GameExplorer)
  516.     local ObjectValue = Instance.new("ObjectValue",UIElement)
  517.     ObjectValue.Value = obj
  518.     UIElement.Name = obj.Name
  519.     UIElement.Text = obj.Name
  520.     UIElement.BackgroundTransparency = 1
  521.     UIElement.TextScaled = true
  522.     UIElement.Font = "Gotham"
  523.     UIElement.Size = UDim2.fromScale(1,0.025)
  524.     UIElement.TextXAlignment = "Left"
  525.  
  526.     EnabelButtonPress()
  527. end
  528. --Context Menu
  529. GameUI.MouseEnter:Connect(function()
  530.     Mouse.Button2Down:Connect(function()
  531.         ContextMenu.Visible = true
  532.         ContextMenu.Position = UDim2.fromOffset(Mouse.X,Mouse.Y)
  533.     end)
  534. end)
  535.  
  536. ContextMenu.MouseEnter:Connect(function()
  537.     ContextMenu.MouseLeave:Connect(function()
  538.         ContextMenu.Visible = false
  539.     end)
  540. end)
  541.  
  542. DeleteButton.MouseButton1Click:Connect(function()
  543.     DeleteExplorerObjs(Props.SelectedInstance.Value,ExplorerObjVar)
  544. end)
  545.  
  546. SaveButton.MouseButton1Click:Connect(function()
  547.     SaveProperties(Props.SelectedInstance.Value,ExplorerObjVar)
  548. end)
  549. --Add UI elements
  550.  
  551. ContextMenu.MainFrame.TextLabel.MouseButton1Click:Connect(function()
  552.     local UI = Instance.new("TextLabel",GameUI)
  553.     UI.Size = UDim2.fromOffset(100,100)
  554.     UI.BackgroundColor3 = Color3.fromRGB(255,255,255)
  555.     WindowHandlerModule.AddExplorerObjs(UI)
  556. end)
  557. ContextMenu.MainFrame.TextButton.MouseButton1Click:Connect(function()
  558.     local UI = Instance.new("TextButton",GameUI)
  559.     UI.Size = UDim2.fromOffset(100,100)
  560.     UI.BackgroundColor3 = Color3.fromRGB(255,255,255)
  561.     WindowHandlerModule.AddExplorerObjs(UI)
  562. end)
  563. ContextMenu.MainFrame.TextBox.MouseButton1Click:Connect(function()
  564.     local UI = Instance.new("TextBox",GameUI)
  565.     UI.Size = UDim2.fromOffset(100,100)
  566.     UI.BackgroundColor3 = Color3.fromRGB(255,255,255)
  567.     WindowHandlerModule.AddExplorerObjs(UI)
  568. end)
  569. ContextMenu.MainFrame.Frame.MouseButton1Click:Connect(function()
  570.     local UI = Instance.new("Frame",GameUI)
  571.     UI.Size = UDim2.fromOffset(100,100)
  572.     UI.BackgroundColor3 = Color3.fromRGB(255,255,255)
  573.     WindowHandlerModule.AddExplorerObjs(UI)
  574. end)
  575.  
  576. local X = script.Parent.TopBar.Z
  577. local O = script.Parent.TopBar.Y
  578. local min = script.Parent.TopBar.X
  579. local OGPos
  580. local fullScreen = false
  581.  
  582. --TODO////////////////////////////////////////////////////////////////////////////-- Topbar stuff
  583.  
  584. X.MouseButton1Click:Connect(function()
  585.     GameEditor.Visible = false
  586.     Run.Visible = false
  587.     OCE.Visible = false
  588.     SaveProButton.Visible = false
  589.     for i,v in pairs(GameExplorer:GetChildren()) do
  590.         if v:IsA("UIListLayout") then
  591.         else
  592.             v.Value.Value:Destroy()
  593.             v:Destroy()
  594.         end
  595.     end
  596.     local Module = require(script.Parent.Parent.Parent.Parent.SystemFiles.DLLs.LimeExplorer)
  597.     Module.CloseApp("2D Game Maker")
  598. end)
  599.  
  600. --[[
  601. O.MouseButton1Click:Connect(function()
  602.     if fullScreen == true then
  603.         script.Parent.Position = OGPos
  604.         script.Parent.Size = UDim2.fromScale(0.25, 0.5)
  605.         fullScreen = false
  606.     else
  607.         OGPos = script.Parent.Position
  608.         script.Parent.Size = UDim2.fromScale(1, 0.95)
  609.         script.Parent.Position = UDim2.fromScale(0, 0)
  610.         fullScreen = true
  611.     end
  612. end)
  613. ]]--
  614.  
  615. min.MouseButton1Click:Connect(function()
  616.     -- Mache ich gleich
  617. end)
  618.  
  619. return WindowHandlerModule
  620.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement