Handle review comments
This commit is contained in:
parent
2eba59d971
commit
c04c7df9f1
@ -2,7 +2,7 @@
|
||||
-- Amount to shift for the next card (zShift) or next row of cards (xShift)
|
||||
-- Note that the table rotation is weird, and the X axis is vertical while the
|
||||
-- Z axis is horizontal
|
||||
local zShift = -2.29998
|
||||
local SPREAD_Z_SHIFT = -2.3
|
||||
|
||||
Spawner = { }
|
||||
|
||||
@ -53,7 +53,7 @@ Spawner.spawnCardSpread = function(cardList, startPos, rot, sort, callback)
|
||||
local position = { x = startPos.x, y = startPos.y, z = startPos.z }
|
||||
for _, card in ipairs(cardList) do
|
||||
Spawner.spawn({ card }, position, rot, callback)
|
||||
position.z = position.z + zShift
|
||||
position.z = position.z + SPREAD_Z_SHIFT
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -42,14 +42,28 @@ end
|
||||
|
||||
function createActionButtons()
|
||||
self.createButton({
|
||||
label="Place", click_function="buttonClick_place", function_owner=self,
|
||||
position={1,0.1,2.1}, rotation={0,0,0}, height=350, width=800,
|
||||
font_size=250, color={0,0,0}, font_color={1,1,1}
|
||||
label="Place",
|
||||
click_function="buttonClick_place",
|
||||
function_owner=self,
|
||||
position={1,0.1,2.1},
|
||||
rotation={0,0,0},
|
||||
height=350,
|
||||
width=800,
|
||||
font_size=250,
|
||||
color={0,0,0},
|
||||
font_color={1,1,1}
|
||||
})
|
||||
self.createButton({
|
||||
label="Recall", click_function="buttonClick_recall", function_owner=self,
|
||||
position={-1,0.1,2.1}, rotation={0,0,0}, height=350, width=800,
|
||||
font_size=250, color={0,0,0}, font_color={1,1,1}
|
||||
label="Recall",
|
||||
click_function="buttonClick_recall",
|
||||
function_owner=self,
|
||||
position={-1,0.1,2.1},
|
||||
rotation={0,0,0},
|
||||
height=350,
|
||||
width=800,
|
||||
font_size=250,
|
||||
color={0,0,0},
|
||||
font_color={1,1,1}
|
||||
})
|
||||
end
|
||||
|
||||
@ -57,7 +71,7 @@ function buttonClick_place()
|
||||
SpawnBag.spawn(SPAWN_SPEC)
|
||||
end
|
||||
|
||||
--Recalls objects to bag from table
|
||||
-- Recalls objects to bag from table
|
||||
function buttonClick_recall()
|
||||
SpawnBag.recall()
|
||||
end
|
||||
|
@ -53,7 +53,6 @@ local RECALL_BAG = {
|
||||
Tooltip = false,
|
||||
}
|
||||
|
||||
|
||||
-- Tracks what has been placed by this "bag" so they can be recalled
|
||||
local placedSpecs = { }
|
||||
local placedObjectGuids = { }
|
||||
@ -68,13 +67,11 @@ end
|
||||
|
||||
-- Generates a table of save state that can be included in the parent object's onSave
|
||||
SpawnBag.getStateForSave = function()
|
||||
local saveState = {
|
||||
return {
|
||||
placed = placedSpecs,
|
||||
placedObjects = placedObjectGuids,
|
||||
recall = recallZone,
|
||||
}
|
||||
|
||||
return saveState
|
||||
end
|
||||
|
||||
-- Places the given spawnSpec on the table. See SpawnBag.ttslua header for spawnSpec table data and
|
||||
@ -149,7 +146,7 @@ function expandRecallZone(spawnedCard)
|
||||
recallZone.upperLeft.x = pos.x + RECALL_BUFFER_X
|
||||
end
|
||||
if (pos.x < recallZone.lowerRight.x) then
|
||||
recallZone.upperLeft.x = pos.x - RECALL_BUFFER_X
|
||||
recallZone.lowerRight.x = pos.x - RECALL_BUFFER_X
|
||||
end
|
||||
if (pos.z > recallZone.upperLeft.z) then
|
||||
recallZone.upperLeft.z = pos.z + RECALL_BUFFER_Z
|
||||
|
Loading…
Reference in New Issue
Block a user