This commit is contained in:
ferricles 2021-01-09 19:49:34 -08:00
commit 6e00312e08
6 changed files with 217 additions and 176 deletions

View file

@ -44895,7 +44895,7 @@
"name": "Corrupted Nii Mukluk",
"tier": "Set",
"type": "boots",
"set": "Corrupted+Nii",
"set": "Corrupted Nii",
"quest": null,
"poison": 0,
"thorns": 0,
@ -45649,7 +45649,7 @@
"name": "Corrupted Uth Belt",
"tier": "Set",
"type": "leggings",
"set": "Corrupted+Uth",
"set": "Corrupted Uth",
"quest": null,
"poison": 0,
"thorns": 0,
@ -45800,7 +45800,7 @@
"name": "Corrupted Nii Plate",
"tier": "Set",
"type": "chestplate",
"set": "Corrupted+Nii",
"set": "Corrupted Nii",
"quest": null,
"poison": 0,
"thorns": 0,
@ -45951,7 +45951,7 @@
"name": "Corrupted Nii Shako",
"tier": "Set",
"type": "helmet",
"set": "Corrupted+Nii",
"set": "Corrupted Nii",
"quest": null,
"poison": 0,
"thorns": 0,
@ -46251,7 +46251,7 @@
{
"name": "Black Catalyst",
"tier": "Set",
"set": "Black+Catalyst",
"set": "Black Catalyst",
"quest": null,
"poison": 0,
"thorns": 0,
@ -46552,7 +46552,7 @@
"name": "Corrupted Uth Plume",
"tier": "Set",
"type": "helmet",
"set": "Corrupted+Uth",
"set": "Corrupted Uth",
"quest": null,
"poison": 0,
"thorns": 0,
@ -47603,7 +47603,7 @@
"name": "Corrupted Uth Sandals",
"tier": "Set",
"type": "boots",
"set": "Corrupted+Uth",
"set": "Corrupted Uth",
"quest": null,
"poison": 0,
"thorns": 20,
@ -143462,7 +143462,7 @@
{
"name": "Bandit's Knuckle",
"tier": "Set",
"set": "Bandit%27s",
"set": "Bandit's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -143609,7 +143609,7 @@
{
"name": "Bandit's Bangle",
"tier": "Set",
"set": "Bandit%27s",
"set": "Bandit's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -143757,7 +143757,7 @@
"name": "Builder's Breastplate",
"tier": "Set",
"type": "helmet",
"set": "Builder%27s",
"set": "Builder's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -143830,7 +143830,7 @@
{
"name": "Bandit's Locket",
"tier": "Set",
"set": "Bandit%27s",
"set": "Bandit's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -143903,7 +143903,7 @@
{
"name": "Bandit's Ring",
"tier": "Set",
"set": "Bandit%27s",
"set": "Bandit's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -143977,7 +143977,7 @@
"name": "Builder's Boots",
"tier": "Set",
"type": "helmet",
"set": "Builder%27s",
"set": "Builder's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -144051,7 +144051,7 @@
"name": "GM's Helmet",
"tier": "Set",
"type": "helmet",
"set": "GM%27s",
"set": "GM's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -144125,7 +144125,7 @@
"name": "GM's Boots",
"tier": "Set",
"type": "helmet",
"set": "GM%27s",
"set": "GM's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -144199,7 +144199,7 @@
"name": "Builder's Trousers",
"tier": "Set",
"type": "helmet",
"set": "Builder%27s",
"set": "Builder's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -144273,7 +144273,7 @@
"name": "Builder's Helmet",
"tier": "Set",
"type": "helmet",
"set": "Builder%27s",
"set": "Builder's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -144421,7 +144421,7 @@
"name": "GM's Breastplate",
"tier": "Set",
"type": "helmet",
"set": "GM%27s",
"set": "GM's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -144495,7 +144495,7 @@
"name": "GM's Trousers",
"tier": "Set",
"type": "helmet",
"set": "GM%27s",
"set": "GM's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -145668,7 +145668,7 @@
{
"name": "Treat",
"tier": "Set",
"set": "Hallowynn+2016",
"set": "Hallowynn 2016",
"quest": "A Grave Mistake",
"poison": 0,
"thorns": 0,
@ -146040,7 +146040,7 @@
{
"name": "Trick",
"tier": "Set",
"set": "Hallowynn+2016",
"set": "Hallowynn 2016",
"quest": "A Grave Mistake",
"poison": 0,
"thorns": 0,
@ -176120,7 +176120,7 @@
"name": "Adventurer's Cap",
"tier": "Set",
"type": "helmet",
"set": "Adventurer%27s",
"set": "Adventurer's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176193,7 +176193,7 @@
"name": "Adventurer's Tunic",
"tier": "Set",
"type": "chestplate",
"set": "Adventurer%27s",
"set": "Adventurer's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176266,7 +176266,7 @@
"name": "Adventurer's Boots",
"tier": "Set",
"type": "boots",
"set": "Adventurer%27s",
"set": "Adventurer's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176339,7 +176339,7 @@
"name": "Adventurer's Pants",
"tier": "Set",
"type": "leggings",
"set": "Adventurer%27s",
"set": "Adventurer's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176485,7 +176485,7 @@
"name": "Air Relic Leggings",
"tier": "Set",
"type": "leggings",
"set": "Air+Relic",
"set": "Air Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176559,7 +176559,7 @@
"name": "Air Relic Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Air+Relic",
"set": "Air Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176633,7 +176633,7 @@
"name": "Air Relic Boots",
"tier": "Set",
"type": "boots",
"set": "Air+Relic",
"set": "Air Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -176707,7 +176707,7 @@
"name": "Air Relic Helmet",
"tier": "Set",
"type": "helmet",
"set": "Air+Relic",
"set": "Air Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178477,7 +178477,7 @@
"name": "Earth Relic Helmet",
"tier": "Set",
"type": "helmet",
"set": "Earth+Relic",
"set": "Earth Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178625,7 +178625,7 @@
"name": "Fire Relic Boots",
"tier": "Set",
"type": "boots",
"set": "Fire+Relic",
"set": "Fire Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178699,7 +178699,7 @@
"name": "Earth Relic Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Earth+Relic",
"set": "Earth Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178773,7 +178773,7 @@
"name": "Fire Relic Helmet",
"tier": "Set",
"type": "helmet",
"set": "Fire+Relic",
"set": "Fire Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178847,7 +178847,7 @@
"name": "Earth Relic Leggings",
"tier": "Set",
"type": "leggings",
"set": "Earth+Relic",
"set": "Earth Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178921,7 +178921,7 @@
"name": "Fire Relic Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Fire+Relic",
"set": "Fire Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -178995,7 +178995,7 @@
"name": "Fire Relic Leggings",
"tier": "Set",
"type": "leggings",
"set": "Fire+Relic",
"set": "Fire Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -179434,7 +179434,7 @@
"name": "Earth Relic Boots",
"tier": "Set",
"type": "boots",
"set": "Earth+Relic",
"set": "Earth Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -179727,7 +179727,7 @@
"name": "Kaerynn's Body",
"tier": "Set",
"type": "chestplate",
"set": "Kaerynn%27s",
"set": "Kaerynn's",
"quest": "Aldorei's Secret Part II",
"poison": 0,
"thorns": 0,
@ -179801,7 +179801,7 @@
"name": "Kaerynn's Mind",
"tier": "Set",
"type": "helmet",
"set": "Kaerynn%27s",
"set": "Kaerynn's",
"quest": "Aldorei's Secret Part II",
"poison": 0,
"thorns": 0,
@ -182071,7 +182071,7 @@
"name": "Skien Boots",
"tier": "Set",
"type": "boots",
"set": "Skien%27s",
"set": "Skien's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -182144,7 +182144,7 @@
"name": "Skien Leggings",
"tier": "Set",
"type": "leggings",
"set": "Skien%27s",
"set": "Skien's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -182217,7 +182217,7 @@
"name": "Skien's Fatigues",
"tier": "Set",
"type": "chestplate",
"set": "Skien%27s",
"set": "Skien's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -183316,7 +183316,7 @@
"name": "Thunder Relic Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Thunder+Relic",
"set": "Thunder Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -183390,7 +183390,7 @@
"name": "Thunder Relic Boots",
"tier": "Set",
"type": "boots",
"set": "Thunder+Relic",
"set": "Thunder Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -183464,7 +183464,7 @@
"name": "Thunder Relic Helmet",
"tier": "Set",
"type": "helmet",
"set": "Thunder+Relic",
"set": "Thunder Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -183612,7 +183612,7 @@
"name": "Thunder Relic Leggings",
"tier": "Set",
"type": "leggings",
"set": "Thunder+Relic",
"set": "Thunder Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -184129,7 +184129,7 @@
"name": "Veekhat's Horns",
"tier": "Set",
"type": "helmet",
"set": "Veekhat%27s",
"set": "Veekhat's",
"quest": "Cowfusion",
"poison": 0,
"thorns": 0,
@ -184276,7 +184276,7 @@
"name": "Veekhat's Udders",
"tier": "Set",
"type": "chestplate",
"set": "Veekhat%27s",
"set": "Veekhat's",
"quest": "Cowfusion",
"poison": 0,
"thorns": 0,
@ -184788,7 +184788,7 @@
"name": "Water Relic Boots",
"tier": "Set",
"type": "boots",
"set": "Water+Relic",
"set": "Water Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -185010,7 +185010,7 @@
"name": "Water Relic Helmet",
"tier": "Set",
"type": "helmet",
"set": "Water+Relic",
"set": "Water Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -185084,7 +185084,7 @@
"name": "Water Relic Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Water+Relic",
"set": "Water Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -185158,7 +185158,7 @@
"name": "Water Relic Leggings",
"tier": "Set",
"type": "leggings",
"set": "Water+Relic",
"set": "Water Relic",
"quest": null,
"poison": 0,
"thorns": 0,
@ -193518,7 +193518,7 @@
"name": "Saint's Sandals",
"tier": "Set",
"type": "boots",
"set": "Saint%27s",
"set": "Saint's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -193592,7 +193592,7 @@
"name": "Saint's Shawl",
"tier": "Set",
"type": "helmet",
"set": "Saint%27s",
"set": "Saint's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -193666,7 +193666,7 @@
"name": "Saint's Leggings",
"tier": "Set",
"type": "leggings",
"set": "Saint%27s",
"set": "Saint's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -193814,7 +193814,7 @@
"name": "Saint's Tunic",
"tier": "Set",
"type": "chestplate",
"set": "Saint%27s",
"set": "Saint's",
"quest": null,
"poison": 0,
"thorns": 0,
@ -212511,7 +212511,7 @@
"name": "Thanos Legionnaire Plate",
"tier": "Set",
"type": "chestplate",
"set": "Thanos+Legionnaire",
"set": "Thanos Legionnaire",
"quest": "The Belly of the Beast",
"poison": 0,
"thorns": 0,
@ -212585,7 +212585,7 @@
"name": "Thanos Legionnaire Helm",
"tier": "Set",
"type": "helmet",
"set": "Thanos+Legionnaire",
"set": "Thanos Legionnaire",
"quest": "The Belly of the Beast",
"poison": 0,
"thorns": 0,
@ -212659,7 +212659,7 @@
"name": "Thanos Legionnaire Leggings",
"tier": "Set",
"type": "leggings",
"set": "Thanos+Legionnaire",
"set": "Thanos Legionnaire",
"quest": "The Belly of the Beast",
"poison": 0,
"thorns": 0,
@ -214897,7 +214897,7 @@
"name": "Thanos Legionnaire Greaves",
"tier": "Set",
"type": "boots",
"set": "Thanos+Legionnaire",
"set": "Thanos Legionnaire",
"quest": "The Belly of the Beast",
"poison": 0,
"thorns": 0,
@ -253526,7 +253526,7 @@
"name": "Blue Team Boots",
"tier": "Set",
"type": "boots",
"set": "Blue+Team",
"set": "Blue Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -253674,7 +253674,7 @@
"name": "Blue Team Leggings",
"tier": "Set",
"type": "leggings",
"set": "Blue+Team",
"set": "Blue Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -253821,7 +253821,7 @@
"name": "Blue Team Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Blue+Team",
"set": "Blue Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -253895,7 +253895,7 @@
"name": "Red Team Boots",
"tier": "Set",
"type": "boots",
"set": "Red+Team",
"set": "Red Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -253969,7 +253969,7 @@
"name": "Blue Team Helmet",
"tier": "Set",
"type": "helmet",
"set": "Blue+Team",
"set": "Blue Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -254117,7 +254117,7 @@
"name": "Red Team Leggings",
"tier": "Set",
"type": "leggings",
"set": "Red+Team",
"set": "Red Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -254562,7 +254562,7 @@
"name": "Red Team Chestplate",
"tier": "Set",
"type": "chestplate",
"set": "Red+Team",
"set": "Red Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -256274,7 +256274,7 @@
"name": "Red Team Helmet",
"tier": "Set",
"type": "helmet",
"set": "Red+Team",
"set": "Red Team",
"quest": null,
"poison": 0,
"thorns": 0,
@ -262128,7 +262128,7 @@
}
]
},
"Red+Team": {
"Red Team": {
"items": [
"Red Team Boots",
"Red Team Leggings",
@ -262257,7 +262257,7 @@
}
]
},
"Thanos+Legionnaire": {
"Thanos Legionnaire": {
"items": [
"Thanos Legionnaire Helm",
"Thanos Legionnaire Greaves",
@ -262334,7 +262334,7 @@
}
]
},
"Adventurer%27s": {
"Adventurer's": {
"items": [
"Adventurer's Cap",
"Adventurer's Boots",
@ -262373,7 +262373,7 @@
}
]
},
"Air+Relic": {
"Air Relic": {
"items": [
"Air Relic Helmet",
"Air Relic Boots",
@ -262440,7 +262440,7 @@
}
]
},
"Kaerynn%27s": {
"Kaerynn's": {
"items": [
"Kaerynn's Mind",
"Kaerynn's Body"
@ -262457,7 +262457,7 @@
}
]
},
"Bandit%27s": {
"Bandit's": {
"items": [
"Bandit's Locket",
"Bandit's Bangle",
@ -262520,7 +262520,7 @@
}
]
},
"Builder%27s": {
"Builder's": {
"items": [
"Builder's Helmet",
"Builder's Boots",
@ -262557,7 +262557,7 @@
}
]
},
"Skien%27s": {
"Skien's": {
"items": [
"Skien Boots",
"Skien Leggings",
@ -262613,7 +262613,7 @@
}
]
},
"Veekhat%27s": {
"Veekhat's": {
"items": [
"Veekhat's Horns",
"Veekhat's Udders"
@ -262701,7 +262701,7 @@
}
]
},
"Black+Catalyst": {
"Black Catalyst": {
"items": [
"Black Catalyst"
],
@ -262765,7 +262765,7 @@
}
]
},
"Hallowynn+2016": {
"Hallowynn 2016": {
"items": [
"Treat",
"Trick"
@ -262809,7 +262809,7 @@
}
]
},
"GM%27s": {
"GM's": {
"items": [
"GM's Helmet",
"GM's Boots",
@ -262862,7 +262862,7 @@
}
]
},
"Thunder+Relic": {
"Thunder Relic": {
"items": [
"Thunder Relic Helmet",
"Thunder Relic Boots",
@ -262941,7 +262941,7 @@
}
]
},
"Blue+Team": {
"Blue Team": {
"items": [
"Blue Team Boots",
"Blue Team Leggings",
@ -263092,7 +263092,7 @@
}
]
},
"Saint%27s": {
"Saint's": {
"items": [
"Saint's Shawl",
"Saint's Sandals",
@ -263188,7 +263188,7 @@
}
]
},
"Corrupted+Nii": {
"Corrupted Nii": {
"items": [
"Corrupted Nii Mukluk",
"Corrupted Nii Plate",
@ -263212,7 +263212,7 @@
}
]
},
"Water+Relic": {
"Water Relic": {
"items": [
"Water Relic Helmet",
"Water Relic Boots",
@ -263321,7 +263321,7 @@
}
]
},
"Corrupted+Uth": {
"Corrupted Uth": {
"items": [
"Corrupted Uth Sandals",
"Corrupted Uth Belt",
@ -263345,7 +263345,7 @@
}
]
},
"Fire+Relic": {
"Fire Relic": {
"items": [
"Fire Relic Helmet",
"Fire Relic Boots",
@ -263397,7 +263397,7 @@
}
]
},
"Earth+Relic": {
"Earth Relic": {
"items": [
"Earth Relic Helmet",
"Earth Relic Boots",

File diff suppressed because one or more lines are too long

View file

@ -12,7 +12,7 @@ item_set_map = dict()
for filename in os.listdir('sets'):
if "json" not in filename:
continue
set_name = filename[1:].split(".")[0]
set_name = filename[1:].split(".")[0].replace("+", " ").replace("%27", "'")
with open("sets/"+filename) as set_info:
set_obj = json.load(set_info)
for item in set_obj["items"]:

View file

@ -22,114 +22,124 @@
<a href="credits.txt" class="link">Additional credits</a>
</div>
<div class="equipment">
<div class="center" style="grid-column:1;grid-row:1">
<div class="right" style="grid-column:1;grid-row:1">
<label>Equipments</label>
<br>
<br>
<div>
<label for="helmet-choice">Helmet:</label>
<input list="helmet-items" id="helmet-choice" name="helmet-choice" placeholder="No Helmet"/>
<datalist id="helmet-items">
</datalist>
</div>
<div id="helmet-slots">
X slots
</div>
<div>
<label for="helmet-powder">Powdering:</label>
<input type="text" id="helmet-powder" name="helmet-powder"/>
</div>
</div>
<div class="center" style="grid-column:2;grid-row:1">
<br>
<div>
<label for="chestplate-choice">Chestplate:</label>
<input list="chestplate-items" id="chestplate-choice" name="chestplate-choice" placeholder="No Chestplate"/>
<datalist id="chestplate-items">
</datalist>
</div>
<div id="chestplate-slots">
X slots
</div>
<div>
<label for="chestplate-powder">Powdering:</label>
<input type="text" id="chestplate-powder" name="chestplate-powder" />
</div>
</div>
<div class="center" style="grid-column:3;grid-row:1">
<br>
<div>
<label for="leggings-choice">Leggings:</label>
<input list="leggings-items" id="leggings-choice" name="leggings-choice" placeholder="No Leggings"/>
<datalist id="leggings-items">
</datalist>
</div>
<div id="leggings-slots">
X slots
</div>
<div>
<label for="leggings-powder">Powdering:</label>
<input type="text" id="leggings-powder" name="leggings-powder" />
</div>
</div>
<div class="center" style="grid-column:4;grid-row:1">
<br>
<div id="boots">
<label for="boots-choice">Boots:</label>
<input list="boots-items" id="boots-choice" name="boots-choice" placeholder="No Boots"/>
<datalist id="boots-items">
</datalist>
</div>
<br>
<div>
<label for="ring1-choice">Ring 1:</label>
<input list="ring1-items" id="ring1-choice" name="ring1-choice" placeholder="No Ring 1"/>
<datalist id="ring1-items">
</datalist>
</div>
<br>
<div>
<label for="ring2-choice">Ring 2:</label>
<input list="ring2-items" id="ring2-choice" name="ring2-choice" placeholder="No Ring 2"/>
<datalist id="ring2-items">
</datalist>
</div>
<br>
<div>
<label for="bracelet-choice">Bracelet:</label>
<input list="bracelet-items" id="bracelet-choice" name="bracelet-choice" placeholder="No Bracelet"/>
<datalist id="bracelet-items">
</datalist>
</div>
<br>
<div>
<label for="necklace-choice">Necklace:</label>
<input list="necklace-items" id="necklace-choice" name="necklace-choice" placeholder="No Necklace"/>
<datalist id="necklace-items">
</datalist>
</div>
<br>
<div>
<label for="weapon-choice">Weapon:</label>
<input list="weapon-items" id="weapon-choice" name="weapon-choice" value=""/>
<datalist id="weapon-items">
</datalist>
</div>
<br>
<div>
<button class = "button" id = "calc-button" onclick = "calculateBuild()">
Update Items (Resets stats)
</button>
</div>
</div>
<div class="left" style="grid-column:2;grid-row:1">
<label>Powdering:</label>
<div id="helmet-slots">
X slots
</div>
<div>
<input type="text" id="helmet-powder" name="helmet-powder" />
</div>
<div id="chestplate-slots">
X slots
</div>
<div>
<input type="text" id="chestplate-powder" name="chestplate-powder" />
</div>
<div id="leggings-slots">
X slots
</div>
<div>
<input type="text" id="leggings-powder" name="leggings-powder" />
</div>
<div id="boots-slots">
X slots
</div>
<div>
<label for="boots-powder">Powdering:</label>
<input type="text" id="boots-powder" name="boots-powder" />
</div>
</div>
<div class="center" style="grid-column:1;grid-row:2">
<label for="ring1-choice">Ring 1:</label>
<input list="ring1-items" id="ring1-choice" name="ring1-choice" placeholder="No Ring 1"/>
<datalist id="ring1-items">
</datalist>
</div>
<div class="center" style="grid-column:2;grid-row:2">
<label for="ring2-choice">Ring 2:</label>
<input list="ring2-items" id="ring2-choice" name="ring2-choice" placeholder="No Ring 2"/>
<datalist id="ring2-items">
</datalist>
</div>
<div class="center" style="grid-column:3;grid-row:2">
<label for="bracelet-choice">Bracelet:</label>
<input list="bracelet-items" id="bracelet-choice" name="bracelet-choice" placeholder="No Bracelet"/>
<datalist id="bracelet-items">
</datalist>
</div>
<div class="center" style="grid-column:4;grid-row:2">
<label for="necklace-choice">Necklace:</label>
<input list="necklace-items" id="necklace-choice" name="necklace-choice" placeholder="No Necklace"/>
<datalist id="necklace-items">
</datalist>
</div>
<div class="center" style="grid-column:1;grid-row:3">
<label for="weapon-choice">Weapon:</label><br>
<input list="weapon-items" id="weapon-choice" name="weapon-choice" placeholder="No Weapon"/>
<datalist id="weapon-items">
</datalist>
</div>
<div class="center" style="grid-column:2;grid-row:3">
<br/><br/><br/><br/><br/><br/><br/><br/>
<div id="weapon-slots">
X slots
</div>
<div>
<label for="weapon-powder">Weapon powder:</label>
<input type="text" id="weapon-powder" name="weapon-powder" />
</div>
</div>
<div class="center" style="grid-column:3;grid-row:3">
<button class = "button" id = "calc-button" onclick = "calculateBuild()">
Update Items (Resets stats)
</button>
</div>
<div class="center" style="grid-column:4;grid-row:3">
<button class = "reset" id = "reset-button" onclick = "resetFields()">
<br>
<div>
<button class = "reset" id = "reset-button" onclick = "resetFields()">
Reset
</button>
</button>
</div>
</div>
<div class="center" style="grid-column:3;grid-row:1">
<div class = "center build-overall" id = "build-overall">
<p class="itemcenter">Overall Build Stats:<p>
<div class = "center" id = "build-overall-stats"></div>
</div>
</div>
</div>
<div class="center" id="summary-box">

59
load.js
View file

@ -1,4 +1,4 @@
const DB_VERSION = 6;
const DB_VERSION = 7;
// @See https://github.com/mdn/learning-area/blob/master/javascript/apis/client-side-storage/indexeddb/video-store/index.js
let db;
@ -10,16 +10,35 @@ let sets;
* Load item set from local DB. Calls init() on success.
*/
async function load_local(init_func) {
let get_tx = db.transaction('item_db', 'readonly');
let get_tx = db.transaction(['item_db', 'set_db'], 'readonly');
let sets_store = get_tx.objectStore('set_db');
let get_store = get_tx.objectStore('item_db');
let request = get_store.getAll();
request.onerror = function(event) {
console.log("Could not read local db...");
console.log("Could not read local item db...");
}
request.onsuccess = function(event) {
console.log("Successfully read local db.");
console.log("Successfully read local item db.");
items = request.result;
init_func();
let request2 = sets_store.openCursor();
sets = {};
request2.onerror = function(event) {
console.log("Could not read local set db...");
}
request2.onsuccess = function(event) {
let cursor = event.target.result;
if (cursor) {
sets[cursor.primaryKey] = cursor.value;
cursor.continue();
}
else {
console.log("Successfully read local set db.");
console.log(sets);
init_func();
}
}
}
await get_tx.complete;
db.close();
@ -47,18 +66,24 @@ async function load(init_func) {
sets = result.sets;
// https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/clear
let clear_tx = db.transaction('item_db', 'readwrite');
let clear_store = clear_tx.objectStore('item_db');
let clear_tx = db.transaction(['item_db', 'set_db'], 'readwrite');
let clear_items = clear_tx.objectStore('item_db');
let clear_sets = clear_tx.objectStore('item_db');
await clear_store.clear();
await clear_items.clear();
await clear_sets.clear();
await clear_tx.complete;
let add_tx = db.transaction('item_db', 'readwrite');
let add_store = add_tx.objectStore('item_db');
let add_tx = db.transaction(['item_db', 'set_db'], 'readwrite');
let items_store = add_tx.objectStore('item_db');
let add_promises = [];
for (const item of items) {
clean_item(item);
add_promises.push(add_store.add(item, item.name));
add_promises.push(items_store.add(item, item.name));
}
let sets_store = add_tx.objectStore('set_db');
for (const set in sets) {
add_promises.push(sets_store.add(sets[set], set));
}
add_promises.push(add_tx.complete);
Promise.all(add_promises).then((values) => {
@ -95,11 +120,17 @@ function load_init(init_func) {
db.deleteObjectStore('item_db');
}
catch (error) {
console.log("Could not delete DB. This is probably fine");
console.log("Could not delete item DB. This is probably fine");
}
try {
db.deleteObjectStore('set_db');
}
catch (error) {
console.log("Could not delete set DB. This is probably fine");
}
let objectStore = db.createObjectStore('item_db');
objectStore.createIndex('item', 'item', {unique: false});
db.createObjectStore('item_db');
db.createObjectStore('set_db');
console.log("DB setup complete...");
}

View file

@ -11,7 +11,7 @@ console.log(url_tag);
* END testing section
*/
const BUILD_VERSION = "3.1";
const BUILD_VERSION = "3.2";
document.getElementById("header").textContent = "Wynn build calculator "+BUILD_VERSION+" (db version "+DB_VERSION+")";