Merge pull request #1010 from argonui/token-draw-dummy

Added "Token Draw Dummys" - typing numbers to draw x tokens
This commit is contained in:
dscarpac 2024-11-20 11:52:15 -06:00 committed by GitHub
commit c1e93a4881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 272 additions and 3 deletions

View File

@ -187,6 +187,10 @@
"ChaosBagManager.023240",
"PlaceholderBoxDummy.a93466",
"PopestsBorderlessVol1.fecccd",
"TokenDrawDummy.dummy1",
"TokenDrawDummy.dummy2",
"TokenDrawDummy.dummy3",
"TokenDrawDummy.dummy4",
"Tokencache_1.a15273",
"Tokencache_0.0a8592",
"Tokencache_-1.b644d2",

View File

@ -124,7 +124,7 @@
},
"tooltip": "None",
"value": [
"Changes from 4.0.1\n- added handling for moving cards with tokens on them\n- added \"0 uses\" metadata for Charles Ross\n- added \"imprinting\" to Charisma / Relic Hunter (drop them on a playermat!)\n- turned \"randomize\" feature of action / ability tokens into a context menu entry\n- turned upgradesheets into XML and their boxes into crosses\n- fixed Clean Up Helper toggling the \"subtract doom\" feature\n- fixed DES scripting\n- fixed error with Navigation Overlay\n- fixed error with investigator placing on playermats\n- fixed error with Kohaku feedback messages\n- fixed issues with Campaign Importer / Exporter\n- fixed handling for cards with attachments (Deck Importer)\n\nHighlights from 4.0.0\n\nNew Stuff\n- added Parallel Mateo\n- added a global UI for the Bless / Curse manager\n- added a \"shuffle discard into deck\" button to playermats (for example for the mulligan)\n- added XML helper for \"Stella Clark\", \"The Red Clock\" and \"Elle Rubash\"\n- added \"clickability\" to damage / horror tokens and updated the font / image\n- added investigator specific things spawning when placing (e.g. Bounty tokens for Tony)\n- added a right-click function to the left-most \"Discard\" button on playermats\n- added ability for the \"doom in play\" counter to subtract from the total (e.g. for The Longest Night)\n\nBugfixes\n- fixed hotkey for multi-handed Upkeep\n- fixed wrong visibility of playermat option panels after loading\n- fixed issues with token redrawing\n- fixed issues with scenario reference card detection\n- updated Navigation Overlay to not break with removed playermats\n- Clean Up Helper: 'nil' handling for scenario, mini card detection and action token resetting\n\nThe campaigns were also updated with improved helpers and upgraded campaign logs!\nPreviewed / spoiled cards for the upcoming cycle \"The Drowned City\" can be accessed\nvia the download menu (bottom right corner of your screen).\n"
"Changes from 4.0.1\n- added handling for moving cards with tokens on them\n- added ability for 'number typing' to the chaos token draw button\n- added \"0 uses\" metadata for Charles Ross\n- added \"imprinting\" to Charisma / Relic Hunter (drop them on a playermat!)\n- turned \"randomize\" feature of action / ability tokens into a context menu entry\n- turned upgradesheets into XML and their boxes into crosses\n- fixed Clean Up Helper toggling the \"subtract doom\" feature\n- fixed DES scripting\n- fixed error with Navigation Overlay\n- fixed error with investigator placing on playermats\n- fixed error with Kohaku feedback messages\n- fixed issues with Campaign Importer / Exporter\n- fixed handling for cards with attachments (Deck Importer)\n\nHighlights from 4.0.0\n\nNew Stuff\n- added Parallel Mateo\n- added a global UI for the Bless / Curse manager\n- added a \"shuffle discard into deck\" button to playermats (for example for the mulligan)\n- added XML helper for \"Stella Clark\", \"The Red Clock\" and \"Elle Rubash\"\n- added \"clickability\" to damage / horror tokens and updated the font / image\n- added investigator specific things spawning when placing (e.g. Bounty tokens for Tony)\n- added a right-click function to the left-most \"Discard\" button on playermats\n- added ability for the \"doom in play\" counter to subtract from the total (e.g. Longest Night)\n\nBugfixes\n- fixed hotkey for multi-handed Upkeep\n- fixed wrong visibility of playermat option panels after loading\n- fixed issues with token redrawing\n- fixed issues with scenario reference card detection\n- updated Navigation Overlay to not break with removed playermats\n- Clean Up Helper: 'nil' handling for scenario, mini card detection and action token resetting\n\nThe campaigns were also updated with improved helpers and upgraded campaign logs!\nPreviewed / spoiled cards for the upcoming cycle \"The Drowned City\" can be accessed\nvia the download menu (bottom right corner of your screen).\n"
]
}
],

