Skip to content

Commit

Permalink
0.451.0.412446 (Scripts)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roblox-Client-Tracker committed Oct 7, 2020
1 parent e56c010 commit ab0fc98
Show file tree
Hide file tree
Showing 1,189 changed files with 63,370 additions and 3,121 deletions.
@@ -0,0 +1,5 @@
game:DefineFastFlag("HideLoadToastIfAnimationClipped", false)

return function()
return game:GetFastFlag("HideLoadToastIfAnimationClipped")
end
Expand Up @@ -59,6 +59,7 @@ local SetIsPlaying = require(Plugin.Src.Actions.SetIsPlaying)
local GetFFlagEnforceMaxAnimLength = require(Plugin.LuaFlags.GetFFlagEnforceMaxAnimLength)
local UseCustomFPS = require(Plugin.LuaFlags.GetFFlagAnimEditorUseCustomFPS)
local GetFFlagAddImportFailureToast = require(Plugin.LuaFlags.GetFFlagAddImportFailureToast)
local GetFFlagHideLoadToastIfAnimationClipped = require(Plugin.LuaFlags.GetFFlagHideLoadToastIfAnimationClipped)

local DopeSheetController = Roact.Component:extend("DopeSheetController")

Expand Down Expand Up @@ -489,6 +490,7 @@ function DopeSheetController:render()
local savedAnimName = props.Saved
local showClippedWarning = GetFFlagEnforceMaxAnimLength() and props.ClippedWarning
local showInvalidIdWarning = GetFFlagAddImportFailureToast() and props.InvalidIdWarning
local showLoadToast = not GetFFlagHideLoadToastIfAnimationClipped() or (GetFFlagHideLoadToastIfAnimationClipped() and not (GetFFlagEnforceMaxAnimLength() and showClippedWarning))

local size = props.Size
local position = props.Position
Expand Down Expand Up @@ -692,7 +694,7 @@ function DopeSheetController:render()
OnClose = props.CloseSavedToast,
}),

