Merge pull request #292 from argonui/victory-hotkey
"Move card to victory display" hotkey: correctly rotates cards when placing them and remove tokens from it
This commit is contained in:
commit
99bef9d4e1
@ -137,6 +137,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -194,6 +195,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -251,6 +253,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -308,6 +311,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -365,6 +369,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -422,6 +427,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -479,6 +485,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -536,6 +543,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -593,6 +601,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -650,6 +659,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -707,6 +717,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -764,6 +775,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -821,6 +833,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -878,6 +891,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -935,6 +949,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -992,6 +1007,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1049,6 +1065,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1106,6 +1123,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1163,6 +1181,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1220,6 +1239,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1277,6 +1297,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1334,6 +1355,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1391,6 +1413,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1448,6 +1471,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1505,6 +1529,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1562,6 +1587,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1619,6 +1645,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1676,6 +1703,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1733,6 +1761,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1790,6 +1819,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1847,6 +1877,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1904,6 +1935,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -1961,6 +1993,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2018,6 +2051,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2075,6 +2109,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2132,6 +2167,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2189,6 +2225,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2246,6 +2283,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2303,6 +2341,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2360,6 +2399,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2417,6 +2457,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2474,6 +2515,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2531,6 +2573,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2588,6 +2631,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2645,6 +2689,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2702,6 +2747,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2759,6 +2805,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
@ -2816,6 +2863,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "damage",
|
||||
"Name": "Custom_Token",
|
||||
"Nickname": "Damage",
|
||||
"Snap": false,
|
||||
|
@ -79,6 +79,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "path",
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "",
|
||||
"Snap": true,
|
||||
@ -139,6 +140,7 @@
|
||||
"LuaScript": "",
|
||||
"LuaScriptState": "",
|
||||
"MeasureMovement": false,
|
||||
"Memo": "path",
|
||||
"Name": "Custom_Tile",
|
||||
"Nickname": "",
|
||||
"Snap": true,
|
||||
|
@ -1,13 +1,18 @@
|
||||
local playAreaApi = require("core/PlayAreaApi")
|
||||
local tokenChecker = require("core/token/TokenChecker")
|
||||
local pendingCall = false
|
||||
local messageSent = {}
|
||||
local missingData = {}
|
||||
local countedVP = {}
|
||||
local highlightMissing = false
|
||||
local highlightCounted = false
|
||||
local TRASHCAN
|
||||
local TRASHCAN_GUID = "70b9f6"
|
||||
|
||||
-- button creation when loading the game
|
||||
function onLoad()
|
||||
TRASHCAN = getObjectFromGUID(TRASHCAN_GUID)
|
||||
|
||||
-- index 0: VP - "Display"
|
||||
local buttonParameters = {}
|
||||
buttonParameters.label = "0"
|
||||
@ -231,7 +236,7 @@ function highlightCountedVP()
|
||||
self.editButton({
|
||||
index = 4,
|
||||
tooltip = (highlightCounted and "Enable" or "Disable") ..
|
||||
" highlighting of cards with VP."
|
||||
" highlighting of cards with VP."
|
||||
})
|
||||
for _, obj in pairs(countedVP) do
|
||||
if obj ~= nil then
|
||||
@ -266,11 +271,28 @@ function placeCard(card)
|
||||
end
|
||||
end
|
||||
|
||||
-- remove tokens from the card
|
||||
for _, v in ipairs(searchOnObj(card)) do
|
||||
local obj = v.hit_object
|
||||
|
||||
-- don't touch decks / cards
|
||||
if obj.tag == "Deck" or obj.tag == "Card" then
|
||||
-- put chaos tokens back into bag
|
||||
elseif tokenChecker.isChaosToken(obj) then
|
||||
local chaosBag = Global.call("findChaosBag")
|
||||
chaosBag.putObject(obj)
|
||||
elseif obj.memo ~= nil and obj.getLock() == false then
|
||||
TRASHCAN.putObject(obj)
|
||||
end
|
||||
end
|
||||
|
||||
-- place the card
|
||||
local name = card.getName() or "Unnamed card"
|
||||
for i = 1, 10 do
|
||||
if fullSlots[i] ~= true then
|
||||
local rot = { 0, 270, card.getRotation().z }
|
||||
card.setPositionSmooth(positions[i], false, true)
|
||||
card.setRotation(rot)
|
||||
broadcastToAll("Victory Display: " .. name .. " placed into slot " .. i .. ".", "Green")
|
||||
return
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user