mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-05 05:07:48 +00:00
70 lines
2.5 KiB
Lua
70 lines
2.5 KiB
Lua
-- Creates all neccessary scripts for the gui on initial load, everything except build tools
|
|
-- Created by Ben T. 10/29/10
|
|
-- Please note that these are loaded in a specific order to diminish errors/perceived load time by user
|
|
|
|
local scriptContext = game:GetService("ScriptContext")
|
|
local touchEnabled = game:GetService("UserInputService").TouchEnabled
|
|
|
|
local RobloxGui = game:GetService("CoreGui"):WaitForChild("RobloxGui")
|
|
|
|
local soundFolder = Instance.new("Folder")
|
|
soundFolder.Name = "Sounds"
|
|
soundFolder.Parent = RobloxGui
|
|
|
|
-- TopBar
|
|
local topbarSuccess, topbarFlagValue = pcall(function() return settings():GetFFlag("UseInGameTopBar") end)
|
|
local useTopBar = (topbarSuccess and topbarFlagValue == true)
|
|
if useTopBar then
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/Topbar", RobloxGui)
|
|
end
|
|
|
|
-- SettingsScript
|
|
local luaControlsSuccess, luaControlsFlagValue = pcall(function() return settings():GetFFlag("UseLuaCameraAndControl") end)
|
|
|
|
-- MainBotChatScript (the Lua part of Dialogs)
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/MainBotChatScript2", RobloxGui)
|
|
|
|
-- Developer Console Script
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/DeveloperConsole", RobloxGui)
|
|
|
|
-- In-game notifications script
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/NotificationScript2", RobloxGui)
|
|
|
|
-- Chat script
|
|
if useTopBar then
|
|
spawn(function() require(RobloxGui.Modules.Chat) end)
|
|
spawn(function() require(RobloxGui.Modules.PlayerlistModule) end)
|
|
end
|
|
|
|
local luaBubbleChatSuccess, luaBubbleChatFlagValue = pcall(function() return settings():GetFFlag("LuaBasedBubbleChat") end)
|
|
if luaBubbleChatSuccess and luaBubbleChatFlagValue then
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/BubbleChat", RobloxGui)
|
|
end
|
|
|
|
-- Purchase Prompt Script
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/PurchasePromptScript2", RobloxGui)
|
|
|
|
-- Health Script
|
|
if not useTopBar then
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/HealthScript", RobloxGui)
|
|
end
|
|
|
|
do -- Backpack!
|
|
spawn(function() require(RobloxGui.Modules.BackpackScript) end)
|
|
end
|
|
|
|
if useTopBar then
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/VehicleHud", RobloxGui)
|
|
end
|
|
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/GamepadMenu", RobloxGui)
|
|
|
|
if touchEnabled then -- touch devices don't use same control frame
|
|
-- only used for touch device button generation
|
|
scriptContext:AddCoreScriptLocal("CoreScripts/2016/ContextActionTouch", RobloxGui)
|
|
|
|
RobloxGui:WaitForChild("ControlFrame")
|
|
RobloxGui.ControlFrame:WaitForChild("BottomLeftControl")
|
|
RobloxGui.ControlFrame.BottomLeftControl.Visible = false
|
|
end
|