temprarily lock objects
This commit is contained in:
parent
bd65901e3a
commit
699dd82c7b
@ -403,7 +403,7 @@ function doUpkeep(_, clickedByColor, isRightClick)
|
|||||||
Wait.time(function() deckLib.placeOrMergeIntoDeck(cardsToDiscard[i], returnGlobalDiscardPosition(), self.getRotation()) end, j * 0.1)
|
Wait.time(function() deckLib.placeOrMergeIntoDeck(cardsToDiscard[i], returnGlobalDiscardPosition(), self.getRotation()) end, j * 0.1)
|
||||||
end
|
end
|
||||||
|
|
||||||
--add some time if there are any cards to discard, if not, draw up to 5 immediately
|
-- add some time if there are any cards to discard, if not, draw up to 5 immediately
|
||||||
if j > 0 then
|
if j > 0 then
|
||||||
k = 0.7 + (j * 0.1)
|
k = 0.7 + (j * 0.1)
|
||||||
else
|
else
|
||||||
@ -1012,10 +1012,26 @@ function updateTexture(overrideName)
|
|||||||
-- apply texture
|
-- apply texture
|
||||||
local customInfo = self.getCustomObject()
|
local customInfo = self.getCustomObject()
|
||||||
if customInfo.image ~= newUrl then
|
if customInfo.image ~= newUrl then
|
||||||
|
-- temporarily lock objects so they don't fall through the mat
|
||||||
|
local objectsToUnlock = {}
|
||||||
|
for _, obj in ipairs(searchAroundSelf()) do
|
||||||
|
if not obj.getLock() then
|
||||||
|
obj.setLock(true)
|
||||||
|
table.insert(objectsToUnlock, obj)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
self.script_state = onSave()
|
self.script_state = onSave()
|
||||||
customInfo.image = newUrl
|
customInfo.image = newUrl
|
||||||
self.setCustomObject(customInfo)
|
self.setCustomObject(customInfo)
|
||||||
self.reload()
|
local reloadedMat = self.reload()
|
||||||
|
|
||||||
|
-- unlock objects when mat is reloaded
|
||||||
|
Wait.condition(function()
|
||||||
|
for _, obj in ipairs(objectsToUnlock) do
|
||||||
|
obj.setLock(false)
|
||||||
|
end
|
||||||
|
end, function() return reloadedMat.loading_custom == false end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user