View File

@ -0,0 +1,58 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0,
"g": 0,
"r": 0
},
"CustomImage": {
"CustomTile": {
"Stackable": false,
"Stretch": true,
"Thickness": 0.1,
"Type": 2
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
"WidthScale": 0
},
"Description": "",
"DragSelectable": false,
"GMNotes": "",
"GUID": "dummy1",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
"LuaScriptState": "",
"MeasureMovement": false,
"Memo": "White",
"Name": "Custom_Tile",
"Nickname": "Token Draw Dummy",
"Snap": true,
"Sticky": true,
"Tooltip": false,
"Transform": {
"posX": -50.25,
"posY": 1.3,
"posZ": 4.2,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 0.9,
"scaleY": 1,
"scaleZ": 0.9
},
"Value": 0,
"XmlUI": ""
}

View File

@ -0,0 +1,58 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0,
"g": 0,
"r": 0
},
"CustomImage": {
"CustomTile": {
"Stackable": false,
"Stretch": true,
"Thickness": 0.1,
"Type": 2
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
"WidthScale": 0
},
"Description": "",
"DragSelectable": false,
"GMNotes": "",
"GUID": "dummy2",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
"LuaScriptState": "",
"MeasureMovement": false,
"Memo": "White",
"Name": "Custom_Tile",
"Nickname": "Token Draw Dummy",
"Snap": true,
"Sticky": true,
"Tooltip": false,
"Transform": {
"posX": -50.25,
"posY": 1.3,
"posZ": -28,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 0.9,
"scaleY": 1,
"scaleZ": 0.9
},
"Value": 0,
"XmlUI": ""
}

View File

@ -0,0 +1,58 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0,
"g": 0,
"r": 0
},
"CustomImage": {
"CustomTile": {
"Stackable": false,
"Stretch": true,
"Thickness": 0.1,
"Type": 2
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
"WidthScale": 0
},
"Description": "",
"DragSelectable": false,
"GMNotes": "",
"GUID": "dummy3",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
"LuaScriptState": "",
"MeasureMovement": false,
"Memo": "White",
"Name": "Custom_Tile",
"Nickname": "Token Draw Dummy",
"Snap": true,
"Sticky": true,
"Tooltip": false,
"Transform": {
"posX": -42.25,
"posY": 1.3,
"posZ": 21.85,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"scaleX": 0.9,
"scaleY": 1,
"scaleZ": 0.9
},
"Value": 0,
"XmlUI": ""
}

View File

