Skip to content

Commit

Permalink
Add & fix Item Spawning Statues set.
Browse files Browse the repository at this point in the history
Sort sets alphabetically.
Fix find buttons not working with sets.
Sync selected set & blocks list.
  • Loading branch information
jasoncoon committed Mar 29, 2024
1 parent ff7de4a commit 00e1263
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 84 deletions.
36 changes: 36 additions & 0 deletions resources/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,42 @@ function addSetListItems() {
function highlightSet(setIndex) {
var set = sets[setIndex];

var selectedValues = [];

// clear and set selectedInfos
for(j = 0; j < blockSelector.options.length; j++) {
option = blockSelector.options[j];

var tileInfo = getTileInfoFromOption(option);

if (
tileInfo &&
set.Entries.some(
(entry) =>
((entry.Id && entry.Id === tileInfo.Id) ||
(entry.parent &&
tileInfo.parent &&
entry.parent.Id === tileInfo.parent.Id)) &&
(!entry.U || entry.U === tileInfo.U) &&
(!entry.V || entry.V === tileInfo.V)
)
) {
// if (option.prop) option.prop("selected", true);
option.selected = true;
selectedValues.push(tileInfo.Id);
// console.log({ tileInfo, option, set });
} else {
if (option.prop) option.prop("selected", false);
option.selected = false;
}
}

// console.log({blockSelector});

console.log({set});

// blockSelector.val(selectedValues);

highlightInfos(set.Entries);
}

Expand Down
174 changes: 90 additions & 84 deletions resources/js/sets.js
Original file line number Diff line number Diff line change
@@ -1,104 +1,135 @@
var sets = [
{
"Name": "Crimson Blocks",
"Name": "Chests",
"Entries": [
{
"Id": "199",
"Name": "Flesh Grass",
"Id": "21",
"Name": "Chest",
"isTile": true
}
]
},
{
"Name": "Corruption Blocks",
"Entries": [
{
"Id": "23",
"Name": "Corrupted Grass",
"isTile": true
},
{
"Id": "200",
"Name": "Red Ice",
"Id": "24",
"Name": "Corrupted Weeds",
"isTile": true
},
{
"Id": "201",
"Name": "Flesh Weeds",
"Id": "25",
"Name": "Ebonstone",
"isTile": true
},
{
"Id": "203",
"Name": " Block",
"Id": "32",
"Name": "Corruption Thorns",
"isTile": true
},
{
"Id": "205",
"Name": "Crimstone Vines",
"Id": "112",
"Name": "Ebonsand",
"isTile": true
},
{
"Id": "234",
"Name": "Crimsand",
"Id": "163",
"Name": "Purple Ice",
"isTile": true
},
{
"Id": "352",
"Name": "Crimtane Thorns",
"Id": "398",
"Name": "Corrupt Hardened Sand",
"isTile": true
},
{
"Id": "399",
"Name": "Crimson Hardened Sand",
"Id": "400",
"Name": "Corrupt Sandstone",
"isTile": true
},
{
"Id": "401",
"Name": "Crimson Sandstone",
"Id": "636",
"Name": "Corrupt Vines",
"isTile": true
}
]
},
{
"Name": "Corruption Blocks",
"Name": "Crimson Blocks",
"Entries": [
{
"Id": "23",
"Name": "Corrupted Grass",
"Id": "199",
"Name": "Flesh Grass",
"isTile": true
},
{
"Id": "24",
"Name": "Corrupted Weeds",
"Id": "200",
"Name": "Red Ice",
"isTile": true
},
{
"Id": "25",
"Name": "Ebonstone",
"Id": "201",
"Name": "Flesh Weeds",
"isTile": true
},
{
"Id": "32",
"Name": "Corruption Thorns",
"Id": "203",
"Name": " Block",
"isTile": true
},
{
"Id": "112",
"Name": "Ebonsand",
"Id": "205",
"Name": "Crimstone Vines",
"isTile": true
},
{
"Id": "163",
"Name": "Purple Ice",
"Id": "234",
"Name": "Crimsand",
"isTile": true
},
{
"Id": "398",
"Name": "Corrupt Hardened Sand",
"Id": "352",
"Name": "Crimtane Thorns",
"isTile": true
},
{
"Id": "400",
"Name": "Corrupt Sandstone",
"Id": "399",
"Name": "Crimson Hardened Sand",
"isTile": true
},
{
"Id": "636",
"Name": "Corrupt Vines",
"Id": "401",
"Name": "Crimson Sandstone",
"isTile": true
}
]
},
{
"Name": "Enchanted Items",
"Entries": [
{
"Id": "55",
"Name": "Enchanted Boomerang",
"isItem": true
},
{
"Id": "187",
"Name": "3x2 Decos - Enchanted Sword",
"U": 918, "V": 0,
"isTile": true
},
{
"Id": "989",
"Name": "Enchanted Sword",
"isItem": true
}
]
},
{
"Name": "Hallow Blocks",
"Entries": [
Expand Down Expand Up @@ -145,12 +176,28 @@ var sets = [
]
},
{
"Name": "Chests",
"Name": "Item Spawning Statues",
"Entries": [
{
"Id": "21",
"Name": "Chest",
"isTile": true
"Id": "105",
"Name": "Bomb Statue",
"isItem": true,
"U": 612,
"V": 0
},
{
"Id": "105",
"Name": "Heart Statue",
"isItem": true,
"U": 1332,
"V": 0
},
{
"Id": "105",
"Name": "Star Statue",
"isTile": true,
"U": 72,
"V": 0
}
]
},
Expand All @@ -174,46 +221,5 @@ var sets = [
"isItem": true
}
]
},
{
"Name": "Enchanted Items",
"Entries": [
{
"Id": "55",
"Name": "Enchanted Boomerang",
"isItem": true
},
{
"Id": "187",
"Name": "3x2 Decos - Enchanted Sword",
"U": 918, "V": 0,
"isTile": true
},
{
"Id": "989",
"Name": "Enchanted Sword",
"isItem": true
}
]
},
{
"Name": "Item-summoning statues",
"Entries": [
{
"Id": "473",
"Name": "Heart Statue",
"isItem": true
},
{
"Id": "438",
"Name": "Star Statue",
"isTile": true
},
{
"Id": "453",
"Name": "Bomb Statue",
"isItem": true
},
]
}
}
]

0 comments on commit 00e1263

Please sign in to comment.