diff --git a/images/settings/deathlink.png b/images/settings/deathlink.png new file mode 100644 index 0000000..cd1cdc3 Binary files /dev/null and b/images/settings/deathlink.png differ diff --git a/items/items.json b/items/items.json index d21abe6..c6c5b2f 100644 --- a/items/items.json +++ b/items/items.json @@ -154,5 +154,11 @@ "type": "toggle", "img": "/images/settings/achievements_all.png", "codes": "achievements_all" + }, + { + "name": "Deathlink", + "type": "toggle", + "img": "/images/settings/deathlink.png", + "codes": "deathlink" } ] \ No newline at end of file diff --git a/layouts/deathlink.json b/layouts/deathlink.json new file mode 100644 index 0000000..d495725 --- /dev/null +++ b/layouts/deathlink.json @@ -0,0 +1,28 @@ +{ + "deathlink_layout": { + "type": "array", + "orientation": "vertical", + "margin": "0,0", + "content": [ + { + "type": "array", + "orientation": "vertical", + "margin": "0,0", + "content": [ + { + "type": "itemgrid", + "item_size": "4, 4", + "item_margin": "2, 2", + "item_h_alignment": "center", + "h_alignment": "left", + "rows": [ + [ + "deathlink" + ] + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/layouts/tracker.json b/layouts/tracker.json index 07c1a14..b480bb9 100644 --- a/layouts/tracker.json +++ b/layouts/tracker.json @@ -34,6 +34,18 @@ "key": "achievements_layout" } }, + { + "type": "group", + "header": "Deathlink", + "dock": "left", + "margin": "0,0,3,0", + "content": { + "type": "layout", + "h_alignment": "center", + "v_alignment": "center", + "key": "deathlink_layout" + } + }, { "type": "group", "header": "Progression Items", diff --git a/scripts/autotracking/archipelago.lua b/scripts/autotracking/archipelago.lua index 06d6277..7ef376c 100644 --- a/scripts/autotracking/archipelago.lua +++ b/scripts/autotracking/archipelago.lua @@ -46,6 +46,14 @@ function onClear(slotData) end -- Reset Settings + Tracker:FindObjectForCode("goal_mechanical_bosses").Active = false + Tracker:FindObjectForCode("goal_plantera").Active = false + Tracker:FindObjectForCode("goal_golem").Active = false + Tracker:FindObjectForCode("goal_empress_of_light").Active = false + Tracker:FindObjectForCode("goal_lunatic_cultist").Active = false + Tracker:FindObjectForCode("goal_moon_lord").Active = false + Tracker:FindObjectForCode("goal_zenith").Active = false + if slotData['goal'] then local goalValue = slotData['goal'][1] local goalTrackerKey = nil @@ -64,22 +72,44 @@ function onClear(slotData) goalTrackerKey = "goal_moon_lord" elseif goalValue == "Zenith" then goalTrackerKey = "goal_zenith" - else - return end - local goalTrackerObject = Tracker:FindObjectForCode(goalTrackerKey) + if goalTrackerKey then + local goalTrackerObject = Tracker:FindObjectForCode(goalTrackerKey) + goalTrackerObject.Active = true + end + end + + Tracker:FindObjectForCode("achievements_none").Active = false + Tracker:FindObjectForCode("achievements_exclude_fishing").Active = false + Tracker:FindObjectForCode("achievements_exclude_grindy").Active = false + Tracker:FindObjectForCode("achievements_all").Active = false + + if slotData['achievements'] then + local achievementValue = slotData['achievements'] + local achievementTrackerKey = nil + + if achievementValue == 0 then + achievementTrackerKey = "achievements_none" + elseif achievementValue == 1 then + achievementTrackerKey = "achievements_exclude_grindy" + elseif achievementValue == 2 then + achievementTrackerKey = "achievements_exclude_fishing" + elseif achievementValue == 3 then + achievementTrackerKey = "achievements_all" + end - goalTrackerObject.Active = true + if achievementTrackerKey then + local achievementTrackerObject = Tracker:FindObjectForCode(achievementTrackerKey) + achievementTrackerObject.Active = true + end end - -- if slotData['achievements'] then - -- Wait until this is stored in slot data to know how to handle it - -- For now, force all achievements on and let the user switch the setting manually if needed - local achievementTrackerObject = Tracker:FindObjectForCode("achievements_all") + Tracker:FindObjectForCode("deathlink").Active = false - achievementTrackerObject.Active = true - -- end + if slotData['deathlink'] == true then + Tracker:FindObjectForCode("deathlink").Active = true + end end diff --git a/scripts/init.lua b/scripts/init.lua index 8ecf5b4..7a0fe46 100644 --- a/scripts/init.lua +++ b/scripts/init.lua @@ -11,6 +11,7 @@ Tracker:AddLocations("locations/locations.json") Tracker:AddLayouts("layouts/tabs.json") Tracker:AddLayouts("layouts/goals.json") Tracker:AddLayouts("layouts/achievements.json") +Tracker:AddLayouts("layouts/deathlink.json") Tracker:AddLayouts("layouts/items.json") Tracker:AddLayouts("layouts/tracker.json")