@ -0,0 +1,58 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0,
"g": 0,
"r": 0
},
"CustomImage": {
"CustomTile": {
"Stackable": false,
"Stretch": true,
"Thickness": 0.1,
"Type": 2
},
"ImageScalar": 1,
"ImageSecondaryURL": "",
"ImageURL": "https://steamusercontent-a.akamaihd.net/ugc/2501268517219098388/0936FEE03B410319658B5E05DB5D486CEDDE98F5/",
"WidthScale": 0
},
"Description": "",
"DragSelectable": false,
"GMNotes": "",
"GUID": "dummy4",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"playermat/TokenDrawDummy\")",
"LuaScriptState": "",
"MeasureMovement": false,
"Memo": "White",
"Name": "Custom_Tile",
"Nickname": "Token Draw Dummy",
"Snap": true,
"Sticky": true,
"Tooltip": false,
"Transform": {
"posX": -18.45,
"posY": 1.3,
"posZ": -21.85,
"rotX": 0,
"rotY": 180,
"rotZ": 0,
"scaleX": 0.9,
"scaleY": 1,
"scaleZ": 0.9
},
"Value": 0,
"XmlUI": ""
}

View File

@ -11,6 +11,7 @@ local GuidReferences = {
Playermat = "8b081b",
ResourceCounter = "4406f0",
TokenDiscardZone = "457de3",
TokenDrawDummy = "dummy1",
Trash = "147e80"
},
Orange = {
@ -23,6 +24,7 @@ local GuidReferences = {
Playermat = "bd0ff4",
ResourceCounter = "816d84",
TokenDiscardZone = "457de4",
TokenDrawDummy = "dummy2",
Trash = "f7b6c8"
},
Green = {
@ -40,6 +42,7 @@ local GuidReferences = {
Playermat = "383d8b",
ResourceCounter = "cd15ac",
TokenDiscardZone = "457de5",
TokenDrawDummy = "dummy3",
TokenRemover = "2ba7a5",
Trash = "5f896a"
},
@ -58,6 +61,7 @@ local GuidReferences = {
Playermat = "0840d5",
ResourceCounter = "a4b60d",
TokenDiscardZone = "457de6",
TokenDrawDummy = "dummy4",
TokenRemover = "39b175",
Trash = "4b8594"
},

View File

@ -554,9 +554,16 @@ function drawChaosToken(params)
-- add the token to the list, compute new position based on list length
local tokenOffset = Vector(-1.55 + 0.17 * #chaosTokens, 0.25, -0.58)
-- slightly rotate subsequent chaos tokens
local tokenRotZ = 0
if #chaosTokens > 0 then
tokenRotZ = 354.5
end
local takeParameters = params.takeParameters or {}
takeParameters.position = takeParameters.position or params.mat.positionToWorld(tokenOffset)
takeParameters.rotation = takeParameters.rotation or params.mat.getRotation()
takeParameters.rotation = takeParameters.rotation or params.mat.getRotation():setAt("z", tokenRotZ)
local token
if params.guidToBeResolved then

View File

@ -72,7 +72,7 @@ TOUR_SCRIPT = {
},
{
narrator = "Jacqueline",
text = "When the ire of fate finds you and the chaos looms, this large button will draw a chaos token. Click it again to return the token to the bag.\n\nWhether a vision of the future or a curse from the opponents we face, if you need additional tokens a right-click will draw more. I wish you luck, but have a vision of red tentacles reaching for you...",
text = "When the ire of fate finds you and the chaos looms, this large button will draw a chaos token. Click it again to return the token to the bag.\n\nWhether a vision of the future or a curse from the opponents we face, if you need additional tokens a right-click will draw more. In case you need to draw multiple at once, type the number while hovering it...",
showPos = { x = -35, y = -20, z = 4.25 },
position = "north",
skipCentering = true,

View File

@ -0,0 +1,22 @@
local chaosBagApi = require("chaosbag/ChaosBagApi")
local guidReferenceApi = require("core/GUIDReferenceApi")
local matColor
function onLoad()
matColor = self.getMemo()
self.max_typed_number = 9
end
function onNumberTyped(playerColor, number)
if number < 1 then return end
printToColor("Drawing " .. number .. " chaos tokens", playerColor)
local mat = guidReferenceApi.getObjectByOwnerAndType(matColor, "Playermat")
if mat ~= nil then
for i = 1, number do
chaosBagApi.drawChaosToken(mat, true)
end
end
end