From 443b4cd79d52bb2a9a3e3449eeeb73c97f75542e Mon Sep 17 00:00:00 2001 From: ferricles Date: Mon, 12 Apr 2021 15:32:50 -0700 Subject: [PATCH 1/2] fixed map guild claims not updating --- load_map.js | 8 ++++---- map.js | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/load_map.js b/load_map.js index 877b878..0bc8869 100644 --- a/load_map.js +++ b/load_map.js @@ -190,10 +190,10 @@ function save_map_data() { function init_map_maps() { for (const [terr,data] of Object.entries(terrdata)) { terrs.set(data.territory,data.location); - claims.set(data.territory,data.guild); - if (!guilds.includes(data.guild)) { - guilds.push(data.guild); - } + // claims.set(data.territory,data.guild); + // if (!guilds.includes(data.guild)) { + // guilds.push(data.guild); + // } neighbors.set(data.territory,data.neighbors); resources.set(data.territory,{"resources":data.resources,"storage":data.storage,"emeralds":data.emeralds,"doubleemeralds":data.doubleemeralds,"doubleresource":data.doubleresource}); } diff --git a/map.js b/map.js index 3857d57..a22a7b5 100644 --- a/map.js +++ b/map.js @@ -1,8 +1,3 @@ -/**TODO: - * Fix Claims (broken) - * Guild pull fails to update actual guilds on the map, which also do not save properly. - * Fix custom items saving reversed IDs in the wrong order. - */ /* * TESTING SECTION @@ -116,7 +111,7 @@ function init_map(){ //async just in case we need async stuff map_elem.style.background = "#121516"; try { - //refreshData(); + refreshData(); pullguilds(); //save_map_data(); } catch (error) { @@ -204,8 +199,9 @@ function toggleButton(elemID) { * */ async function refreshData() { - terrs = new Map(); + //terrs = new Map(); claims = new Map(); + terrdata; guilds = []; @@ -214,7 +210,6 @@ async function refreshData() { .then(data => {return data.json()}) .then(res => { //success terrdata = Object.entries(res['territories']); - console.log(terrdata); guilds = []; for (const terr of terrdata) { //terrs.set(terr[0], terr[1].location) //bounds shouldnt change From 99c541dea3c08f6866882740c5792f5dd340b185 Mon Sep 17 00:00:00 2001 From: ferricles Date: Tue, 13 Apr 2021 15:38:26 -0700 Subject: [PATCH 2/2] fixed legacy item names for base items screwing with the displayed name value. --- customizer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/customizer.js b/customizer.js index aa49e58..db2ea0e 100644 --- a/customizer.js +++ b/customizer.js @@ -511,6 +511,11 @@ function useBaseItem(elem) { setValue(id+"-choice", baseItem.get(id)); } } + //take care of displayName + if (baseItem.get("displayName")) { + setValue("name-choice", baseItem.get("displayName")); + } + //Take care of durability, duration, and charges. if (baseItem.get("tier") === "Crafted") { let specialIDs = ["duration", "durability"];