From 64550a81fec1f667da64dffe844e56b9732994dc Mon Sep 17 00:00:00 2001 From: b Date: Fri, 2 Apr 2021 15:07:15 -0700 Subject: [PATCH] Rename init functions --- builder.js | 2 +- crafter.js | 4 ++-- customizer.js | 9 ++++++--- item.js | 15 +++------------ items.js | 4 ++-- items_2.js | 4 ++-- load.js | 4 ++-- map.js | 4 ++-- 8 files changed, 20 insertions(+), 26 deletions(-) diff --git a/builder.js b/builder.js index 0b22a72..24deba9 100644 --- a/builder.js +++ b/builder.js @@ -108,7 +108,7 @@ function populateItemList(type) { * Populate dropdowns, add listeners, etc. */ function init() { - + console.log("builder.js init"); for (const armorType of armorTypes) { populateItemList(armorType); diff --git a/crafter.js b/crafter.js index cc1429a..f05ddfc 100644 --- a/crafter.js +++ b/crafter.js @@ -33,7 +33,7 @@ function setTitle() { -function init() { +function init_crafter() { //no ing console.log("all ingredients"); @@ -344,4 +344,4 @@ function resetFields() { calculateCraft(); } -load_ing_init(init); +load_ing_init(init_crafter); diff --git a/customizer.js b/customizer.js index 27544a8..512dcc0 100644 --- a/customizer.js +++ b/customizer.js @@ -37,7 +37,7 @@ let neg_range = [1.3,0.7]; let roll_range_ids = ["neg_roll_range-choice-min","neg_roll_range-choice-max","pos_roll_range-choice-min","pos_roll_range-choice-max"]; -function init() { +function init_customizer() { try { populateFields(); @@ -694,5 +694,8 @@ function resetBaseValues() { } } -load_init(init); -load_ing_init(init); +function _init_customizer() { + load_ing_init(init_customizer); +} + +load_init(_init_customizer); diff --git a/item.js b/item.js index 66b827f..a0b7d10 100644 --- a/item.js +++ b/item.js @@ -19,18 +19,9 @@ function setTitle() { setTitle(); - - - -/* - * END testing section - */ - - let item; - -function init() { +function init_itempage() { //console.log(item_url_tag); //displayExpandedItem(expandItem(itemMap.get(item_url_tag).statMap, []), "item-view"); @@ -53,5 +44,5 @@ function init() { -load_init(init); -//load_ing_init(init); \ No newline at end of file +load_init(init_itempage); +//load_ing_init(init); diff --git a/items.js b/items.js index 63a7df0..a6a45e6 100644 --- a/items.js +++ b/items.js @@ -189,8 +189,8 @@ function doItemSearch() { displayItems(items_copy); } -function init() { +function init_items() { items_expanded = items.filter( (i) => !("remapID" in i) ).map( (i) => expandItem(i, []) ); } -load_init(init); +load_init(init_items); diff --git a/items_2.js b/items_2.js index 8f478d4..9f4b939 100644 --- a/items_2.js +++ b/items_2.js @@ -54,7 +54,7 @@ function stringify(v) { return typeof v === 'number' ? (Math.round(v * 100) / 100).toString() : v; } -function init() { +function init_items2() { const itemList = document.getElementById('item-list'); const itemListFooter = document.getElementById('item-list-footer'); @@ -198,4 +198,4 @@ function init() { searchFilterField.field.select(); } -load_init(init); +load_init(init_items2); diff --git a/load.js b/load.js index e81a6b4..266a436 100644 --- a/load.js +++ b/load.js @@ -41,12 +41,12 @@ async function load_local(init_func) { console.log("Successfully read local set db."); //console.log(sets); init_maps(); + console.log(init_func); + init_func(); } } } await get_tx.complete; - db.close(); - init_func(); } /* diff --git a/map.js b/map.js index 7628692..da43827 100644 --- a/map.js +++ b/map.js @@ -60,7 +60,7 @@ const resourceColors = new Map([ /** Thanks to kristofbolyai's github page for showing me how to do all of this. * */ -function init(){ //async just in case we need async stuff +function init_map(){ //async just in case we need async stuff map_elem = document.getElementById("mapdiv"); let coordx_elem = document.getElementById("coord-x"); let coordz_elem = document.getElementById("coord-z"); @@ -581,5 +581,5 @@ function eraseTerritoryStats() { } -load_map_init(init); +load_map_init(init_map);