LoadedToast = loadedAnimName and Roact.createElement(NoticeToast, {
LoadedToast = showLoadToast and loadedAnimName and Roact.createElement(NoticeToast, {
Text = localization:getText("Toast", "Loaded", loadedAnimName),
OnClose = props.CloseLoadedToast,
}),
Expand Down
Expand Up @@ -11,7 +11,7 @@ return function()
it("should coerce to the given name", function()
local symbol = Symbol.named("foo")

expect(tostring(symbol):find("foo")).to.be.ok()
expect(tostring(symbol):match("foo")).to.be.ok()
end)

it("should be unique when constructed", function()
Expand Down Expand Up @@ -42,4 +42,4 @@ return function()
expect(symbolA).never.to.equal(symbolB)
end)
end)
end
end
Expand Up @@ -18,25 +18,27 @@ local makeTheme = require(Util.makeTheme)

local ContextServices = require(Libs.Framework.ContextServices)
local UILibraryWrapper = ContextServices.UILibraryWrapper
local FrameworkUtil = require(Libs.Framework.Util)
local getTestVariation = FrameworkUtil.getTestVariation

local Analytics = require(Util.Analytics.Analytics)

local FFlagEnableToolboxImpressionAnalytics = game:GetFastFlag("EnableToolboxImpressionAnalytics")
local FFlagBootstrapperTryAsset = game:GetFastFlag("BootstrapperTryAsset")
-- Be sure to turn off ToolboxShowHideABTest before turning on StudioShowHideABTestV2
local FFlagToolboxShowHideABTest = game:GetFastFlag("ToolboxShowHideABTest")
local FFlagStudioShowHideABTestV2 = game:GetFastFlag("StudioShowHideABTestV2")

local AB_TEST_GROUP_CONTROL = "Control"

-- ShowHideToolbox : AB Test where Toolbox shows on startup for users not in the Control group
-- Control : Toolbox appears on startup
-- All Variations : Toolbox hidden on startup
local ShowHideABTestName = "AllUsers.RobloxStudio.ShowHideToolbox"
local ABTEST_SHOWHIDEV2_NAME = "AllUsers.RobloxStudio.ShowHideV2"

local function shouldSeeTestBehavior(abTestName)
-- REMOVE THIS WITH FFlagShowHideABTest

-- helper function for showing a behavior so long as the result is not "Control"
-- further specificity can be used if the exact variation is required
local variation = ABTestService:GetVariant(abTestName)
local shouldShowBehavior = variation ~= AB_TEST_GROUP_CONTROL
local shouldShowBehavior = variation ~= "Control"
return shouldShowBehavior, variation
end

Expand Down Expand Up @@ -151,8 +153,15 @@ function ToolboxPlugin:render()
local isToolboxHidden = shouldSeeTestBehavior(ShowHideABTestName)
if isToolboxHidden then
initialEnabled = false
else
end
elseif FFlagStudioShowHideABTestV2 then
local variation = getTestVariation(ABTEST_SHOWHIDEV2_NAME)
if variation == 0 or variation == 2 then
-- Even though 0 is supposed to be the Control group and preserve existing behaviors,
-- Toolbox should be enabled by default. The fact that it isn't is a bug.
initialEnabled = true
elseif variation == 1 then
initialEnabled = false
end
end

Expand Down
Expand Up @@ -3,6 +3,7 @@ local FFlagUseCategoryNameInToolbox = game:GetFastFlag("UseCategoryNameInToolbox

local Plugin = script.Parent.Parent.Parent.Parent
local Cryo = require(Plugin.Libs.Cryo)
local RobloxAPI = require(Plugin.Libs.Framework).RobloxAPI

local RequestReason = require(Plugin.Core.Types.RequestReason)

Expand All @@ -19,7 +20,7 @@ return function(networkInterface, tabName, newCategories, settings, options)
local categories = Category.getCategories(tabName, store:getState().roles)

local creator = Cryo.None
if FFlagToolboxShowRobloxCreatedAssetsForLuobu then
if FFlagToolboxShowRobloxCreatedAssetsForLuobu and RobloxAPI:baseURLHasChineseHost() then
creator = options.creator or Cryo.None
end

Expand Down
12 changes: 5 additions & 7 deletions BuiltInPlugins/AssetConfiguration/Core/Types/Category.lua
Expand Up @@ -281,20 +281,18 @@ Category.RECENT_KEY = "Recent"
Category.CREATIONS_KEY = "Creations"

table.insert(Category.INVENTORY, Category.MY_PLUGINS)
if not FFlagToolboxShowRobloxCreatedAssetsForLuobu then
if FFlagOnlyWhitelistedPluginsInStudio then
table.insert(Category.MARKETPLACE, Category.WHITELISTED_PLUGINS)
else
table.insert(Category.MARKETPLACE, Category.FREE_PLUGINS)
end
if FFlagOnlyWhitelistedPluginsInStudio then
table.insert(Category.MARKETPLACE, Category.WHITELISTED_PLUGINS)
else
table.insert(Category.MARKETPLACE, Category.FREE_PLUGINS)
end

local insertIndex = Cryo.List.find(Category.INVENTORY_WITH_GROUPS, Category.MY_PACKAGES) + 1
table.insert(Category.INVENTORY_WITH_GROUPS, insertIndex, Category.MY_PLUGINS)
local insertIndex2 = Cryo.List.find(Category.INVENTORY_WITH_GROUPS, Category.GROUP_AUDIO) + 1
table.insert(Category.INVENTORY_WITH_GROUPS, insertIndex2, Category.GROUP_PLUGINS)

if FFlagToolboxShowRobloxCreatedAssetsForLuobu then
if FFlagToolboxShowRobloxCreatedAssetsForLuobu and RobloxAPI:baseURLHasChineseHost() then
local disabledCategories = string.split(FStringLuobuMarketplaceDisabledCategories, ";")

for _, categoryName in pairs(disabledCategories) do
Expand Down
Expand Up @@ -186,7 +186,7 @@ local function insertDecal(plugin, assetId, assetName)
decal.Name = assetName

if FFlagMarketplaceSourceAssetIds then
decal.SourceAssetId = tbl[1]
decal.SourceAssetId = assetId
end

if FFlagToolboxFixDecalInsert then
Expand Down
Expand Up @@ -11,6 +11,13 @@ return function()
local StyleTable = Util.StyleTable
local StyleModifier = Util.StyleModifier
local Signal = Util.Signal
local FlagsList = Util.Flags.new({
FFlagRefactorDevFrameworkTheme = {"RefactorDevFrameworkTheme"},
})

if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
return
end

local function createTestThemedComponent(render)
local TestThemedComponent = Roact.PureComponent:extend("TestThemedComponent")
Expand Down
Expand Up @@ -2,8 +2,10 @@ return function()
local Framework = script.Parent.Parent

local Util = require(Framework.Util)
local Signal = Util.Signal
local FlagsList = Util.Flags.new({
FFlagStudioDevFrameworkPackage = {"StudioDevFrameworkPackage"},
FFlagRefactorDevFrameworkTheme = {"RefactorDevFrameworkTheme"},
})

local isUsedAsPackage = require(Framework.Util.isUsedAsPackage)
Expand All @@ -18,6 +20,7 @@ return function()
local Focus = require(Framework.ContextServices.Focus)
local Theme = require(Framework.ContextServices.Theme)
local UILibraryWrapper = require(script.Parent.UILibraryWrapper)
local StudioTheme = require(Framework.Style.Themes.StudioTheme)

local WrapperStub = Roact.PureComponent:extend("UILibraryWrapper")

Expand All @@ -29,12 +32,26 @@ return function()
Wrapper = WrapperStub
}

local function createThemeMock()

if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
return StudioTheme.mock()
else
local createStyles = function()
return {}
end
local getTheme = function()
return "Light"
end
local themeChanged = Signal.new()
return Theme.mock(createStyles, getTheme, themeChanged)
end
end

it("should expect a Plugin ContextItem provided above", function()
local focus = Focus.new(Instance.new("ScreenGui"))
local wrapper = UILibraryWrapper.new(UILibraryStub)
local theme = Theme.new(function()
return {}
end)
local theme = createThemeMock()
function theme:getUILibraryTheme()
return {}
end
Expand All @@ -55,9 +72,7 @@ return function()
it("should expect a Focus ContextItem provided above", function()
local plugin = Plugin.new({})
local wrapper = UILibraryWrapper.new(UILibraryStub)
local theme = Theme.new(function()
return {}
end)
local theme = createThemeMock()
function theme:getUILibraryTheme()
return {}
end
Expand Down Expand Up @@ -97,9 +112,7 @@ return function()
local plugin = Plugin.new({})
local focus = Focus.new(Instance.new("ScreenGui"))
local wrapper = UILibraryWrapper.new(UILibraryStub)
local theme = Theme.new(function()
return {}
end)
local theme = createThemeMock()

local element = provide({
plugin,
Expand All @@ -119,9 +132,7 @@ return function()
local plugin = Plugin.new({})
local focus = Focus.new(Instance.new("ScreenGui"))
local wrapper = UILibraryWrapper.new(UILibraryStub)
local theme = Theme.new(function()
return {}
end)
local theme = createThemeMock()
function theme:getUILibraryTheme()
return {}
end
Expand Down
Expand Up @@ -17,7 +17,7 @@ return function()
local function createTestTitledFrame(children, container)
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = Theme.new(function()
return {
Expand Down
Expand Up @@ -9,10 +9,12 @@
]]

game:DefineFastFlag("FixDevFrameworkDockWidgetRestore", false)
game:DefineFastFlag("DevFrameworkPluginWidgetEnabledEvent", false)
game:DefineFastFlag("DevFrameworkPluginWidgetEnabledEvent2", false)
game:DefineFastFlag("DevFrameworkPluginWidgetUseSiblingZIndex", false)

local FFlagFixDevFrameworkDockWidgetRestore = game:GetFastFlag("FixDevFrameworkDockWidgetRestore")
local FFlagDevFrameworkPluginWidgetEnabledEvent = game:GetFastFlag("DevFrameworkPluginWidgetEnabledEvent")
local FFlagDevFrameworkPluginWidgetEnabledEvent2 = game:GetFastFlag("DevFrameworkPluginWidgetEnabledEvent2")
local FFlagDevFrameworkPluginWidgetUseSiblingZIndex = game:GetFastFlag("DevFrameworkPluginWidgetUseSiblingZIndex")

local Framework = script.Parent.Parent
local Roact = require(Framework.Parent.Roact)
Expand All @@ -31,7 +33,11 @@ local function createPluginWidget(componentName, createWidgetFunc)

local widget = createWidgetFunc(props)
widget.Name = title or ""
widget.ZIndexBehavior = props.ZIndexBehavior or Enum.ZIndexBehavior.Global
if FFlagDevFrameworkPluginWidgetUseSiblingZIndex then
widget.ZIndexBehavior = props.ZIndexBehavior or Enum.ZIndexBehavior.Sibling
else
widget.ZIndexBehavior = props.ZIndexBehavior or Enum.ZIndexBehavior.Global
end

if widget:IsA("PluginGui") then
widget:BindToClose(onClose)
Expand Down Expand Up @@ -67,12 +73,13 @@ local function createPluginWidget(componentName, createWidgetFunc)
end
end

if FFlagDevFrameworkPluginWidgetEnabledEvent then
if FFlagDevFrameworkPluginWidgetEnabledEvent2 then
-- Connect to enabled changing *after* restore
-- Otherwise users of this will get 2 enabled changes: one from the onRestore, and the same from Roact.Change.Enabled
self.widgetEnabledChangedConnection = widget:GetPropertyChangedSignal("Enabled"):Connect(function()
if self.props[Roact.Change.Enabled] then
self.props[Roact.Change.Enabled](self.widget)
local callback = self.props[Roact.Change.Enabled]
if callback and self.widget and self.widget.Enabled ~= self.props.Enabled then
callback(self.widget)
end
end)
end
Expand Down
@@ -1,3 +1,5 @@
--!nocheck

--[[
Wraps theme styles and update logic into a ContextItem.
Expand Down Expand Up @@ -318,4 +320,4 @@ function Stylizer.mock(t, themeProps, callback)
return self
end
return Stylizer
return Stylizer
Expand Up @@ -9,6 +9,7 @@ local UIFolderData = require(Framework.UI.UIFolderData)
return function(componentName)
local componentData = UIFolderData[componentName] or StudioUIFolderData[componentName]
local result

if componentData.style then
result = require(componentData.style)
end
Expand Down
Expand Up @@ -91,7 +91,7 @@ return function(contextItemsList, children)
-- Theme
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = ContextServices.Theme.mock(function(theme, getColor)
return {
Expand Down
Expand Up @@ -23,7 +23,7 @@ return function()
else
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = Theme.new(function()
return {
Expand Down
Expand Up @@ -18,7 +18,7 @@ return function()
local function createTestButton(props, children)
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = Theme.new(function()
return {
Expand Down
Expand Up @@ -18,7 +18,7 @@ return function()
local function createTestContainer(props, children)
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = Theme.new(function()
return {
Expand Down
Expand Up @@ -44,6 +44,7 @@ local TextLabel = require(UI.TextLabel)

local FlagsList = Util.Flags.new({
FFlagRefactorDevFrameworkTheme = {"RefactorDevFrameworkTheme"},
FFlagRefactorDevFrameworkContextItems = {"RefactorDevFrameworkContextItems"},
})

local DropdownMenu = Roact.PureComponent:extend("DropdownMenu")
Expand Down Expand Up @@ -201,7 +202,7 @@ function DropdownMenu:renderMenu()
local width = style.Width
local offset = prioritize(style.Offset, Vector2.new(0, 0))

local pluginGui = props.Focus:getTarget()
local pluginGui = FlagsList:get("FFlagRefactorDevFrameworkContextItems") and props.Focus:get() or props.Focus:getTarget()

local menuPositionAndSize = self.getPositionAndSize(pluginGui, width, offset)
local x = menuPositionAndSize.X
Expand Down
Expand Up @@ -17,7 +17,7 @@ return function()
local function createTestFakeLoadingBar(props, children)
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = Theme.new(function()
return {
Expand Down
Expand Up @@ -17,7 +17,7 @@ return function()
local function createTestImageDecoration()
local theme
if FlagsList:get("FFlagRefactorDevFrameworkTheme") then
theme = StudioTheme.new()
theme = StudioTheme.mock()
else
theme = Theme.new(function()
return {
Expand Down

0 comments on commit ab0fc98

Please sign in to comment.