From a81cfe22edd6ac562790c4bffd770d92f1537e10 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 22 Aug 2023 00:36:37 +0200 Subject: [PATCH 1/6] addition of new skins --- src/accessories/AttachmentHelper.ttslua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/accessories/AttachmentHelper.ttslua b/src/accessories/AttachmentHelper.ttslua index 909c7c1e..0f187c8a 100644 --- a/src/accessories/AttachmentHelper.ttslua +++ b/src/accessories/AttachmentHelper.ttslua @@ -30,6 +30,16 @@ local BACKGROUNDS = { url = "http://cloud-3.steamusercontent.com/ugc/1754695635919102502/453D4426118C8A6DE2EA281184716E26CA924C84/", fontcolor = { 1, 1, 1 } }, + { + title = "Katja Eastbank", + url = "http://cloud-3.steamusercontent.com/ugc/2021606446228203475/62EEE12F4DB1EB80D79B087677459B954380215F/", + fontcolor = { 1, 1, 1 } + }, + { + title = "Ravenous", + url = "http://cloud-3.steamusercontent.com/ugc/2021606446228208075/EAC598A450BEE504A7FE179288F1FBBF7ABFA3E0/", + fontcolor = { 0, 0, 0 } + }, { title = "Sefina Rousseau", url = "http://cloud-3.steamusercontent.com/ugc/1754695635919099826/3C3CBFFAADB2ACA9957C736491F470AE906CC953/", @@ -40,6 +50,11 @@ local BACKGROUNDS = { url = "http://cloud-3.steamusercontent.com/ugc/2018214163838897493/8E38B96C5A8D703A59009A932432CBE21ABE63A2/", fontcolor = { 1, 1, 1 } }, + { + title = "Subject 5U-21 (Suzi)", + url = "http://cloud-3.steamusercontent.com/ugc/2021606446228199363/CE43D58F37C9F48BDD6E6E145FE29BADEFF4DBC5/", + fontcolor = { 1, 1, 1 } + }, { title = "Wooden Sledge", url = "http://cloud-3.steamusercontent.com/ugc/1750192233783143973/D526236AAE16BDBB98D3F30E27BAFC1D3E21F4AC/", From ccda7d759275824121ca34019bde716270782846 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 22 Aug 2023 01:05:08 +0200 Subject: [PATCH 2/6] load skin from dropped on card --- src/accessories/AttachmentHelper.ttslua | 40 ++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/accessories/AttachmentHelper.ttslua b/src/accessories/AttachmentHelper.ttslua index 0f187c8a..1d32e047 100644 --- a/src/accessories/AttachmentHelper.ttslua +++ b/src/accessories/AttachmentHelper.ttslua @@ -51,7 +51,7 @@ local BACKGROUNDS = { fontcolor = { 1, 1, 1 } }, { - title = "Subject 5U-21 (Suzi)", + title = "Subject 5U-21", url = "http://cloud-3.steamusercontent.com/ugc/2021606446228199363/CE43D58F37C9F48BDD6E6E145FE29BADEFF4DBC5/", fontcolor = { 1, 1, 1 } }, @@ -99,6 +99,44 @@ function getFontColor() return { 1, 1, 1 } end +-- attempt to load image from below card when dropped +function onDrop(playerColor) + local pos = self.getPosition():setAt("y", 2) + local search = Physics.cast({ + direction = { 0, -1, 0 }, + max_distance = 2, + type = 3, + size = { 0.1, 0.1, 0.1 }, + origin = pos + }) + + local syncName + for _, v in ipairs(search) do + if v.hit_object.tag == "Card" then + syncName = v.hit_object.getName() + break + end + end + + if not syncName then return end + + -- remove level information fron syncName + syncName = syncName:gsub("%s%(%d%)", "") + + -- loop through background table + for _, bgInfo in ipairs(BACKGROUNDS) do + if bgInfo.title == syncName then + printToColor("Background for '" .. syncName .. "' loaded!", playerColor, "Green") + local customInfo = self.getCustomObject() + customInfo.diffuse = bgInfo.url + self.setCustomObject(customInfo) + self.reload() + return + end + end + printToColor("Didn't find background for '" .. syncName .. "'!", playerColor, "Orange") +end + -- called by context menu to change background image function selectImage(color) -- generate list of options From 6c7f269b104b9a1677edeafe05d3651b61003958 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 22 Aug 2023 01:16:18 +0200 Subject: [PATCH 3/6] additional trigger of save function --- src/accessories/AttachmentHelper.ttslua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/accessories/AttachmentHelper.ttslua b/src/accessories/AttachmentHelper.ttslua index 1d32e047..f85729d7 100644 --- a/src/accessories/AttachmentHelper.ttslua +++ b/src/accessories/AttachmentHelper.ttslua @@ -127,10 +127,7 @@ function onDrop(playerColor) for _, bgInfo in ipairs(BACKGROUNDS) do if bgInfo.title == syncName then printToColor("Background for '" .. syncName .. "' loaded!", playerColor, "Green") - local customInfo = self.getCustomObject() - customInfo.diffuse = bgInfo.url - self.setCustomObject(customInfo) - self.reload() + updateImage(bgInfo.url) return end end @@ -147,13 +144,19 @@ function selectImage(color) -- prompt user to select option Player[color].showOptionsDialog("Select image:", options, 1, function(_, optionIndex) - local customInfo = self.getCustomObject() - customInfo.diffuse = BACKGROUNDS[optionIndex].url - self.setCustomObject(customInfo) - self.reload() + updateImage(BACKGROUNDS[optionIndex].url) end) end +-- sets background to the provided URL +function updateImage(url) + self.script_state = JSON.encode({ cardsInBag, showCost, showIcons }) + local customInfo = self.getCustomObject() + customInfo.diffuse = url + self.setCustomObject(customInfo) + self.reload() +end + -- only allow cards to enter, split decks and reject other objects function onObjectEnterContainer(container, object) if container ~= self then return end From 25dfaaf366a7496e777f21cbb507a7334fcdc2ce Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 22 Aug 2023 01:17:42 +0200 Subject: [PATCH 4/6] updated description --- .../AttachmentHelper.7f4976/AttachmentHelper.d45664.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/objects/OptionPanelSource.830bd0/AttachmentHelper.7f4976/AttachmentHelper.d45664.json b/objects/OptionPanelSource.830bd0/AttachmentHelper.7f4976/AttachmentHelper.d45664.json index 6aa0a289..72c7bbcf 100644 --- a/objects/OptionPanelSource.830bd0/AttachmentHelper.7f4976/AttachmentHelper.d45664.json +++ b/objects/OptionPanelSource.830bd0/AttachmentHelper.7f4976/AttachmentHelper.d45664.json @@ -23,7 +23,7 @@ "NormalURL": "", "TypeIndex": 6 }, - "Description": "Drop cards here to display name, cost and skill icons.\n\nSee context menu for options.", + "Description": "Drop cards here to display name, cost and skill icons.\n\nSee context menu for options.\n\nDrop this on another card to load the respective background if available.", "DragSelectable": true, "GMNotes": "", "GUID": "d45664", From cc887f3a65637ada088a79e8b502ba51a46b280b Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 22 Aug 2023 01:51:46 +0200 Subject: [PATCH 5/6] added ikiaq --- src/accessories/AttachmentHelper.ttslua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/accessories/AttachmentHelper.ttslua b/src/accessories/AttachmentHelper.ttslua index f85729d7..837a4a44 100644 --- a/src/accessories/AttachmentHelper.ttslua +++ b/src/accessories/AttachmentHelper.ttslua @@ -30,6 +30,11 @@ local BACKGROUNDS = { url = "http://cloud-3.steamusercontent.com/ugc/1754695635919102502/453D4426118C8A6DE2EA281184716E26CA924C84/", fontcolor = { 1, 1, 1 } }, + { + title = "Ikiaq", + url = "http://cloud-3.steamusercontent.com/ugc/2021606446228198966/5A408D8D760221DEA164E986B9BE1F79C4803071/", + fontcolor = { 1, 1, 1 } + }, { title = "Katja Eastbank", url = "http://cloud-3.steamusercontent.com/ugc/2021606446228203475/62EEE12F4DB1EB80D79B087677459B954380215F/", From 22004369e4cf0d37a1172e268f7a3841d9429c37 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 22 Aug 2023 02:31:45 +0200 Subject: [PATCH 6/6] added binders jar --- src/accessories/AttachmentHelper.ttslua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/accessories/AttachmentHelper.ttslua b/src/accessories/AttachmentHelper.ttslua index 837a4a44..2f8fcb13 100644 --- a/src/accessories/AttachmentHelper.ttslua +++ b/src/accessories/AttachmentHelper.ttslua @@ -15,6 +15,11 @@ local BACKGROUNDS = { url = "http://cloud-3.steamusercontent.com/ugc/2018212896278691928/F55BEFFC2540109C6333179532F583B367FF2EBC/", fontcolor = { 0, 0, 0 } }, + { + title = "Binder's Jar", + url = "http://cloud-3.steamusercontent.com/ugc/2021606446228642191/4C149527851C1DBB3015F93DE91667937A3F91DD/", + fontcolor = { 1, 1, 1 } + }, { title = "Crystallizer of Dreams", url = "http://cloud-3.steamusercontent.com/ugc/1915746489207280958/100F16441939E5E23818651D1EB5C209BF3125B9/",