bugfix
This commit is contained in:
parent
c61d6dc6d5
commit
a62e08c65b
@ -20,6 +20,7 @@
|
|||||||
"Note": "",
|
"Note": "",
|
||||||
"ObjectStates_order": [
|
"ObjectStates_order": [
|
||||||
"GUIDReferenceHandler.123456",
|
"GUIDReferenceHandler.123456",
|
||||||
|
"GameKeyHandler.fce69c",
|
||||||
"TokenSpawnTracker.e3ffc9",
|
"TokenSpawnTracker.e3ffc9",
|
||||||
"HandTrigger.5fe087",
|
"HandTrigger.5fe087",
|
||||||
"HandTrigger.be2f17",
|
"HandTrigger.be2f17",
|
||||||
@ -196,7 +197,6 @@
|
|||||||
"Fan-MadeExpansionOverview.de7cae",
|
"Fan-MadeExpansionOverview.de7cae",
|
||||||
"OptionPanelSource.830bd0",
|
"OptionPanelSource.830bd0",
|
||||||
"SoundCube.3c988f",
|
"SoundCube.3c988f",
|
||||||
"GameKeyHandler.fce69c",
|
|
||||||
"TokenSpawningReference.f8b3a7",
|
"TokenSpawningReference.f8b3a7",
|
||||||
"3DText.d628cc",
|
"3DText.d628cc",
|
||||||
"NavigationOverlayHandler.797ede",
|
"NavigationOverlayHandler.797ede",
|
||||||
|
@ -15,22 +15,22 @@ function onLoad(savedData)
|
|||||||
addHotkey("Drawing Tool: Redraw", processLines)
|
addHotkey("Drawing Tool: Redraw", processLines)
|
||||||
end
|
end
|
||||||
|
|
||||||
function onScriptingButtonDown(index, player_color)
|
function onScriptingButtonDown(index, playerColor)
|
||||||
if index ~= 10 then return end
|
if index ~= 10 then return end
|
||||||
|
|
||||||
Timer.create {
|
Timer.create {
|
||||||
identifier = player_color .. "_draw_from",
|
identifier = playerColor .. "_draw_from",
|
||||||
function_name = "draw_from",
|
function_name = "draw_from",
|
||||||
parameters = { Player[player_color] },
|
parameters = { player = Player[playerColor] },
|
||||||
delay = 1
|
delay = 1
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function draw_from(player)
|
function draw_from(params)
|
||||||
local source = player.getHoverObject()
|
local source = params.player.getHoverObject()
|
||||||
if not source then return end
|
if not source then return end
|
||||||
|
|
||||||
for _, item in ipairs(player.getSelectedObjects()) do
|
for _, item in ipairs(params.player.getSelectedObjects()) do
|
||||||
if item ~= source then
|
if item ~= source then
|
||||||
if item.getGUID() > source.getGUID() then
|
if item.getGUID() > source.getGUID() then
|
||||||
addPair(item, source)
|
addPair(item, source)
|
||||||
@ -43,13 +43,13 @@ function draw_from(player)
|
|||||||
processLines()
|
processLines()
|
||||||
end
|
end
|
||||||
|
|
||||||
function onScriptingButtonUp(index, player_color)
|
function onScriptingButtonUp(index, playerColor)
|
||||||
if index ~= 10 then return end
|
if index ~= 10 then return end
|
||||||
|
|
||||||
-- returns true only if there is a timer to cancel. If this is false then we've waited longer than a second.
|
-- returns true only if there is a timer to cancel. If this is false then we've waited longer than a second.
|
||||||
if not Timer.destroy(player_color .. "_draw_from") then return end
|
if not Timer.destroy(playerColor .. "_draw_from") then return end
|
||||||
|
|
||||||
local items = Player[player_color].getSelectedObjects()
|
local items = Player[playerColor].getSelectedObjects()
|
||||||
if #items < 2 then return end
|
if #items < 2 then return end
|
||||||
|
|
||||||
table.sort(items, function(a, b) return a.getGUID() > b.getGUID() end)
|
table.sort(items, function(a, b) return a.getGUID() > b.getGUID() end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user