-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from MiaGobble/SEAM-34-Bug-Fixes
Seam 34 bug fixes
- Loading branch information
Showing
16 changed files
with
153 additions
and
39 deletions.
There are no files selected for viewing
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 @@ | ||
-- Imports | ||
local States = script.Parent.Parent.States | ||
local DeclareComponent = require(States.DeclareComponent) | ||
|
||
-- Variables | ||
local PresetComponents = script.Parent.Parent.PresetComponents | ||
|
||
return function() | ||
for _, ComponentModule in ipairs(PresetComponents:GetChildren()) do | ||
DeclareComponent(ComponentModule.Name, require(ComponentModule)) | ||
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,45 @@ | ||
-- Imports | ||
local States = script.Parent.Parent.States | ||
local New = require(States.New) | ||
local OnEvent = require(States.OnEvent) | ||
local Computed = require(States.Computed) | ||
local Tween = require(States.Animation.Tween) | ||
|
||
return function(ButtonObject : GuiButton) | ||
local State = "Idle" | ||
local ColorPropertyName = ButtonObject:IsA("ImageButton") and "ImageColor3" or "TextColor3" | ||
|
||
local H, S, V = Color3.toHSV(ButtonObject[ColorPropertyName] :: Color3) | ||
|
||
return New(ButtonObject, { | ||
AutoButtonColor = false, | ||
|
||
[ColorPropertyName] = Tween(Computed(function() | ||
if State == "Idle" then | ||
return Color3.fromHSV(H, S, V) | ||
elseif State == "Hover" then | ||
return Color3.fromHSV(H, S, V * 0.9) | ||
elseif State == "Press" then | ||
return Color3.fromHSV(H, S, V * 0.75) | ||
end | ||
|
||
error("Invalid state: " .. State) | ||
end), TweenInfo.new(0.1)), | ||
|
||
[OnEvent "MouseButton1Down"] = function() | ||
State = "Press" | ||
end, | ||
|
||
[OnEvent "MouseButton1Up"] = function() | ||
State = "Idle" | ||
end, | ||
|
||
[OnEvent "MouseEnter"] = function() | ||
State = "Hover" | ||
end, | ||
|
||
[OnEvent "MouseLeave"] = function() | ||
State = "Idle" | ||
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,13 @@ | ||
-- Services | ||
local SoundService = game:GetService("SoundService") | ||
|
||
-- Imports | ||
local States = script.Parent.Parent.States | ||
local New = require(States.New) | ||
|
||
return function(Sound : Sound) | ||
New(Sound, { | ||
Parent = SoundService, | ||
PlayOnRemove = true, | ||
}):Destroy() | ||
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,39 @@ | ||
-- Constants | ||
local BASE_RATIO = Vector2.new(1920, 1080) | ||
local BASE_MAGNITUDE = (BASE_RATIO / BASE_RATIO).Magnitude | ||
local TICK_RATE = 1 / 1 | ||
|
||
-- Services | ||
local RunService = game:GetService("RunService") | ||
|
||
-- Variables | ||
local Camera = workspace.CurrentCamera | ||
local LastTick = os.clock() | ||
local Strokes = {} | ||
|
||
local function Init() | ||
RunService.RenderStepped:Connect(function() | ||
if os.clock() - LastTick < TICK_RATE then | ||
return | ||
else | ||
LastTick = os.clock() | ||
end | ||
|
||
for Object, Thickness in Strokes do | ||
if not Object:IsDescendantOf(game) then | ||
Strokes[Object] = nil | ||
continue | ||
end | ||
|
||
local Scale = (Camera.ViewportSize / BASE_RATIO).Magnitude / BASE_MAGNITUDE | ||
Object.Thickness = Thickness * Scale | ||
end | ||
end) | ||
end | ||
|
||
return function(StrokeObject : UIStroke) | ||
local OriginalThickness = StrokeObject.Thickness | ||
Strokes[StrokeObject] = OriginalThickness | ||
|
||
return StrokeObject | ||
end, Init() |
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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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