Skip to content

Commit a29b9ba

Browse files
authored
Merge pull request Cyb3RGER#4 from palex00/master
Adds autotracking to settings
2 parents 5b3651b + c4db4ee commit a29b9ba

File tree

5 files changed

+118
-36
lines changed

5 files changed

+118
-36
lines changed

CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
0.2.1:
2+
* Added Autotracking for Settings
3+
* removed Pinned Locations menu as it's not a thing
4+
15
0.2.0:
26
* Added missing features (1.18 and 1.19 advancements, lead item, missing books)
37
* Logic tweaks (Mostly can_adventure and Post Game Advancements)

layouts/tracker.json

-18
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,6 @@
1515
"type": "layout",
1616
"dock": "left",
1717
"key": "shared_item_grid"
18-
},
19-
{
20-
"type": "dock",
21-
"dock": "bottom",
22-
"content": [
23-
{
24-
"type": "group",
25-
"header": "Pinned Locations",
26-
"content": {
27-
"type": "recentpins",
28-
"style": "wrap",
29-
"h_alignment": "stretch",
30-
"v_alignment": "stretch",
31-
"orientation": "vertical",
32-
"compact": true
33-
}
34-
}
35-
]
3618
}
3719
]
3820
},

manifest.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"name": "Minecraft Randomizer",
3-
"game_name": "Minecraft",
4-
"platform": "PC",
5-
"package_version": "0.2.0",
6-
"package_uid": "minecraft_randomizer_emotracker-neomatamune",
7-
"author": "Neomatamune, Cyb3R, AkumaGath17#0725",
8-
"variants": {
9-
"tracker": {
10-
"display_name": "Advancement Tracker",
11-
"flags": [
12-
"ap"
13-
]
14-
}
15-
}
2+
"name": "Minecraft Randomizer",
3+
"game_name": "Minecraft",
4+
"platform": "PC",
5+
"package_version": "0.2.1",
6+
"package_uid": "minecraft_randomizer_emotracker-neomatamune",
7+
"author": "Neomatamune, Cyb3R, AkumaGath17#0725",
8+
"variants": {
9+
"tracker": {
10+
"display_name": "Advancement Tracker",
11+
"flags": [
12+
"ap"
13+
]
14+
}
15+
}
1616
}

scripts/autotracking.lua

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- Configuration --------------------------------------
2-
AUTOTRACKER_ENABLE_DEBUG_LOGGING = true or ENABLE_DEBUG_LOG
2+
AUTOTRACKER_ENABLE_DEBUG_LOGGING = false
33
AUTOTRACKER_ENABLE_ITEM_TRACKING = true
44
AUTOTRACKER_ENABLE_LOCATION_TRACKING = true and not IS_ITEMS_ONLY
55
-------------------------------------------------------
@@ -15,15 +15,20 @@ end
1515
print("---------------------------------------------------------------------")
1616
print("")
1717

18-
CUR_INDEX = -1
19-
2018
ScriptHost:LoadScript("scripts/autotracking/item_mapping.lua")
2119
ScriptHost:LoadScript("scripts/autotracking/location_mapping.lua")
20+
ScriptHost:LoadScript("scripts/autotracking/slot_data.lua")
21+
22+
CUR_INDEX = -1
23+
SLOT_DATA = {}
24+
LOCAL_ITEMS = {}
25+
GLOBAL_ITEMS = {}
2226

23-
function onClear()
27+
function onClear(slot_data)
2428
if AUTOTRACKER_ENABLE_DEBUG_LOGGING then
2529
print(string.format("called onClear"))
2630
end
31+
SLOT_DATA = slot_data
2732
CUR_INDEX = -1
2833
for _, v in pairs(LOCATION_MAPPING) do
2934
if v[1] then
@@ -64,6 +69,9 @@ function onClear()
6469
end
6570
end
6671
end
72+
LOCAL_ITEMS = {}
73+
GLOBAL_ITEMS = {}
74+
get_slot_options(slot_data)
6775
end
6876

6977
function onItem(index, item_id, item_name)

scripts/autotracking/slot_data.lua

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
function get_slot_options(slot_data)
2+
3+
-- if slot_data["egg_shards_required"] ~= nil then
4+
-- Tracker:FindObjectForCode('egg_shards_required').AcquiredCount = slot_data["egg_shards_required"]
5+
-- end
6+
--
7+
-- if slot_data["egg_shards_available"] ~= nil then
8+
-- Tracker:FindObjectForCode('egg_shards_available').AcquiredCount = slot_data["egg_shards_available"]
9+
-- end
10+
11+
if slot_data["shuffle_structures"] ~= nil then
12+
print("Structure Shuffle")
13+
local obj = Tracker:FindObjectForCode("struct_shuffle")
14+
local stage = slot_data["shuffle_structures"]
15+
if stage == 1 then
16+
obj.CurrentStage = 0
17+
elseif stage == 0 then
18+
obj.CurrentStage = 1
19+
end
20+
end
21+
22+
if slot_data["include_unreasonable_advancements"] ~= nil then
23+
local obj = Tracker:FindObjectForCode("unreasonable")
24+
local stage = slot_data["include_unreasonable_advancements"]
25+
if stage == 1 then
26+
obj.CurrentStage = 0
27+
elseif stage == 0 then
28+
obj.CurrentStage = 1
29+
end
30+
end
31+
32+
if slot_data["required_bosses"] ~= nil then
33+
local obj = Tracker:FindObjectForCode("goal")
34+
local required_bosses = slot_data["required_bosses"]
35+
if required_bosses == "None" then
36+
obj.CurrentStage = 0
37+
elseif required_bosses == "Ender Dragon" then
38+
obj.CurrentStage = 1
39+
elseif required_bosses == "Wither" then
40+
obj.CurrentStage = 2
41+
elseif required_bosses == "Both" then
42+
obj.CurrentStage = 3
43+
end
44+
end
45+
46+
if slot_data["combat_difficulty"] ~= nil then
47+
local obj = Tracker:FindObjectForCode("difficulty")
48+
local stage = slot_data["combat_difficulty"]
49+
if stage == 0 then
50+
obj.CurrentStage = 0
51+
elseif stage == 1 then
52+
obj.CurrentStage = 1
53+
elseif stage == 2 then
54+
obj.CurrentStage = 2
55+
end
56+
end
57+
58+
if slot_data["include_postgame_advancements"] ~= nil then
59+
local obj = Tracker:FindObjectForCode("postgame")
60+
local stage = slot_data["include_postgame_advancements"]
61+
if stage == 1 then
62+
obj.CurrentStage = 0
63+
elseif stage == 0 then
64+
obj.CurrentStage = 1
65+
end
66+
end
67+
68+
if slot_data["include_hard_advancements"] ~= nil then
69+
local obj = Tracker:FindObjectForCode("hard")
70+
local stage = slot_data["include_hard_advancements"]
71+
if stage == 1 then
72+
obj.CurrentStage = 0
73+
elseif stage == 0 then
74+
obj.CurrentStage = 1
75+
end
76+
end
77+
78+
if slot_data["death_link"] ~= nil then
79+
local obj = Tracker:FindObjectForCode('deathlink')
80+
local setting = slot_data["death_link"]
81+
if setting == true then
82+
obj.CurrentStage = 0
83+
else
84+
obj.CurrentStage = 1
85+
end
86+
end
87+
88+
end

0 commit comments

Comments
 (0)