Compare commits
2 Commits
66e7635119
...
7e7653ec83
| Author | SHA1 | Date |
|---|---|---|
|
|
7e7653ec83 | |
|
|
42689499d3 |
|
|
@ -1,4 +1,4 @@
|
||||||
export function getGame(url) {
|
export function getGame(url = window.location.href) {
|
||||||
let last = url.lastIndexOf("/", url.length);
|
let last = url.lastIndexOf("/", url.length);
|
||||||
let first = url.lastIndexOf("/", last - 1) + 1;
|
let first = url.lastIndexOf("/", last - 1) + 1;
|
||||||
return url.substring(first, last);
|
return url.substring(first, last);
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
import { getGame } from "./helper.js";
|
import * as storage from "./storage.js";
|
||||||
|
|
||||||
const TRACKED_STORAGE_NAME = "/drops/tracked/";
|
const TRACKED_STORAGE_NAME = "/drops/tracked/";
|
||||||
|
|
||||||
let gameName;
|
|
||||||
|
|
||||||
export let showOnlyTracked = false;
|
export let showOnlyTracked = false;
|
||||||
export let kindFilter = new Set();
|
export let kindFilter = new Set();
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
gameName = getGame(window.location.href);
|
|
||||||
|
|
||||||
loadTracked();
|
loadTracked();
|
||||||
|
|
||||||
const onlyTrackedFilter = document.querySelector(
|
const onlyTrackedFilter = document.querySelector(
|
||||||
|
|
@ -65,10 +61,12 @@ function loadTracked() {
|
||||||
|
|
||||||
for (const category of categories) {
|
for (const category of categories) {
|
||||||
let id =
|
let id =
|
||||||
category.dataset["matKind"] + "-" + category.dataset["matType"];
|
TRACKED_STORAGE_NAME +
|
||||||
id = gameName + TRACKED_STORAGE_NAME + id;
|
category.dataset["matKind"] +
|
||||||
|
"-" +
|
||||||
|
category.dataset["matType"];
|
||||||
|
|
||||||
let isTracked = localStorage.getItem(id) === "true";
|
let isTracked = storage.get(id) === "true";
|
||||||
if (isTracked) {
|
if (isTracked) {
|
||||||
category.dataset["isTracked"] = true;
|
category.dataset["isTracked"] = true;
|
||||||
let trackButton = category.querySelector(".category button");
|
let trackButton = category.querySelector(".category button");
|
||||||
|
|
@ -84,16 +82,19 @@ function loadTracked() {
|
||||||
|
|
||||||
export function track(element) {
|
export function track(element) {
|
||||||
let parent = element.parentElement.parentElement;
|
let parent = element.parentElement.parentElement;
|
||||||
let id = parent.dataset["matKind"] + "-" + parent.dataset["matType"];
|
let id =
|
||||||
id = gameName + TRACKED_STORAGE_NAME + id;
|
TRACKED_STORAGE_NAME +
|
||||||
|
parent.dataset["matKind"] +
|
||||||
|
"-" +
|
||||||
|
parent.dataset["matType"];
|
||||||
|
|
||||||
let isTracked = parent.dataset["isTracked"] ?? false;
|
let isTracked = parent.dataset["isTracked"] ?? false;
|
||||||
isTracked = isTracked === "true" ? false : true;
|
isTracked = isTracked === "true" ? false : true;
|
||||||
|
|
||||||
if (isTracked) {
|
if (isTracked) {
|
||||||
localStorage.setItem(id, true);
|
storage.set(id, true);
|
||||||
} else {
|
} else {
|
||||||
localStorage.removeItem(id);
|
storage.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.dataset["isTracked"] = isTracked;
|
parent.dataset["isTracked"] = isTracked;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { getGame } from "./helper.js";
|
||||||
|
|
||||||
|
export function remove(key) {
|
||||||
|
localStorage.removeItem(getGame() + key);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function get(key) {
|
||||||
|
return localStorage.getItem(getGame() + key);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function set(key, value) {
|
||||||
|
localStorage.setItem(getGame() + key, value);
|
||||||
|
}
|
||||||
|
|
@ -1,29 +1,22 @@
|
||||||
import "../common/prototypes.js";
|
import "../common/prototypes.js";
|
||||||
import { getGame } from "../common/helper.js";
|
import * as storage from "../common/storage.js";
|
||||||
|
|
||||||
const RECIPE_STORAGE_NAME = "/synth/";
|
const RECIPE_STORAGE_NAME = "/synth/";
|
||||||
const LIST_STORAGE_NAME = "/synth/needed-mats";
|
const LIST_STORAGE_NAME = "/synth/finished-mats";
|
||||||
|
|
||||||
let markedNeededMaterials = [];
|
let markedNeededMaterials = [];
|
||||||
let gameName;
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", (event) => {
|
document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
gameName = getGame(window.location.href);
|
|
||||||
|
|
||||||
const recipes = document.querySelectorAll(".recipe");
|
const recipes = document.querySelectorAll(".recipe");
|
||||||
|
|
||||||
for (const recipe of recipes) {
|
for (const recipe of recipes) {
|
||||||
recipe.checked =
|
recipe.checked =
|
||||||
localStorage.getItem(gameName + RECIPE_STORAGE_NAME + recipe.id) ===
|
storage.get(RECIPE_STORAGE_NAME + recipe.id) === "true" ?? false;
|
||||||
"true" ?? false;
|
|
||||||
updateSynthRecipeState(recipe);
|
updateSynthRecipeState(recipe);
|
||||||
|
|
||||||
recipe.addEventListener("input", function () {
|
recipe.addEventListener("input", function () {
|
||||||
// Change the recipe's state and update and needed materials list based on the remaining recipes
|
// Change the recipe's state and update and needed materials list based on the remaining recipes
|
||||||
localStorage.setItem(
|
storage.set(RECIPE_STORAGE_NAME + this.id, this.checked);
|
||||||
gameName + RECIPE_STORAGE_NAME + this.id,
|
|
||||||
this.checked,
|
|
||||||
);
|
|
||||||
updateSynthRecipeState(this);
|
updateSynthRecipeState(this);
|
||||||
calcNeededMats();
|
calcNeededMats();
|
||||||
});
|
});
|
||||||
|
|
@ -37,8 +30,8 @@ document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turn the single saved string into an array with each material
|
// Turn the single saved string into an array with each material
|
||||||
if (localStorage.getItem(gameName + LIST_STORAGE_NAME) != null) {
|
if (storage.get(LIST_STORAGE_NAME) != null) {
|
||||||
let saved = localStorage.getItem(gameName + LIST_STORAGE_NAME);
|
let saved = storage.get(LIST_STORAGE_NAME);
|
||||||
saved = saved.split(",");
|
saved = saved.split(",");
|
||||||
markedNeededMaterials = saved;
|
markedNeededMaterials = saved;
|
||||||
markedNeededMaterials = markedNeededMaterials.filter(
|
markedNeededMaterials = markedNeededMaterials.filter(
|
||||||
|
|
@ -139,7 +132,7 @@ function updateMarkedNeededMats(ingredient) {
|
||||||
markedNeededMaterials.push(ingredient);
|
markedNeededMaterials.push(ingredient);
|
||||||
}
|
}
|
||||||
markedNeededMaterials = markedNeededMaterials.filter((n) => n && n !== "");
|
markedNeededMaterials = markedNeededMaterials.filter((n) => n && n !== "");
|
||||||
localStorage.setItem(gameName + LIST_STORAGE_NAME, markedNeededMaterials);
|
storage.set(LIST_STORAGE_NAME, markedNeededMaterials);
|
||||||
}
|
}
|
||||||
|
|
||||||
function markNeededMat(mat) {
|
function markNeededMat(mat) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
const STORAGE_NAME = "kh3/food-sim/recipe.";
|
import * as storage from "../common/storage.js";
|
||||||
|
|
||||||
|
const STORAGE_NAME = "/food-sim/recipe-";
|
||||||
const types = ["starters", "soups", "fish", "meat", "deserts"];
|
const types = ["starters", "soups", "fish", "meat", "deserts"];
|
||||||
|
|
||||||
let globalStats = { str: 0, mag: 0, def: 0, hp: 0, mp: 0 };
|
let globalStats = { str: 0, mag: 0, def: 0, hp: 0, mp: 0 };
|
||||||
|
|
@ -10,7 +12,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
updateStats();
|
updateStats();
|
||||||
|
|
||||||
types.forEach(function (type, typeIdx) {
|
types.forEach(function (type, typeIdx) {
|
||||||
let savedRecipe = localStorage.getItem(STORAGE_NAME + typeIdx);
|
let savedRecipe = storage.get(STORAGE_NAME + typeIdx);
|
||||||
|
|
||||||
const recipes = document.querySelectorAll(
|
const recipes = document.querySelectorAll(
|
||||||
"div.recipes." + type + " .recipe",
|
"div.recipes." + type + " .recipe",
|
||||||
|
|
@ -19,6 +21,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
recipes.forEach(function (item, index) {
|
recipes.forEach(function (item, index) {
|
||||||
let recipeName = item.querySelector(".title").innerText;
|
let recipeName = item.querySelector(".title").innerText;
|
||||||
if (savedRecipe != undefined && recipeName == savedRecipe) {
|
if (savedRecipe != undefined && recipeName == savedRecipe) {
|
||||||
|
hasSelection[typeIdx] = true;
|
||||||
selectRecipe(item, typeIdx);
|
selectRecipe(item, typeIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,7 +92,7 @@ function unselectRecipe(index) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
localStorage.removeItem(STORAGE_NAME + index);
|
storage.remove(STORAGE_NAME + index);
|
||||||
|
|
||||||
typeItem[index].style["box-shadow"] = "0px 0px 10px rgba(0, 0, 0, 0.4)";
|
typeItem[index].style["box-shadow"] = "0px 0px 10px rgba(0, 0, 0, 0.4)";
|
||||||
let stats = JSON.parse(typeItem[index].dataset["stats"]);
|
let stats = JSON.parse(typeItem[index].dataset["stats"]);
|
||||||
|
|
@ -107,7 +110,7 @@ function selectRecipe(item, index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let recipeName = item.querySelector(".title").innerText;
|
let recipeName = item.querySelector(".title").innerText;
|
||||||
localStorage.setItem(STORAGE_NAME + index, recipeName);
|
storage.set(STORAGE_NAME + index, recipeName);
|
||||||
|
|
||||||
let stats = JSON.parse(item.dataset["stats"]);
|
let stats = JSON.parse(item.dataset["stats"]);
|
||||||
addStats(stats);
|
addStats(stats);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
const CODES_STORAGE_NAME = "kh3/pro-codes-sim/codes/";
|
import * as storage from "../common/storage.js";
|
||||||
const MERIT_STORAGE_NAME = "kh3/pro-codes-sim/merit/";
|
|
||||||
|
const CODES_STORAGE_NAME = "/pro-codes-sim/codes/";
|
||||||
|
const MERIT_STORAGE_NAME = "/pro-codes-sim/merit/";
|
||||||
const STAR_MULTIPLIER = 1.25;
|
const STAR_MULTIPLIER = 1.25;
|
||||||
|
|
||||||
let selectionAllState = false;
|
let selectionAllState = false;
|
||||||
|
|
@ -14,9 +16,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
// Loading enabled codes
|
// Loading enabled codes
|
||||||
for (let code of codes) {
|
for (let code of codes) {
|
||||||
const hasCodeToggled =
|
const hasCodeToggled =
|
||||||
localStorage.getItem(CODES_STORAGE_NAME + code.id) === "true"
|
storage.get(CODES_STORAGE_NAME + code.id) === "true" ? true : false;
|
||||||
? true
|
|
||||||
: false;
|
|
||||||
if (hasCodeToggled) {
|
if (hasCodeToggled) {
|
||||||
// Normally the toggleCode gets called after the checkbox is checked,
|
// Normally the toggleCode gets called after the checkbox is checked,
|
||||||
// since we don't interact with it at this point we mark it as checked manually here
|
// since we don't interact with it at this point we mark it as checked manually here
|
||||||
|
|
@ -28,8 +28,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
// Loading marked fights and their merit
|
// Loading marked fights and their merit
|
||||||
for (let fight of fights) {
|
for (let fight of fights) {
|
||||||
const source = fight.dataset["meritSource"];
|
const source = fight.dataset["meritSource"];
|
||||||
const merit =
|
const merit = Number(storage.get(MERIT_STORAGE_NAME + source)) ?? 0;
|
||||||
Number(localStorage.getItem(MERIT_STORAGE_NAME + source)) ?? 0;
|
|
||||||
if (merit > 0) {
|
if (merit > 0) {
|
||||||
markFight(fight, merit);
|
markFight(fight, merit);
|
||||||
}
|
}
|
||||||
|
|
@ -50,7 +49,7 @@ function markFight(data, loadedMerit = 0) {
|
||||||
updateMeritCounter();
|
updateMeritCounter();
|
||||||
fightMerit[source] = 0;
|
fightMerit[source] = 0;
|
||||||
|
|
||||||
localStorage.removeItem(MERIT_STORAGE_NAME + source);
|
storage.remove(MERIT_STORAGE_NAME + source);
|
||||||
|
|
||||||
data.innerText = "Mark";
|
data.innerText = "Mark";
|
||||||
data.classList.remove("danger");
|
data.classList.remove("danger");
|
||||||
|
|
@ -64,7 +63,7 @@ function markFight(data, loadedMerit = 0) {
|
||||||
updateMeritCounter();
|
updateMeritCounter();
|
||||||
fightMerit[source] = merit;
|
fightMerit[source] = merit;
|
||||||
|
|
||||||
localStorage.setItem(MERIT_STORAGE_NAME + source, merit);
|
storage.set(MERIT_STORAGE_NAME + source, merit);
|
||||||
|
|
||||||
data.innerText = "Unmark";
|
data.innerText = "Unmark";
|
||||||
data.classList.add("danger");
|
data.classList.add("danger");
|
||||||
|
|
@ -77,12 +76,12 @@ function toggleCode(code) {
|
||||||
|
|
||||||
if (code.checked) {
|
if (code.checked) {
|
||||||
stars += codeStars;
|
stars += codeStars;
|
||||||
localStorage.setItem(CODES_STORAGE_NAME + code.id, true);
|
storage.set(CODES_STORAGE_NAME + code.id, true);
|
||||||
} else {
|
} else {
|
||||||
stars -= codeStars;
|
stars -= codeStars;
|
||||||
selectionAllState = false;
|
selectionAllState = false;
|
||||||
updateAllButton();
|
updateAllButton();
|
||||||
localStorage.removeItem(CODES_STORAGE_NAME + code.id);
|
storage.remove(CODES_STORAGE_NAME + code.id);
|
||||||
}
|
}
|
||||||
updateStarsCounter();
|
updateStarsCounter();
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +98,7 @@ function toggleAllCodes() {
|
||||||
}
|
}
|
||||||
code.checked = true;
|
code.checked = true;
|
||||||
stars += Number(code.dataset["stars"]);
|
stars += Number(code.dataset["stars"]);
|
||||||
localStorage.setItem(CODES_STORAGE_NAME + code.id, true);
|
storage.set(CODES_STORAGE_NAME + code.id, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
selectionAllState = false;
|
selectionAllState = false;
|
||||||
|
|
@ -110,7 +109,7 @@ function toggleAllCodes() {
|
||||||
}
|
}
|
||||||
code.checked = false;
|
code.checked = false;
|
||||||
stars -= Number(code.dataset["stars"]);
|
stars -= Number(code.dataset["stars"]);
|
||||||
localStorage.removeItem(CODES_STORAGE_NAME + code.id);
|
storage.remove(CODES_STORAGE_NAME + code.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ table.board {
|
||||||
height: 70%;
|
height: 70%;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
background-color: #cbf;
|
background-color: #eee;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
@ -222,6 +222,5 @@ table.board {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
/*color: #3c3c3c;*/
|
color: #eee;
|
||||||
color: #ccbbff;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,15 +39,15 @@ pub struct Module;
|
||||||
|
|
||||||
impl RuntimeModule for Module {
|
impl RuntimeModule for Module {
|
||||||
fn start_module() {
|
fn start_module() {
|
||||||
tracing::info!("Loading abilities data from {}", ABILITIES_PATH);
|
tracing::info!("Loading BBS abilities data from {}", ABILITIES_PATH);
|
||||||
let abilities_str = std::fs::read_to_string(ABILITIES_PATH).unwrap();
|
let abilities_str = std::fs::read_to_string(ABILITIES_PATH).unwrap();
|
||||||
let abilities = serde_json::from_str::<Vec<Ability>>(&abilities_str).unwrap();
|
let abilities = serde_json::from_str::<Vec<Ability>>(&abilities_str).unwrap();
|
||||||
|
|
||||||
tracing::info!("Loading finishers data from {}", ABILITIES_PATH);
|
tracing::info!("Loading BBS finishers data from {}", ABILITIES_PATH);
|
||||||
let finishers_str = std::fs::read_to_string(FINISHERS_PATH).unwrap();
|
let finishers_str = std::fs::read_to_string(FINISHERS_PATH).unwrap();
|
||||||
let finishers = serde_json::from_str::<HashMap<String, Finisher>>(&finishers_str).unwrap();
|
let finishers = serde_json::from_str::<HashMap<String, Finisher>>(&finishers_str).unwrap();
|
||||||
|
|
||||||
tracing::info!("Loading commands data from {}", ABILITIES_PATH);
|
tracing::info!("Loading BBS commands data from {}", ABILITIES_PATH);
|
||||||
let commands_str = std::fs::read_to_string(COMMANDS_PATH).unwrap();
|
let commands_str = std::fs::read_to_string(COMMANDS_PATH).unwrap();
|
||||||
let mut commands = serde_json::from_str::<Vec<Command>>(&commands_str).unwrap();
|
let mut commands = serde_json::from_str::<Vec<Command>>(&commands_str).unwrap();
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ impl RuntimeModule for Module {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tracing::info!("Generating the BBS melding table template");
|
tracing::info!("Generating BBS melding table template");
|
||||||
let melding_template = CommandsTemplate { commands, crystals };
|
let melding_template = CommandsTemplate { commands, crystals };
|
||||||
|
|
||||||
create_file("./out/bbs", "melding", melding_template).unwrap();
|
create_file("./out/bbs", "melding", melding_template).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ pub struct Module;
|
||||||
|
|
||||||
impl RuntimeModule for Module {
|
impl RuntimeModule for Module {
|
||||||
fn start_module() {
|
fn start_module() {
|
||||||
tracing::info!("Loading ability boards data from {}", ABILITIES_PATH);
|
tracing::info!("Loading DDD ability boards data from {}", ABILITIES_PATH);
|
||||||
let mut boards: Vec<Board> = vec![];
|
let mut boards: Vec<Board> = vec![];
|
||||||
// Loading multiple files into one vector due to the size of each board
|
// Loading multiple files into one vector due to the size of each board
|
||||||
let paths = std::fs::read_dir(ABILITIES_PATH)
|
let paths = std::fs::read_dir(ABILITIES_PATH)
|
||||||
|
|
@ -49,7 +49,7 @@ impl RuntimeModule for Module {
|
||||||
}
|
}
|
||||||
boards.sort_by(|a, b| a.order.cmp(&b.order));
|
boards.sort_by(|a, b| a.order.cmp(&b.order));
|
||||||
|
|
||||||
tracing::info!("Generating the DDD ability boards template");
|
tracing::info!("Generating DDD ability boards template");
|
||||||
let boards_template = AbilitiesTemplate { boards };
|
let boards_template = AbilitiesTemplate { boards };
|
||||||
|
|
||||||
create_file("./out/ddd", "boards", boards_template).unwrap();
|
create_file("./out/ddd", "boards", boards_template).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ pub struct Module;
|
||||||
|
|
||||||
impl RuntimeModule for Module {
|
impl RuntimeModule for Module {
|
||||||
fn start_module() {
|
fn start_module() {
|
||||||
tracing::info!("Loading synthesis data from {}", SYNTHESIS_PATH);
|
tracing::info!("Loading KH1 synthesis data from {}", SYNTHESIS_PATH);
|
||||||
let synth = Synthesis::new(SYNTHESIS_PATH);
|
let synth = Synthesis::new(SYNTHESIS_PATH);
|
||||||
|
|
||||||
tracing::info!("Generating the KH1 synth template");
|
tracing::info!("Generating KH1 synth template");
|
||||||
let synth_template = SynthTemplate { data: synth };
|
let synth_template = SynthTemplate { data: synth };
|
||||||
|
|
||||||
create_file("./out/kh1", "synth", synth_template).unwrap();
|
create_file("./out/kh1", "synth", synth_template).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,20 @@ pub struct Module;
|
||||||
|
|
||||||
impl RuntimeModule for Module {
|
impl RuntimeModule for Module {
|
||||||
fn start_module() {
|
fn start_module() {
|
||||||
tracing::info!("Loading enemy data from {}", ENEMIES_PATH);
|
tracing::info!("Loading KH1FM enemy data from {}", ENEMIES_PATH);
|
||||||
let enemies = Enemy::import(ENEMIES_PATH);
|
let enemies = Enemy::import(ENEMIES_PATH);
|
||||||
|
|
||||||
let drops = Drops::new(Game::Kh1(GameProps::final_mix()), enemies);
|
let drops = Drops::new(Game::Kh1(GameProps::final_mix()), enemies);
|
||||||
|
|
||||||
tracing::info!("Loading synthesis data from {}", SYNTHESIS_PATH);
|
tracing::info!("Loading KH1FM synthesis data from {}", SYNTHESIS_PATH);
|
||||||
let synth = Synthesis::new(SYNTHESIS_PATH);
|
let synth = Synthesis::new(SYNTHESIS_PATH);
|
||||||
|
|
||||||
tracing::info!("Generating the KH1FM, drops template");
|
tracing::info!("Generating KH1FM drops template");
|
||||||
let drops_template = DropsTemplate { data: drops };
|
let drops_template = DropsTemplate { data: drops };
|
||||||
|
|
||||||
create_file("./out/kh1fm", "drops", drops_template).unwrap();
|
create_file("./out/kh1fm", "drops", drops_template).unwrap();
|
||||||
|
|
||||||
tracing::info!("Generating the KH1FM synth template");
|
tracing::info!("Generating KH1FM synth template");
|
||||||
let synth_template = SynthTemplate { data: synth };
|
let synth_template = SynthTemplate { data: synth };
|
||||||
|
|
||||||
create_file("./out/kh1fm", "synth", synth_template).unwrap();
|
create_file("./out/kh1fm", "synth", synth_template).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ pub struct Module;
|
||||||
|
|
||||||
impl RuntimeModule for Module {
|
impl RuntimeModule for Module {
|
||||||
fn start_module() {
|
fn start_module() {
|
||||||
tracing::info!("Loading enemy data from {}", ENEMIES_PATH);
|
tracing::info!("Loading KH2FM enemy data from {}", ENEMIES_PATH);
|
||||||
let enemies = Enemy::import(ENEMIES_PATH);
|
let enemies = Enemy::import(ENEMIES_PATH);
|
||||||
|
|
||||||
let drops = Drops::new(Game::Kh2(GameProps::final_mix()), enemies);
|
let drops = Drops::new(Game::Kh2(GameProps::final_mix()), enemies);
|
||||||
|
|
||||||
tracing::info!("Generating the KH2FM drops template");
|
tracing::info!("Generating KH2FM drops template");
|
||||||
let drops_template = DropsTemplate { data: drops };
|
let drops_template = DropsTemplate { data: drops };
|
||||||
|
|
||||||
create_file("./out/kh2fm", "drops", drops_template).unwrap();
|
create_file("./out/kh2fm", "drops", drops_template).unwrap();
|
||||||
|
|
|
||||||
16
src/kh3.rs
16
src/kh3.rs
|
|
@ -48,36 +48,36 @@ pub struct Module;
|
||||||
|
|
||||||
impl RuntimeModule for Module {
|
impl RuntimeModule for Module {
|
||||||
fn start_module() {
|
fn start_module() {
|
||||||
tracing::info!("Loading enemy data from {}", ENEMIES_PATH);
|
tracing::info!("Loading KH3 enemy data from {}", ENEMIES_PATH);
|
||||||
let enemies = Enemy::import(ENEMIES_PATH);
|
let enemies = Enemy::import(ENEMIES_PATH);
|
||||||
let drops = Drops::new(Game::Kh3, enemies);
|
let drops = Drops::new(Game::Kh3, enemies);
|
||||||
|
|
||||||
tracing::info!("Loading ingredients data from {}", ENEMIES_PATH);
|
tracing::info!("Loading KH3 ingredients data from {}", ENEMIES_PATH);
|
||||||
let ingredients = Ingredient::import(INGREDIENTS_PATH);
|
let ingredients = Ingredient::import(INGREDIENTS_PATH);
|
||||||
|
|
||||||
tracing::info!("Loading recipes data from {}", RECIPES_PATH);
|
tracing::info!("Loading KH3 recipes data from {}", RECIPES_PATH);
|
||||||
let recipes_str = std::fs::read_to_string(RECIPES_PATH).unwrap();
|
let recipes_str = std::fs::read_to_string(RECIPES_PATH).unwrap();
|
||||||
let recipes = toml::from_str::<Recipes>(&recipes_str).unwrap();
|
let recipes = toml::from_str::<Recipes>(&recipes_str).unwrap();
|
||||||
|
|
||||||
tracing::info!("Loading pro codes data from {}", PRO_CODES_PATH);
|
tracing::info!("Loading KH3 pro codes data from {}", PRO_CODES_PATH);
|
||||||
let pro_codes_str = std::fs::read_to_string(PRO_CODES_PATH).unwrap();
|
let pro_codes_str = std::fs::read_to_string(PRO_CODES_PATH).unwrap();
|
||||||
let pro_codes = toml::from_str::<ProCodes>(&pro_codes_str).unwrap();
|
let pro_codes = toml::from_str::<ProCodes>(&pro_codes_str).unwrap();
|
||||||
let pro_code_fights_str = std::fs::read_to_string(PRO_CODE_FIGHTS_PATH).unwrap();
|
let pro_code_fights_str = std::fs::read_to_string(PRO_CODE_FIGHTS_PATH).unwrap();
|
||||||
let pro_code_fights = toml::from_str::<ProCodeFights>(&pro_code_fights_str).unwrap();
|
let pro_code_fights = toml::from_str::<ProCodeFights>(&pro_code_fights_str).unwrap();
|
||||||
|
|
||||||
tracing::info!("Generating the KH3 drops template");
|
tracing::info!("Generating KH3 drops template");
|
||||||
let drops_template = DropsTemplate { data: drops };
|
let drops_template = DropsTemplate { data: drops };
|
||||||
create_file("./out/kh3", "drops", drops_template).unwrap();
|
create_file("./out/kh3", "drops", drops_template).unwrap();
|
||||||
|
|
||||||
tracing::info!("Generating the KH3 ingredients template");
|
tracing::info!("Generating KH3 ingredients template");
|
||||||
let ingredients_template = IngredientsTemplate { ingredients };
|
let ingredients_template = IngredientsTemplate { ingredients };
|
||||||
create_file("./out/kh3", "ingredients", ingredients_template).unwrap();
|
create_file("./out/kh3", "ingredients", ingredients_template).unwrap();
|
||||||
|
|
||||||
tracing::info!("Generating the KH3 recipes template");
|
tracing::info!("Generating KH3 recipes template");
|
||||||
let food_template = RecipesTemplate { recipes };
|
let food_template = RecipesTemplate { recipes };
|
||||||
create_file("./out/kh3", "food-sim", food_template).unwrap();
|
create_file("./out/kh3", "food-sim", food_template).unwrap();
|
||||||
|
|
||||||
tracing::info!("Generating the KH3 pro codes template");
|
tracing::info!("Generating KH3 pro codes template");
|
||||||
let pro_codes_template = ProCodesTemplate {
|
let pro_codes_template = ProCodesTemplate {
|
||||||
pro_codes: pro_codes.codes,
|
pro_codes: pro_codes.codes,
|
||||||
fights: pro_code_fights.fights,
|
fights: pro_code_fights.fights,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue