Skip to content

Commit

Permalink
split cardkey load grid
Browse files Browse the repository at this point in the history
  • Loading branch information
coveleski committed May 17, 2024
1 parent b6b9961 commit baee73e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 13 deletions.
26 changes: 26 additions & 0 deletions items/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,32 @@
}
]
},
{
"name": "Card Key Option",
"type": "progressive",
"loop": true,
"allow_disabled": false,
"stages": [
{
"name": "Card Key - Vanilla",
"img_mods": "@disabled",
"img": "images/items/cardkey.png",
"codes": "opt_cardkey,opt_cardkey_off"
},
{
"name": "Card Key - Progressive",
"img_mods": "@disabled",
"img": "images/items/cardkey.png",
"codes": "opt_cardkey,opt_cardkey_prog"
},
{
"name": "Cardkey - Split",
"img": "images/items/cardkey.png",
"codes": "opt_cardkey,opt_cardkey_split",
"inherit_codes": false
}
]
},
{
"name": "Second Fossil Check Requirement",
"type": "consumable",
Expand Down
3 changes: 2 additions & 1 deletion layouts/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"opt_trn",
"opt_dexsanity",
"opt_stonesanity",
"opt_keyonly"
"opt_keyonly",
"opt_cardkey"
]
]
},
Expand Down
10 changes: 10 additions & 0 deletions layouts/split_cardkey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cardkey": {
"type": "itemgrid",
"background": "#212121",
"rows": [
["cardkey2f", "cardkey3f", "cardkey4f", "cardkey5f", "cardkey6f"],
["cardkey7f", "cardkey8f", "cardkey9f", "cardkey10f", "cardkey11f"]
]
}
}
6 changes: 5 additions & 1 deletion layouts/tracker.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"tracker_default": {
"type": "container",
"background": "#212121",
Expand All @@ -21,6 +21,10 @@
"key": "shared_item_grid"
}
},
{
"type": "layout",
"key": "cardkey",
},
{
"type": "group",
"header": "Settings",
Expand Down
18 changes: 9 additions & 9 deletions locations/locations.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
"name": "1F Receptionist",
"item_count": 1,
"access_rules": ["silphco"],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "2F Woman",
Expand Down Expand Up @@ -848,7 +848,7 @@
"name": "4F Hostage",
"item_count": 1,
"access_rules": ["$cardkey(4)"],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "5F Southwest Item",
Expand Down Expand Up @@ -902,7 +902,7 @@
"name": "5F Hostage",
"item_count": 1,
"access_rules": ["$cardkey(5)"],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
}
],
"map_locations": [{ "map": "map", "x": 368, "y": 144 }]
Expand Down Expand Up @@ -945,7 +945,7 @@
"name": "6F Hostage",
"item_count": 1,
"access_rules": [],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "7F West Item",
Expand Down Expand Up @@ -987,7 +987,7 @@
"name": "7F Hostage",
"item_count": 1,
"access_rules": [],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "8F Rocket 1",
Expand All @@ -1011,7 +1011,7 @@
"name": "8F Hostage",
"item_count": 1,
"access_rules": [],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "9F Rocket 1",
Expand Down Expand Up @@ -1041,7 +1041,7 @@
"name": "9F Nurse",
"item_count": 1,
"access_rules": ["$cardkey(9)"],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "10F Left Item",
Expand Down Expand Up @@ -1077,7 +1077,7 @@
"name": "10F Hostage",
"item_count": 1,
"access_rules": ["$cardkey(10)"],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
},
{
"name": "11F Rocket 1",
Expand Down Expand Up @@ -1106,7 +1106,7 @@
"name": "11F Secretary",
"item_count": 1,
"access_rules": ["silphco"],
"visibility_rules": ["op_cardkey_prog", "op_cardkey_split"]
"visibility_rules": ["opt_cardkey_prog", "opt_cardkey_split"]
}
],
"map_locations": [{ "map": "map", "x": 340, "y": 144 }]
Expand Down
4 changes: 2 additions & 2 deletions scripts/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local variant = Tracker.ActiveVariantUID
IS_ITEMS_ONLY = variant:find("itemsonly")

function split_key()
obj = Tracker:FindObjectForCode('op_cardkey_split')
obj = Tracker:FindObjectForCode('opt_cardkey_split')
if obj.CurrentStage == 2 then
Tracker:AddLayouts("layouts/split_cardkey.json")
end
Expand Down Expand Up @@ -49,5 +49,5 @@ if PopVersion and PopVersion >= "0.18.0" then
end
-- Add a watch to dynamically load layout if progressive card keys enabled
if PopVersion and PopVersion >= "0.1.0" then
ScriptHost:AddWatchForCode("loadCardKey", "op_cardkey_split", split_key)
ScriptHost:AddWatchForCode("loadCardKey", "opt_cardkey_split", split_key)
end

0 comments on commit baee73e

Please sign in to comment.