Added initial version of styling to the UI

This commit is contained in:
Andrew Miner
2013-08-18 01:13:32 -07:00
parent 7ea8fcb5ec
commit c4709c28bd
19 changed files with 532 additions and 82 deletions
+1
View File
@@ -0,0 +1 @@
.DS_Store
+80 -31
View File
@@ -3,18 +3,22 @@
var FADE_DURATION = 250; // ms var FADE_DURATION = 250; // ms
var ERROR_DISPLAY_DURATION = 5000; // ms var ERROR_DISPLAY_DURATION = 5000; // ms
// Global Variables ///////////////////////////////////////////////////////////////////////////////////////////////////
var __recipebooks = [];
// UI Functions /////////////////////////////////////////////////////////////////////////////////////////////////////// // UI Functions ///////////////////////////////////////////////////////////////////////////////////////////////////////
function onPageLoad() { $(function() {
$("#recipe_load_button").click(onRecipeLoadButtonClicked); $("#recipebook_load_button").click(onRecipeLoadButtonClicked);
$("#crafting_selector").change(onCraftingSelectorChanged); $("#crafting_selector").change(onCraftingSelectorChanged);
loadRecipes("data/vanilla.json"); loadRecipebook("data/vanilla.json");
} });
function onCraftingSelectorChanged() { function onCraftingSelectorChanged() {
var recipeName = $("#crafting_selector option:selected").val(); var recipeName = $("#crafting_selector option:selected").val();
var recipe = __recipes[recipeName]; var recipe = findRecipe(recipeName);
if (recipe === undefined) { if (recipe === undefined) {
$("#crafting_error").html("Cannot find recipe for " + recipeName); $("#crafting_error").html("Cannot find recipe for " + recipeName);
$("#crafting_error").fadeIn(FADE_DURATION).delay(ERROR_DISPLAY_DURATION).fadeOut(FADE_DURATION); $("#crafting_error").fadeIn(FADE_DURATION).delay(ERROR_DISPLAY_DURATION).fadeOut(FADE_DURATION);
@@ -28,24 +32,30 @@ function onCraftingSelectorChanged() {
} }
function onRecipeLoadButtonClicked() { function onRecipeLoadButtonClicked() {
loadRecipes($("#recipe_url").val()); $("#reipebook_load_button").attr("disabled", true);
loadRecipebook($("#recipebook_url").val(), function() {
$("#recipebook_url").val("");
$("#reipebook_load_button").removeAttr("disabled");
});
} }
// UI Helper Functions //////////////////////////////////////////////////////////////////////////////////////////////// // UI Helper Functions ////////////////////////////////////////////////////////////////////////////////////////////////
function loadRecipes(recipeUrl) { function loadRecipebook(recipebookUrl, onSuccess) {
$.ajax({ $.ajax({
url: recipeUrl, url: recipebookUrl,
dataType: "text", dataType: "text",
success: function(data) { success: function(text) {
try { try {
recipeData = $.parseJSON(data)["recipes"]; var recipebook = createRecipebook(recipebookUrl, $.parseJSON(text));
__recipes = parseRecipeData(recipeData); __recipebooks.push(recipebook);
$("#loaded_recipes ul").append("<li><a href=\"" + recipeUrl + "\">" + recipeUrl + "</a></li>");
$("#loaded_recipes").fadeIn(FADE_DURATION); recipebook.asTableRow().insertBefore($("#recipebook_table tr").last());
updateCraftingSelector(); updateCraftingSelector();
$("#crafting").fadeIn(FADE_DURATION); $("#crafting").fadeIn(FADE_DURATION);
if (onSuccess !== undefined) onSuccess();
} catch (e) { } catch (e) {
$("#load_error").html(e); $("#load_error").html(e);
$("#load_error").slideDown(FADE_DURATION).delay(ERROR_DISPLAY_DURATION).slideUp(FADE_DURATION); $("#load_error").slideDown(FADE_DURATION).delay(ERROR_DISPLAY_DURATION).slideUp(FADE_DURATION);
@@ -60,13 +70,20 @@ function loadRecipes(recipeUrl) {
function updateCraftingSelector() { function updateCraftingSelector() {
var $selector = $("#crafting_selector"); var $selector = $("#crafting_selector");
if (__recipes.length == 0) { $selector.html("");
if (__recipebooks.length == 0) {
$selector.attr("disabled", "disabled"); $selector.attr("disabled", "disabled");
$selector.html("<option>No recipes</option>");
} else { } else {
for (var name in __recipes) { $(__recipebooks).each(function(i, recipebook) {
if (!__recipes.hasOwnProperty(name)) continue; var $optgroup = $("<optgroup label=\"" + recipebook.name + "\">");
$selector.append("<option value=\"" + name + "\">" + name + "</option>"); $selector.append($optgroup);
}
for (var name in recipebook.recipes) {
$optgroup.append("<option value=\"" + name + "\">" + name + "</option>");
}
});
$selector.removeAttr("disabled"); $selector.removeAttr("disabled");
} }
} }
@@ -116,17 +133,6 @@ function createManifest() {
// Recipe Object ////////////////////////////////////////////////////////////////////////////////////////////////////// // Recipe Object //////////////////////////////////////////////////////////////////////////////////////////////////////
function parseRecipeData(recipeData) {
var recipes = {};
$.each(recipeData, function(i, data) {
var recipe = createRecipe(data);
$.each(recipe.output, function(j, output) {
recipes[output.name] = recipe
});
});
return recipes;
}
function createRecipe(data) { function createRecipe(data) {
var object = {output: [], input: [], tools: data.tools}; var object = {output: [], input: [], tools: data.tools};
@@ -146,7 +152,7 @@ function createRecipe(data) {
var queue = []; var queue = [];
function craftItem(ingredient) { function craftItem(ingredient) {
var recipe = __recipes[ingredient.name]; var recipe = findRecipe(ingredient.name);
if (recipe === undefined) { if (recipe === undefined) {
missingMaterials.add(1, ingredient.name); missingMaterials.add(1, ingredient.name);
ingredient.count -= 1 ingredient.count -= 1
@@ -159,7 +165,12 @@ function createRecipe(data) {
}); });
$.each(recipe.tools, function(j, tool) { $.each(recipe.tools, function(j, tool) {
if (! inventory.contains(1, tool)) { if (! inventory.contains(1, tool)) {
craftItem({count: 1, name: tool}); if (findRecipe(tool) === undefined) {
inventory.add(1, tool);
missingMaterials.add(1, tool);
} else {
craftItem({count: 1, name: tool});
}
} }
}); });
} }
@@ -185,3 +196,41 @@ function createRecipe(data) {
return object; return object;
} }
// RecipeBook Object //////////////////////////////////////////////////////////////////////////////////////////////////
function createRecipebook(sourceUrl, data) {
var object = {
name: data.name,
description: data.description,
sourceUrl: sourceUrl,
recipes: {}
};
$(data.recipes).each(function(i, data) {
var recipe = createRecipe(data);
$(recipe.output).each(function(j, output) {
object.recipes[output.name] = recipe
});
});
object.asTableRow = function() {
return $(
"<tr>" +
"<td width=\"25%\"><a target=\"new\" href=\"" + object.sourceUrl + "\">" + object.name + "</a></td>" +
"<td width=\"*\">" + object.description + "</td>" +
"</tr>"
);
};
return object;
}
function findRecipe(name) {
for (var i = 0; i < __recipebooks.length; i++) {
var recipe = __recipebooks[i].recipes[name];
if (recipe !== undefined) return recipe;
}
return undefined;
}
+1
View File
File diff suppressed because one or more lines are too long
+19
View File
@@ -0,0 +1,19 @@
.disabled { color: gray; }
.centered { text-align: center; }
.error { color: red; display: none; font-weight: bold; width: 100%; }
.hidden { display: none; }
.padded { margin: 10px; }
body { background: url("../images/ice.png"); margin-bottom: 100px; }
h1 { font-family: 'Press Start 2P', cursive; margin-left: 10px; }
h1 img { height: 64px; width: 64px; vertical-align: bottom; }
p { margin-left: 10px; margin-right: 10px; }
#body { background: rgba(230, 230, 230, 0.90); box-shadow: 10px 10px 20px #666; margin-top: 50px; }
#header { background: url("../images/stone_brick_light.png"); height: 64px; }
#header img { height: 96px; width: 96px; margin-left: -32px; margin-top: -32px; }
#header_border { background: url("../images/stone_brick.png"); height: 32px; margin-bottom: 32px; }
#recipebook_load_button { margin-left: 5px; width: 60px; }
#recipebook_table { margin-left: 10px; width: 920px; }
#recipebook_table td { background: #f8f8f8; border-left: 1px solid #bbb; padding: 10px; }
#recipebook_url { width: 600px; }
+1
View File
@@ -0,0 +1 @@
a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,meter,nav,object,ol,output,p,pre,progress,q,rp,rt,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video,xmp{border:0;margin:0;padding:0;font-size:100%}html,body{height:100%}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}b,strong{font-weight:bold}img{color:transparent;font-size:0;vertical-align:middle;-ms-interpolation-mode:bicubic}ol,ul{list-style:none}li{display:list-item}table{border-collapse:collapse;border-spacing:0}th,td,caption{font-weight:normal;vertical-align:top;text-align:left}q{quotes:none}q:before,q:after{content:'';content:none}sub,sup,small{font-size:75%}sub,sup{line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}svg{overflow:hidden}
+1
View File
@@ -0,0 +1 @@
body{font:13px/1.5 'Helvetica Neue',Arial,'Liberation Sans',FreeSans,sans-serif}pre,code{font-family:'DejaVu Sans Mono',Menlo,Consolas,monospace}hr{border:0 #ccc solid;border-top-width:1px;clear:both;height:0}h1{font-size:25px}h2{font-size:23px}h3{font-size:21px}h4{font-size:19px}h5{font-size:17px}h6{font-size:15px}ol{list-style:decimal}ul{list-style:disc}li{margin-left:30px}p,dl,hr,h1,h2,h3,h4,h5,h6,ol,ul,pre,table,address,fieldset,figure{margin-bottom:20px}
+140
View File
@@ -0,0 +1,140 @@
{
"name": "BuildCraft",
"description": "Crafting recipes from BuildCraft 3, by SpaceToad",
"recipes": [
{
"output": [[1, "Wooden Pipe"]],
"input": [[2, "Oak Plank"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Cobblestone Pipe"]],
"input": [[2, "Cobblestone"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Stone Pipe"]],
"input": [[2, "Stone"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Iron Pipe"]],
"input": [[2, "Iron Ingot"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Gold Pipe"]],
"input": [[2, "Gold Ingot"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Diamond Pipe"]],
"input": [[2, "Diamond"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Obsidian Pipe"]],
"input": [[2, "Obsidian"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Sandstone Pipe"]],
"input": [[2, "Sandstone"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Emerald Pipe"]],
"input": [[2, "Emerald"], [1, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Wooden Conductive Pipe"]],
"input": [[1, "Wooden Pipe"], [1, "Redstone"]],
"tools": []
}, {
"output": [[1, "Cobblestone Conductive Pipe"]],
"input": [[1, "Cobblestone Pipe"], [1, "Redstone"]],
"tools": []
}, {
"output": [[1, "Stone Conductive Pipe"]],
"input": [[1, "Stone Pipe"], [1, "Redstone"]],
"tools": []
}, {
"output": [[1, "Gold Conductive Pipe"]],
"input": [[1, "Gold Pipe"], [1, "Redstone"]],
"tools": []
}, {
"output": [[1, "Diamond Conductive Pipe"]],
"input": [[1, "Diamond Pipe"], [1, "Redstone"]],
"tools": []
}, {
"output": [[1, "Stripe Pipe"]],
"input": [[1, "Ink Sac"], [1, "Glass"], [1, "Dandelion Yellow"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Void Pipe"]],
"input": [[1, "Ink Sac"], [1, "Glass"], [1, "Redstone"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Structure Pipe"]],
"input": [[1, "Cobblestone Pipe"], [1, "Gravel"]],
"tools": []
}, {
"output": [[1, "Wooden Gear"]],
"input": [[4, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Cobblestone Gear"]],
"input": [[1, "Wooden Gear"], [4, "Cobblestone"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Iron Gear"]],
"input": [[1, "Cobblestone Gear"], [4, "Iron Ingot"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Gold Gear"]],
"input": [[1, "Iron Gear"], [4, "Gold Ingot"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Diamond Gear"]],
"input": [[1, "Gold Gear"], [4, "Diamond"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Mining Well"]],
"input": [[6, "Iron Ingot"], [1, "Iron Gear"], [1, "Iron Pickaxe"], [1, "Redstone"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Tank"]],
"input": [[8, "Glass"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Pump"]],
"input": [[6, "Mining Well"], [1, "Tank"]],
"tools": []
}, {
"output": [[1, "Landmark"]],
"input": [[1, "Redstone Torch"], [1, "Lapis Lazuli"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Redstone Engine"]],
"input": [[3, "Oak Plank"], [2, "Wooden Gear"], [1, "Glass"], [1, "Piston"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Stirling Engine"]],
"input": [[3, "Cobblestone"], [2, "Cobblestone Gear"], [1, "Glass"], [1, "Piston"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Combustion Engine"]],
"input": [[3, "Iron Ingot"], [2, "Iron Gear"], [1, "Glass"], [1, "Piston"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Chute"]],
"input": [[5, "Iron Ingot"], [1, "Cobblestone Gear"], [1, "Chest"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Quarry"]],
"input": [[3, "Iron Gear"], [2, "Gold Gear"], [2, "Diamond Gear"], [1, "Diamond Pickaxe"], [1, "Redstone"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Automatic Crafting Table"]],
"input": [[4, "Wooden Gear"], [1, "Crafting Table"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Filler"]],
"input": [[2, "Dandelion Yellow"], [2, "Ink Sac"], [1, "Landmark"], [1, "Chest"], [1, "Crafting Table"], [2, "Gold Gear"]],
"tools": ["Crafting Table"]
}
]
}
+250 -9
View File
@@ -1,24 +1,161 @@
{ {
"name": "Vanilla Recipes",
"description": "Crafting recipes from vanilla Minecraft",
"recipes": [ "recipes": [
{ {
"output": [[1, "Baked Potato"]],
"input": [[1, "Potato"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Boat"]], "output": [[1, "Boat"]],
"input": [[5, "Oak Plank"]], "input": [[5, "Oak Plank"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, {
"output": [[3, "Bone Meal"]],
"input": [[1, "Bone"]],
"tools": []
}, {
"output": [[1, "Book"]],
"input": [[1, "Leather"], [3, "Paper"]],
"tools": []
}, {
"output": [[1, "Bookshelf"]],
"input": [[6, "Oak Plank"], [3, "Book"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Bowl"]],
"input": [[3, "Oak Plank"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Bread"]],
"input": [[3, "Wheat"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Brick"]],
"input": [[1, "Clay"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Bucket"]],
"input": [[3, "Iron Ingot"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Cactus Green"]],
"input": [[1, "Cactus"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Cake"]],
"input": [[3, "Milk"], [2, "Sugar"], [3, "Wheat"], [1, "Egg"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Chest"]],
"input": [[8, "Oak Plank"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Cooked Chicken"]],
"input": [[1, "Raw Chicken"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Cooked Fish"]],
"input": [[1, "Raw Fish"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Cooked Porkchop"]],
"input": [[1, "Raw Porkchop"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Cookie"]],
"input": [[1, "Cocoa Beans"], [2, "Wheat"]],
"tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Crafting Table"]], "output": [[1, "Crafting Table"]],
"input": [[4, "Oak Plank"]], "input": [[4, "Oak Plank"]],
"tools": [] "tools": []
}, {
"output": [[2, "Cyan Dye"]],
"input": [[1, "Cactus Green"], [1, "Lapis Lazuli"]],
"tools": []
}, {
"output": [[2, "Dandelion Yellow"]],
"input": [[1, "Dandelion"]],
"tools": []
}, {
"output": [[1, "Diamond Axe"]],
"input": [[3, "Diamond"], [2, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Diamond Hoe"]],
"input": [[2, "Diamond"], [2, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Diamond Pickaxe"]],
"input": [[3, "Diamond"], [2, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Diamond Sword"]],
"input": [[2, "Diamond"], [1, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Eye of Ender"]],
"input": [[1, "Ender Pearl"], [1, "Blaze Powder"]],
"tools": []
}, {
"output": [[1, "Fermented Spider Eye"]],
"input": [[1, "Spider Eye"], [1, "Brown Mushroom"], [1, "Sugar"]],
"tools": []
}, { }, {
"output": [[1, "Furnace"]], "output": [[1, "Furnace"]],
"input": [[8, "Cobblestone"]], "input": [[8, "Cobblestone"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Iron Ingot"]], "output": [[1, "Glass"]],
"input": [[1, "Iron Ore"], [1, "Furnace Fuel"]], "input": [[1, "Sand"], [125, "milli-coal"]],
"tools": ["Furnace"] "tools": ["Furnace"]
}, { }, {
"output": [[1, "Iron Ax"]], "output": [[3, "Glass Bottle"]],
"input": [[3, "Glass"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Glistering Melon"]],
"input": [[1, "Melon"], [9, "Gold Nugget"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Gold Axe"]],
"input": [[3, "Gold Ingot"], [2, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Gold Hoe"]],
"input": [[2, "Gold Ingot"], [2, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Gold Ingot"]],
"input": [[1, "Gold Ore"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[9, "Gold Nugget"]],
"input": [[1, "Gold Ingot"]],
"tools": []
}, {
"output": [[1, "Gold Pickaxe"]],
"input": [[3, "Gold Ingot"], [2, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Gold Sword"]],
"input": [[2, "Gold Ingot"], [1, "Stick"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Golden Apple"]],
"input": [[9, "Gold Ingot"], [1, "Apple"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Golden Carrot"]],
"input": [[8, "Gold Nugget"], [1, "Carrot"]],
"tools": ["Crafting Table"]
}, {
"output": [[2, "Gray Dye"]],
"input": [[1, "Bone Meal"], [1, "Ink Sac"]],
"tools": []
}, {
"output": [[1, "Iron Axe"]],
"input": [[3, "Iron Ingot"], [2, "Stick"]], "input": [[3, "Iron Ingot"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
@@ -26,23 +163,127 @@
"input": [[2, "Iron Ingot"], [2, "Stick"]], "input": [[2, "Iron Ingot"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Iron Pick"]], "output": [[1, "Iron Ingot"]],
"input": [[1, "Iron Ore"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[9, "Iron Nugget"]],
"input": [[1, "Iron Ingot"]],
"tools": []
}, {
"output": [[1, "Iron Pickaxe"]],
"input": [[3, "Iron Ingot"], [2, "Stick"]], "input": [[3, "Iron Ingot"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Iron Sword"]], "output": [[1, "Iron Sword"]],
"input": [[2, "Iron Ingot"], [1, "Stick"]], "input": [[2, "Iron Ingot"], [1, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, {
"output": [[2, "Light Blue Dye"]],
"input": [[1, "Bone Meal"], [1, "Lapis Lazuli"]],
"tools": []
}, {
"output": [[3, "Light Gray Dye"]],
"input": [[2, "Bone Meal"], [1, "Ink Sac"]],
"tools": []
}, {
"output": [[2, "Light Gray Dye"]],
"input": [[1, "Bone Meal"], [1, "Gray Dye"]],
"tools": []
}, {
"output": [[2, "Lime Dye"]],
"input": [[1, "Bone Meal"], [1, "Cactus Green"]],
"tools": []
}, {
"output": [[2, "Magenta Dye"]],
"input": [[1, "Pink Dye"], [1, "Purple Dye"]],
"tools": []
}, {
"output": [[3, "Magenta Dye"]],
"input": [[1, "Rose Red"], [1, "Pink Dye"], [1, "Lapis Lazuli"]],
"tools": []
}, {
"output": [[4, "Magenta Dye"]],
"input": [[2, "Rose Red"], [1, "Bone Meal"], [1, "Lapis Lazuli"]],
"tools": []
}, {
"output": [[1, "Magma Cream"]],
"input": [[1, "Slimeball"], [1, "Blaze Powder"]],
"tools": []
}, {
"output": [[1, "Milk"]],
"input": [[1, "Bucket"]],
"tools": ["Cow"]
}, {
"output": [[1, "Mushroom Stew"]],
"input": [[1, "Bowl"], [1, "Red Mushroom"], [1, "Brown Mushroom"]],
"tools": []
}, {
"output": [[1, "Nether Brick (item)"]],
"input": [[1, "Netherrack"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Nether Brick (block)"]],
"input": [[4, "Nether Brick (item)"]],
"tools": []
}, { }, {
"output": [[4, "Oak Plank"]], "output": [[4, "Oak Plank"]],
"input": [[1, "Oak Log"]], "input": [[1, "Oak Log"]],
"tools": [] "tools": []
}, {
"output": [[2, "Orange Dye"]],
"input": [[1, "Dandelion Yellow"], [1, "Rose Red"]],
"tools": []
}, {
"output": [[3, "Paper"]],
"input": [[3, "Sugar Cane"]],
"tools": []
}, {
"output": [[2, "Pink Dye"]],
"input": [[1, "Bone Meal"], [1, "Rose Red"]],
"tools": []
}, {
"output": [[1, "Piston"]],
"input": [[4, "Cobblestone"], [3, "Oak Plank"], [1, "Iron Ingot"], [1, "Redstone"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Pumpkin Pie"]],
"input": [[1, "Sugar"], [1, "Pumpkin"], [1, "Egg"]],
"tools": []
}, {
"output": [[2, "Purple Dye"]],
"input": [[1, "Rose Red"], [1, "Lapis Lazuli"]],
"tools": []
}, {
"output": [[1, "Redstone Torch"]],
"input": [[1, "Redstone"], [1, "Stick"]],
"tools": []
}, {
"output": [[2, "Rose Red"]],
"input": [[1, "Rose"]],
"tools": []
}, {
"output": [[1, "Steak"]],
"input": [[1, "Raw Beef"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, { }, {
"output": [[4, "Stick"]], "output": [[4, "Stick"]],
"input": [[2, "Oak Plank"]], "input": [[2, "Oak Plank"]],
"tools": [] "tools": []
}, { }, {
"output": [[1, "Stone Ax"]], "output": [[1, "Sticky Piston"]],
"input": [[1, "Piston"], [1, "Slimeball"]],
"tools": []
}, {
"output": [[1, "Sugar"]],
"input": [[1, "Sugar Cane"]],
"tools": []
}, {
"output": [[1, "Stone"]],
"input": [[1, "Cobblestone"], [125, "milli-coal"]],
"tools": ["Furnace"]
}, {
"output": [[1, "Stone Axe"]],
"input": [[3, "Cobblestone"], [2, "Stick"]], "input": [[3, "Cobblestone"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
@@ -50,7 +291,7 @@
"input": [[2, "Cobblestone"], [2, "Stick"]], "input": [[2, "Cobblestone"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Stone Pick"]], "output": [[1, "Stone Pickaxe"]],
"input": [[3, "Cobblestone"], [2, "Stick"]], "input": [[3, "Cobblestone"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
@@ -58,7 +299,7 @@
"input": [[2, "Cobblestone"], [1, "Stick"]], "input": [[2, "Cobblestone"], [1, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Wooden Ax"]], "output": [[1, "Wooden Axe"]],
"input": [[3, "Oak Plank"], [2, "Stick"]], "input": [[3, "Oak Plank"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
@@ -66,7 +307,7 @@
"input": [[2, "Oak Plank"], [2, "Stick"]], "input": [[2, "Oak Plank"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
"output": [[1, "Wooden Pick"]], "output": [[1, "Wooden Pickaxe"]],
"input": [[3, "Oak Plank"], [2, "Stick"]], "input": [[3, "Oak Plank"], [2, "Stick"]],
"tools": ["Crafting Table"] "tools": ["Crafting Table"]
}, { }, {
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 860 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

+39 -42
View File
@@ -1,53 +1,50 @@
<!doctype html5!> <!doctype html5!>
<html> <html>
<head> <head>
<style> <title>Crafting Guide</title>
.disabled { color: gray; } <link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Press+Start+2P'/>
#craft_button { margin-left: 10px; width: 90px; } <link rel="stylesheet" type="text/css" href="css/reset.css"/>
#crafting { display: none; } <link rel="stylesheet" type="text/css" href="css/text.css"/>
#crafting_error { color: red; display: none; font-weight: bold; width: 100%; } <link rel="stylesheet" type="text/css" href="css/960.css"/>
#crafting_output { display: none; } <link rel="stylesheet" type="text/css" href="css/main.css"/>
#item_to_craft { width: 540px; }
#load_error { color: red; display: none; font-weight: bold; width: 100%; }
#loaded_recipes { display: none; }
#recipe_url { width: 540px; }
#recipe_load_button { margin-left: 10px; width: 90px; }
div { margin-top: 50px; }
</style>
</head> </head>
<body>
<div id="recipes">
<h1>Recipes</h1>
<p>
<input id="recipe_url" placeholder="recipe URL"></input>
<button id="recipe_load_button">Load</button>
<p id="load_error"></p>
<div id="loaded_recipes">
<p>Loaded recipes:</p>
<ul></ul>
</div>
</p>
</div>
<div id="crafting"> <body class="container_12">
<h1>Crafting</h1> <div id="body" class="grid_12">
<select id="crafting_selector" disabled></select> <div id="header" class="grid_12 alpha omega">
<div id="crafting_output"> <h1><img src="images/workbench_front.png"> Crafting Guide</h1>
<p>You'll need:</p> </div> <!-- #header -->
<ul id="missing_materials"></ul> <div id="header_border" class="grid_12 alpha omega">&nbsp;</div>
<p>You'll get:</p>
<ul id="leftover_materials"></ul> <div id="recipebooks" class="grid_12 alpha omega">
</div> <h1><img src="images/bookshelf.png"> Recipe Books</h1>
<div id="crafting_error"></div> <table id="recipebook_table" cellpadding="0" cellspacing="0">
</div> <tr>
<td>&nbsp;</td>
<td>
<input id="recipebook_url" placeholder="load another recipebook..."></input>
<button id="recipebook_load_button">Load</button>
</td>
</tr>
</table>
<p id="load_error" class="error"></p>
</div> <!-- #recipe_books -->
<div id="crafting" class="hidden">
<h1>Crafting</h1>
<select id="crafting_selector" disabled></select>
<div id="crafting_output" class="hidden">
<p>You'll need:</p>
<ul id="missing_materials"></ul>
<p>You'll get:</p>
<ul id="leftover_materials"></ul>
</div>
<div id="crafting_error" class="error"></div>
</div> <!-- #crafting -->
</div> <!-- .container_12 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="crafting.js"></script> <script src="crafting.js"></script>
<script>
var __recipes = {};
var __inventory = {};
$(function() { onPageLoad() })
</script>
</body> </body>
</html> </html>