Merge branch 'main' into removal-of-fan-placeholders

This commit is contained in:
Chr1Z93 2023-10-20 15:54:18 +02:00
commit ca3fa692c5
25 changed files with 337 additions and 61 deletions

View File

@ -3,7 +3,6 @@
"ComponentTags_path": "ComponentTags.json",
"CustomUIAssets_path": "CustomUIAssets.json",
"DecalPallet_path": "DecalPallet.json",
"Decals": [],
"GameComplexity": "",
"GameMode": "Arkham Horror LCG - Super Complete Edition",
"GameType": "",
@ -198,6 +197,7 @@
"TokenArranger.022907",
"ChaosBagManager.023240",
"ArkhamSCE330-1092023-Page1.964222",
"PlaceholderBoxDummy.a93466",
"SoulsofDarkness.a94e6b"
],
"PlayArea": 1,

View File

@ -56,10 +56,6 @@
"displayed": "chaosBag",
"normalized": "chaosbag"
},
{
"displayed": "arkham_setup_memory_object",
"normalized": "arkham_setup_memory_object"
},
{
"displayed": "ActionToken",
"normalized": "actiontoken"

View File

@ -28,9 +28,6 @@
"Nickname": "Arkham Deck Cutter",
"Snap": true,
"Sticky": true,
"Tags": [
"arkham_setup_memory_object"
],
"Tooltip": true,
"Transform": {
"posX": 78,

View File

@ -14,11 +14,12 @@
"r": 1
},
"ContainedObjects_order": [
"BadBlood.451eaa",
"RedTideRising.5302f2",
"AllorNothing.72ab92",
"BadBlood.451eaa",
"BytheBook.cc7eb3",
"LaidtoRest.e2dd57",
"ReadorDie.9e73fa",
"BytheBook.cc7eb3"
"RedTideRising.5302f2"
],
"ContainedObjects_path": "ChallengeScenarios.9f6801",
"CustomMesh": {
@ -64,7 +65,7 @@
"Tooltip": true,
"Transform": {
"posX": -9,
"posY": 1.481,
"posY": 1.482,
"posZ": -76,
"rotX": 0,
"rotY": 270,

View File

@ -1 +1 @@
{"ml":{"451eaa":{"lock":false,"pos":{"x":12.2499580383301,"y":1.46560525894165,"z":3.98636198043823},"rot":{"x":359.920135498047,"y":269.999908447266,"z":0.016873624175787}},"5302f2":{"lock":false,"pos":{"x":12.2504663467407,"y":1.45853757858276,"z":-20.013650894165},"rot":{"x":359.920135498047,"y":270.00146484375,"z":0.0168716721236706}},"72ab92":{"lock":false,"pos":{"x":12.2520532608032,"y":1.4679582118988,"z":11.9863719940186},"rot":{"x":359.920135498047,"y":270,"z":0.0168737415224314}},"9e73fa":{"lock":false,"pos":{"x":12.2500581741333,"y":1.46089386940002,"z":-12.0136384963989},"rot":{"x":359.920135498047,"y":269.999847412109,"z":0.0168744903057814}},"cc7eb3":{"lock":false,"pos":{"x":12.2495565414429,"y":1.46325027942657,"z":-4.01364088058472},"rot":{"x":359.920135498047,"y":269.999908447266,"z":0.0168744102120399}}}}
{"ml":{"451eaa":{"lock":false,"pos":{"x":12.252,"y":1.4815,"z":11.986},"rot":{"x":0,"y":269.9999,"z":0}},"5302f2":{"lock":false,"pos":{"x":12.2505,"y":1.4815,"z":-20.0137},"rot":{"x":0,"y":270.0014,"z":0}},"72ab92":{"lock":false,"pos":{"x":12.25,"y":1.4815,"z":19.986},"rot":{"x":0,"y":269.9999,"z":0}},"9e73fa":{"lock":false,"pos":{"x":12.2501,"y":1.4815,"z":-12.0137},"rot":{"x":0,"y":269.9998,"z":0}},"cc7eb3":{"lock":false,"pos":{"x":12.25,"y":1.4815,"z":3.986},"rot":{"x":0,"y":269.9999,"z":0}},"e2dd57":{"lock":false,"pos":{"x":12.25,"y":1.4815,"z":-4.014},"rot":{"x":0,"y":270,"z":0}}}}

View File

@ -71,9 +71,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 12.252,
"posY": 1.468,
"posZ": 11.986,
"posX": 12.25,
"posY": 1.481,
"posZ": 19.986,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -71,9 +71,9 @@
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 12.25,
"posY": 1.466,
"posZ": 3.986,
"posX": 12.252,
"posY": 1.481,
"posZ": 11.986,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -72,8 +72,8 @@
"Tooltip": true,
"Transform": {
"posX": 12.25,
"posY": 1.463,
"posZ": -4.014,
"posY": 1.481,
"posZ": 3.986,
"rotX": 0,
"rotY": 270,
"rotZ": 0,

View File

@ -0,0 +1,86 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"AttachedDecals": [
{
"CustomDecal": {
"ImageURL": "http://cloud-3.steamusercontent.com/ugc/959719855119695911/931B9829687A20F4DEADB36DA57B7E6D76792231/",
"Name": "dunwich_back",
"Size": 7.4
},
"Transform": {
"posX": 0,
"posY": 0,
"posZ": 0,
"rotX": 270,
"rotY": 0,
"rotZ": 0,
"scaleX": 2,
"scaleY": 2,
"scaleZ": 2
}
}
],
"Autoraise": true,
"ColorDiffuse": {
"a": 0.27451,
"b": 1,
"g": 1,
"r": 1
},
"CustomMesh": {
"CastShadows": true,
"ColliderURL": "",
"Convex": true,
"CustomShader": {
"FresnelStrength": 0,
"SpecularColor": {
"b": 1,
"g": 1,
"r": 1
},
"SpecularIntensity": 0,
"SpecularSharpness": 2
},
"DiffuseURL": "http://cloud-3.steamusercontent.com/ugc/2115061845788468343/B7611EC7DCD2008B87D6518EBEFF0AD36EFE5B54/",
"MaterialIndex": 3,
"MeshURL": "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj",
"NormalURL": "",
"TypeIndex": 0
},
"Description": "Challenge Scenario",
"DragSelectable": true,
"GMNotes": "scenarios/challenge_laid_to_rest.json",
"GUID": "e2dd57",
"Grid": true,
"GridProjection": false,
"Hands": true,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": false,
"LuaScript": "require(\"core/DownloadBox\")",
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "Custom_Model",
"Nickname": "Laid to Rest",
"Snap": true,
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 12.25,
"posY": 1.481,
"posZ": -4.014,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 2.21,
"scaleY": 0.46,
"scaleZ": 2.42
},
"Value": 0,
"XmlUI": ""
}

View File

@ -72,7 +72,7 @@
"Tooltip": true,
"Transform": {
"posX": 12.25,
"posY": 1.461,
"posY": 1.481,
"posZ": -12.014,
"rotX": 0,
"rotY": 270,

View File

@ -72,7 +72,7 @@
"Tooltip": true,
"Transform": {
"posX": 12.25,
"posY": 1.459,
"posY": 1.481,
"posZ": -20.014,
"rotX": 0,
"rotY": 270,

View File

@ -0,0 +1,45 @@
{
"AltLookAngle": {
"x": 0,
"y": 0,
"z": 0
},
"Autoraise": true,
"ColorDiffuse": {
"b": 0.82353,
"g": 0.20157,
"r": 0
},
"Description": "This dummy is there to hold the up-to-date script file for placeholder boxes to be available for placeholder box spawning.",
"DragSelectable": true,
"GMNotes": "",
"GUID": "a93466",
"Grid": true,
"GridProjection": false,
"Hands": false,
"HideWhenFaceDown": false,
"IgnoreFoW": false,
"LayoutGroupSortIndex": 0,
"Locked": true,
"LuaScript": "require(\"core/DownloadBox\")",
"LuaScriptState": "",
"MeasureMovement": false,
"Name": "BlockRectangle",
"Nickname": "Placeholder Box Dummy",
"Snap": true,
"Sticky": true,
"Tooltip": true,
"Transform": {
"posX": 78,
"posY": 1.645,
"posZ": -33,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"scaleX": 1,
"scaleY": 1,
"scaleZ": 1
},
"Value": 0,
"XmlUI": ""
}

View File

@ -351,10 +351,6 @@
"Nickname": "Playermat 4: Red",
"Snap": true,
"Sticky": true,
"Tags": [
"Red",
"Playermat"
],
"Tooltip": false,
"Transform": {
"posX": -30.35,

View File

@ -14,7 +14,7 @@
"PDFPage": 0,
"PDFPageOffset": 0,
"PDFPassword": "",
"PDFUrl": "https://images-cdn.fantasyflightgames.com/filer_public/c4/b0/c4b0d66c-d79e-411b-bdb5-b5d8c457d4bc/ahc01_rules_reference_web.pdf"
"PDFUrl": "http://cloud-3.steamusercontent.com/ugc/2115061845793806189/6FC67F9AF9224452E2D8F25E63B88D702B21B0DC/"
},
"Description": "",
"DragSelectable": true,

View File

@ -312,6 +312,10 @@ function layout(_, _, isRightClick)
local value = tonumber(objData.Nickname)
local precedence = tokenPrecedence[objData.Nickname]
-- remove GUID to avoid issues for high latency clients
objData["GUID"] = nil
-- store data with value / precendence
data[i] = {
token = objData,
value = value or precedence[1]

View File

@ -295,7 +295,12 @@ do
local card = allCardsBagApi.getCardById(cardId)
if (card ~= nil and card.metadata.bonded ~= nil) then
for _, bond in ipairs(card.metadata.bonded) do
-- add a bonded card for each copy of the parent card (except for Pendant of the Queen)
if bond.id == "06022" then
bondedCards[bond.id] = bond.count
else
bondedCards[bond.id] = bond.count * cardCount
end
-- We need to know which cards are bonded to determine their position, remember them
bondedList[bond.id] = true
-- Also adding taboo versions of bonded cards to the list

View File

@ -56,6 +56,7 @@ local GuidReferences = {
MythosArea = "9f334f",
NavigationOverlayHandler = "797ede",
OptionPanelSource = "830bd0",
PlaceholderBoxDummy = "a93466",
PlayArea = "721ba2",
PlayAreaZone = "a2f932",
PlayerCardPanel = "2d30ee",

View File

@ -717,6 +717,128 @@ function downloadCoroutine()
return 1
end
-- spawns a bag that contains every object from the library
function onClick_downloadAll()
broadcastToAll("Download initiated - this will take a few minutes!")
-- hide download window
if xmlVisibility.downloadWindow then
xmlVisibility.downloadWindow = false
UI.hide('downloadWindow')
end
startLuaCoroutine(Global, "coroutineDownloadAll")
end
function coroutineDownloadAll()
local JSON = [[
{
"Name": "Bag",
"Transform": {
"posX": -39.5,
"posY": 2,
"posZ": -87,
"rotX": 0,
"rotY": 270,
"rotZ": 0,
"scaleX": 1.0,
"scaleY": 1.0,
"scaleZ": 1.0
},
"Nickname": "All Downloadable Content",
"Bag": {
"Order": 0
},
"ContainedObjects": [
]]
local contained = ""
local downloadedItems = 0
local skippedItems = 0
-- loop through the library to add content
for contentType, objectList in pairs(library) do
broadcastToAll("Downloading " .. contentType .. "...")
for _, params in ipairs(objectList) do
local request = WebRequest.get(SOURCE_REPO .. '/' .. params.url)
local start = os.time()
while true do
if request.is_done then
contained = contained .. request.text .. ","
downloadedItems = downloadedItems + 1
break
-- time-out if item can't be loaded in 5s
elseif request.is_error or (os.time() - start) > 5 then
skippedItems = skippedItems + 1
break
end
coroutine.yield(0)
end
end
end
JSON = JSON .. contained .. "]}"
spawnObjectJSON({json = JSON})
broadcastToAll(downloadedItems .. " objects downloaded.", "Green")
broadcastToAll(skippedItems .. " objects had a time-out / error.", "Orange")
return 1
end
-- spawns a placeholder box for the selected object
function onClick_spawnPlaceholder()
-- get object references
local item = library[contentToShow][currentListItem]
local dummy = guidReferenceApi.getObjectByOwnerAndType("Mythos", "PlaceholderBoxDummy")
-- error handling
if not item.boxsize or item.boxsize == "" or not item.boxart or item.boxart == "" then
print("Error loading object.")
return
end
-- get data for placeholder
local spawnPos = {-39.5, 2, -87}
local meshTable = {
big = "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/core_h_MSH.obj",
small = "https://raw.githubusercontent.com/RobMayer/TTSLibrary/master/advboxes/tuckbox_h_MSH.obj",
wide = "http://pastebin.com/raw.php?i=uWAmuNZ2"
}
local scaleTable = {
big = {1.00, 0.14, 1.00},
small = {2.21, 0.46, 2.42},
wide = {2.00, 0.11, 1.69}
}
local placeholder = spawnObject({
type = "Custom_Model",
position = spawnPos,
rotation = {0, 270, 0},
scale = scaleTable[item.boxsize],
})
placeholder.setCustomObject({
mesh = meshTable[item.boxsize],
diffuse = item.boxart,
material = 3
})
placeholder.setColorTint({1, 1, 1, 71/255})
placeholder.setName(item.name)
placeholder.setDescription("by " .. (item.author or "Unknown"))
placeholder.setGMNotes(item.url)
placeholder.setLuaScript(dummy.getLuaScript())
Player.getPlayers()[1].pingTable(spawnPos)
-- hide download window
if xmlVisibility.downloadWindow then
xmlVisibility.downloadWindow = false
UI.hide('downloadWindow')
end
end
-- toggles the visibility of the respective UI
---@param player LuaPlayer Player that triggered this
---@param title String Name of the UI to toggle

View File

@ -221,9 +221,11 @@ do
-- Copy the offsets to make sure we don't change the static values
local baseOffsets = offsets
offsets = { }
-- get a vector for the shifting (downwards local to the card)
local shiftDownVector = Vector(0, 0, shiftDown):rotateOver("y", card.getRotation().y)
for i, baseOffset in ipairs(baseOffsets) do
offsets[i] = baseOffset
offsets[i][3] = offsets[i][3] + shiftDown
offsets[i] = baseOffset + shiftDownVector
end
end

View File

@ -25,16 +25,16 @@ customizations = {
checkboxes = {
posZ = -0.44,
count = 2,
},
textField = {
position = { 0.6295, 0.25, -0.44 },
width = 290
}
},
[4] = {
checkboxes = {
posZ = -0.05,
count = 2,
},
textField = {
position = { 0.6295, 0.25, -0.44 },
width = 290
}
},
[5] = {

View File

@ -12,6 +12,12 @@
color="white"/>
<Button class="activeTab"
color="#ffffff"/>
<Button class="windowButton"
hoverClass="bGrey"
pressClass="bWhite"
selectClass="bWhite"
color="#888888"
font="font_teutonic-arkham"/>
</Defaults>
<!-- window to select downloadable content -->
@ -27,13 +33,32 @@
<!-- window header -->
<Panel preferredHeight="60"
padding="10 10 5 5"
spacing="10"
outlineSize="2 2"
outline="#303030"
color="black">
<Text fontSize="32"
font="font_teutonic-arkham"
preferredWidth="600"
alignment="MiddleLeft">Downloadable Content</Text>
<Panel>
<Button id="downloadAll_button"
class="windowButton"
visibility="Black"
onClick="onClick_downloadAll"
height="30"
preferredWidth="110"
fontSize="20"
tooltip="Very rough estimate: 400 MB"
tooltipPosition="Above"
tooltipBackgroundColor="rgba(0,0,0,1)">Download Everything</Button>
<Button id="spawnPlaceholder_button"
class="windowButton"
visibility="Black"
onClick="onClick_spawnPlaceholder"
height="30"
preferredWidth="110"
fontSize="20">Spawn Placeholder</Button>
<Panel preferredWidth="50">
<Button rectAlignment="MiddleRight"
width="50"
color="clear"
@ -116,15 +141,11 @@
<Panel preferredHeight="60">
<!-- download button -->
<Button id="download_button"
hoverClass="bGrey"
pressClass="bWhite"
selectClass="bWhite"
class="windowButton"
onClick="onClick_download"
color="#888888"
height="50"
width="270"
fontSize="28"
font="font_teutonic-arkham">Download</Button>
fontSize="28">Download</Button>
<!-- download progress bar -->
<ProgressBar id="download_progress"
active="false"