Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Convert to use new Recording API
Browse files Browse the repository at this point in the history
Signed-off-by: RyanLua <80087248+RyanLua@users.noreply.github.com>
  • Loading branch information
RyanLua committed Aug 7, 2023
1 parent 14bc62f commit 4ba1d8f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Signs/PluginGui/GuiObjectPart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function GuiObjectPart.new(
local self = {}
setmetatable(self, GuiObjectPart)

local recording = ChangeHistoryService:TryBeginRecording("NewSignPart", "Create a new SignPart")

if not recording then
error("Could not begin recording data model changes")
end

local camera = workspace.CurrentCamera or Instance.new("Camera")

local partSizeX = label.AbsoluteSize.X / 50
Expand Down Expand Up @@ -64,12 +70,12 @@ function GuiObjectPart.new(

Selection:Set({ part })

ChangeHistoryService:SetWaypoint("Insert new SignPart")

self._part = part
self._surfaceGui = surfaceGui
self._guiObject = guiObject

ChangeHistoryService:FinishRecording(recording, Enum.FinishRecordingOperation.Commit)

return self
end

Expand Down

0 comments on commit 4ba1d8f

Please sign in to comment.