-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first commit - port from studio to rojo project
- Loading branch information
Showing
20 changed files
with
560 additions
and
3 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Plugin model files | ||
/quickfix-roblox-plugin.rbxmx | ||
/quickfix-roblox-plugin.rbxm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# quickfix-roblox-plugin | ||
A plugin for streamlining asset optimization. | ||
|
||
A plugin for streamlining asset optimization. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file lists tools managed by Aftman, a cross-platform toolchain manager. | ||
# For more information, see https://github.com/LPGhatguy/aftman | ||
|
||
# To add a new tool, add an entry to this table. | ||
[tools] | ||
rojo = "rojo-rbx/rojo@7.4.0-rc3" | ||
# rojo = "rojo-rbx/rojo@6.2.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "quickfix-roblox-plugin", | ||
"tree": { | ||
"$className": "DataModel", | ||
|
||
"ServerScriptService": { | ||
"QuickFix": { | ||
"$path": "src" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
std = "roblox" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local DualAction = require(script.Parent.DualAction) | ||
|
||
return function() | ||
return Roact.createElement(DualAction, { | ||
text = "Anchored", | ||
|
||
predicate = function(object) | ||
return object:IsA("BasePart") | ||
end, | ||
|
||
onDisable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if not descendant.Anchored then | ||
continue | ||
end | ||
|
||
descendant.Anchored = false | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] Anchored set to false for " .. count .. " objects") | ||
end, | ||
|
||
onEnable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if descendant.Anchored then | ||
continue | ||
end | ||
|
||
descendant.Anchored = true | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] Anchored set to true for " .. count .. " objects") | ||
end, | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local DualAction = require(script.Parent.DualAction) | ||
|
||
return function() | ||
return Roact.createElement(DualAction, { | ||
text = "CanCollide", | ||
|
||
predicate = function(object) | ||
return object:IsA("BasePart") | ||
end, | ||
|
||
onDisable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if not descendant.CanCollide then | ||
continue | ||
end | ||
|
||
descendant.CanCollide = false | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CanCollide set to false for " .. count .. " objects") | ||
end, | ||
|
||
onEnable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if descendant.CanCollide then | ||
continue | ||
end | ||
|
||
descendant.CanCollide = true | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CanCollide set to true for " .. count .. " objects") | ||
end, | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local DualAction = require(script.Parent.DualAction) | ||
|
||
return function() | ||
return Roact.createElement(DualAction, { | ||
text = "CanQuery", | ||
|
||
predicate = function(object) | ||
return object:IsA("BasePart") | ||
end, | ||
|
||
onDisable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if not descendant.CanQuery then | ||
continue | ||
end | ||
|
||
descendant.CanQuery = false | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CanQuery set to false for " .. count .. " objects") | ||
end, | ||
|
||
onEnable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if descendant.CanQuery then | ||
continue | ||
end | ||
|
||
descendant.CanQuery = true | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CanQuery set to true for " .. count .. " objects") | ||
end, | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local DualAction = require(script.Parent.DualAction) | ||
|
||
return function() | ||
return Roact.createElement(DualAction, { | ||
text = "CanTouch", | ||
|
||
predicate = function(object) | ||
return object:IsA("BasePart") | ||
end, | ||
|
||
onDisable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if not descendant.CanTouch then | ||
continue | ||
end | ||
|
||
descendant.CanTouch = false | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CanTouch set to false for " .. count .. " objects") | ||
end, | ||
|
||
onEnable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if descendant.CanTouch then | ||
continue | ||
end | ||
|
||
descendant.CanTouch = true | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CanTouch set to true for " .. count .. " objects") | ||
end, | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local DualAction = require(script.Parent.DualAction) | ||
|
||
return function() | ||
return Roact.createElement(DualAction, { | ||
text = "CastShadow", | ||
|
||
predicate = function(object) | ||
return object:IsA("BasePart") | ||
end, | ||
|
||
onDisable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if not descendant.CastShadow then | ||
continue | ||
end | ||
|
||
descendant.CastShadow = false | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CastShadow set to false for " .. count .. " objects") | ||
end, | ||
|
||
onEnable = function(objects) | ||
local count = 0 | ||
|
||
for _, descendant in objects do | ||
if descendant.CastShadow then | ||
continue | ||
end | ||
|
||
descendant.CastShadow = true | ||
count += 1 | ||
end | ||
|
||
warn("[Asset Optimizer] CastShadow set to true for " .. count .. " objects") | ||
end, | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
local ChangeHistoryService = game:GetService("ChangeHistoryService") | ||
|
||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local GetAffectedObjects = require(script.Parent.GetAffectedObjects) | ||
|
||
return function(props) | ||
return Roact.createElement("Frame", { | ||
Size = UDim2.new(1, 0, 0, 32), | ||
|
||
BackgroundTransparency = 1, | ||
}, { | ||
Off = Roact.createElement("TextButton", { | ||
Size = UDim2.new(0.5, -5, 0, 32), | ||
LayoutOrder = 1, | ||
|
||
FontFace = Font.new( | ||
"rbxasset://fonts/families/SourceSansPro.json", | ||
Enum.FontWeight.Bold, | ||
Enum.FontStyle.Normal | ||
), | ||
Text = props.text, | ||
TextColor3 = Color3.fromRGB(255, 255, 255), | ||
TextSize = 28, | ||
|
||
BackgroundColor3 = Color3.fromRGB(255, 102, 102), | ||
BorderSizePixel = 0, | ||
|
||
[Roact.Event.MouseButton1Click] = function() | ||
props.onDisable(GetAffectedObjects(props.predicate)) | ||
ChangeHistoryService:SetWaypoint("Asset Optimizer Action: " .. props.text) | ||
end, | ||
}, { | ||
UICorner = Roact.createElement("UICorner"), | ||
|
||
UIFlexItem = Roact.createElement("UIFlexItem", { | ||
FlexMode = Enum.UIFlexMode.Fill, | ||
}), | ||
}), | ||
|
||
On = Roact.createElement("TextButton", { | ||
Size = UDim2.new(0.5, -5, 0, 32), | ||
|
||
FontFace = Font.new( | ||
"rbxasset://fonts/families/SourceSansPro.json", | ||
Enum.FontWeight.Bold, | ||
Enum.FontStyle.Normal | ||
), | ||
Text = props.text, | ||
TextColor3 = Color3.fromRGB(255, 255, 255), | ||
TextSize = 28, | ||
|
||
BackgroundColor3 = Color3.fromRGB(38, 217, 100), | ||
BorderSizePixel = 0, | ||
|
||
[Roact.Event.MouseButton1Click] = function() | ||
props.onEnable(GetAffectedObjects(props.predicate)) | ||
ChangeHistoryService:SetWaypoint("Asset Optimizer Action: " .. props.text) | ||
end, | ||
}, { | ||
UICorner = Roact.createElement("UICorner"), | ||
|
||
UIFlexItem = Roact.createElement("UIFlexItem", { | ||
FlexMode = Enum.UIFlexMode.Fill, | ||
}), | ||
}), | ||
|
||
UIListLayout = Roact.createElement("UIListLayout", { | ||
Padding = UDim.new(0, 5), | ||
FillDirection = Enum.FillDirection.Horizontal, | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
}), | ||
}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
local Selection = game:GetService("Selection") | ||
|
||
return function(predicate: (object: Instance) -> boolean) | ||
local arrSelection = Selection:Get() | ||
local nSelection = #arrSelection | ||
|
||
local objects = {} | ||
|
||
if nSelection == 1 then | ||
for _, object in arrSelection[1]:GetDescendants() do | ||
if not predicate(object) then | ||
continue | ||
end | ||
|
||
table.insert(objects, object) | ||
end | ||
elseif nSelection > 1 then | ||
for _, object in arrSelection do | ||
if not predicate(object) then | ||
continue | ||
end | ||
|
||
table.insert(objects, object) | ||
end | ||
end | ||
|
||
return objects | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
local Selection = game:GetService("Selection") | ||
|
||
local Roact = require(script.Parent.Parent.Roact) | ||
|
||
local SingleAction = require(script.Parent.SingleAction) | ||
|
||
return function() | ||
return Roact.createElement(SingleAction, { | ||
text = "Select MeshParts", | ||
|
||
predicate = function(object) | ||
return object:IsA("MeshPart") | ||
end, | ||
|
||
onEnable = function(objects) | ||
if #objects > 0 then | ||
Selection:Set(objects) | ||
end | ||
end, | ||
}) | ||
end |
Oops, something went wrong.