Rewrite
This commit is contained in:
parent
8871c644fb
commit
e5fe71ce46
16 changed files with 573 additions and 638 deletions
|
|
@ -1,9 +1,5 @@
|
|||
const variables = require("./variables");
|
||||
const main = require("./main");
|
||||
|
||||
module.exports = {
|
||||
inventoryMenuM,
|
||||
};
|
||||
import { userInput } from "./functions.js";
|
||||
import { inventory, userInput } from "./variables.js";
|
||||
|
||||
//Builds the main menu inventory
|
||||
function inventoryMenuM(){
|
||||
|
|
@ -13,7 +9,7 @@ function inventoryMenuM(){
|
|||
console.log("1) Supplies");
|
||||
console.log("2) Equipment");
|
||||
console.log("[spacebar to exit]");
|
||||
var userInput = variables.userInput("Enter: ");
|
||||
let invChoice = userInput("Enter: ");
|
||||
switch(userInput){
|
||||
case "1":
|
||||
supplyInventory();
|
||||
|
|
@ -29,11 +25,11 @@ function supplyInventory(){
|
|||
console.clear();
|
||||
console.log("SUPPLIES");
|
||||
console.log("---------");
|
||||
for(var a = 0; a < variables.inventory[0].length;){
|
||||
console.log((a + 1) + ") " + variables.inventory[0][a].name);
|
||||
for(var a = 0; a < inventory[0].length;){
|
||||
console.log((a + 1) + ") " + inventory[0][a].name);
|
||||
a++;
|
||||
}
|
||||
variables.userInput("[Enter to return]");
|
||||
userInput("[Enter to return]");
|
||||
console.clear();
|
||||
inventoryMenuM();
|
||||
}
|
||||
|
|
@ -43,11 +39,11 @@ function equipmentInventory(){
|
|||
console.clear();
|
||||
console.log("EQUIPMENT");
|
||||
console.log("---------");
|
||||
for(var a = 0; a < variables.inventory[1].length;){
|
||||
console.log((a + 1) + ") " + variables.inventory[1][a].name);
|
||||
for(var a = 0; a < inventory[1].length;){
|
||||
console.log((a + 1) + ") " + inventory[1][a].name);
|
||||
a++;
|
||||
}
|
||||
variables.userInput("[Enter to return]");
|
||||
userInput("[Enter to return]");
|
||||
console.clear();
|
||||
inventoryMenuM();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue