Bearbeiten von „Modul:CraftingParser“
Aus Eco - Deutsches Wiki
Deine Änderungen werden angezeigt, sobald ein dazu berechtigter Benutzer sie akzeptiert hat. (Hilfe)
Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.
Aktuelle Version | Dein Text | ||
Zeile 1: | Zeile 1: | ||
-- | -- Modul:CraftingParser (https://wiki.play.eco/en/Modul:CraftingParser) | ||
local p = {} | local p = {} | ||
local Utils = require(' | local Utils = require('Modul:Utils') | ||
local L = require(' | local L = require('Modul:Localization') | ||
-- Compares two recipes ( a < b ? true : false ) | -- Compares two recipes ( a < b ? true : false ) | ||
Zeile 80: | Zeile 80: | ||
-- Called from Template:RecipeTable | -- Called from Template:RecipeTable | ||
-- Calls | -- Calls Modul:RecipeTable | ||
-- Returns the wikitext returned by | -- Returns the wikitext returned by Modul:RecipeTable | ||
function p.raw( f ) | function p.raw( f ) | ||
-- get args from the Template, parse them into recipes | -- get args from the Template, parse them into recipes | ||
Zeile 90: | Zeile 90: | ||
-- Call RecipeTable | -- Call RecipeTable | ||
local recipeTable = require( " | local recipeTable = require( "Modul:RecipeTable" ) | ||
return recipeTable.main( recipes ) | return recipeTable.main( recipes ) | ||
end | end | ||
-- Called from | -- Called from Modul:GetRecipes | ||
-- Calls | -- Calls Modul:RecipeTable | ||
-- Returns the wikitext returned by | -- Returns the wikitext returned by Modul:RecipeTable | ||
function p.formattedItem( products, ingredients, item ) | function p.formattedItem( products, ingredients, item ) | ||
-- Format the recipes, and call RecipeTable on each table | -- Format the recipes, and call RecipeTable on each table | ||
local recipeTable = require( " | local recipeTable = require( "Modul:RecipeTable" ) | ||
local returnVal = '=== '..L.t('Crafting Recipes')..' ===\n\n' | local returnVal = '=== '..L.t('Crafting Recipes')..' ===\n\n' | ||
Zeile 119: | Zeile 119: | ||
-- Called from | -- Called from Modul:GetRecipes | ||
-- Calls | -- Calls Modul:RecipeTable | ||
-- Returns formatted wikitext, including wikitext returned from | -- Returns formatted wikitext, including wikitext returned from Modul:RecipeTable | ||
function p.formattedTable( recipes, table ) | function p.formattedTable( recipes, table ) | ||
-- Format the recipes, and call RecipeTable | -- Format the recipes, and call RecipeTable | ||
local recipeTable = require( " | local recipeTable = require( "Modul:RecipeTable" ) | ||
local returnVal = '=== ' .. L.t('Recipes at %s'):format(table) .. ' ===\n\n' | local returnVal = '=== ' .. L.t('Recipes at %s'):format(table) .. ' ===\n\n' | ||
if #recipes == 0 then | if #recipes == 0 then | ||
Zeile 136: | Zeile 136: | ||
-- Called from | -- Called from Modul:GetRecipes | ||
-- Calls | -- Calls Modul:RecipeTable | ||
-- Returns formatted wikitext, including wikitext returned from | -- Returns formatted wikitext, including wikitext returned from Modul:RecipeTable | ||
function p.formattedGroup( recipes, group ) | function p.formattedGroup( recipes, group ) | ||
-- Format the recipes, and call RecipeTable | -- Format the recipes, and call RecipeTable | ||
local recipeTable = require( " | local recipeTable = require( "Modul:RecipeTable" ) | ||
local returnVal = '=== ' .. L.t('%s Recipes'):format(group) .. ' ===\n\n' | local returnVal = '=== ' .. L.t('%s Recipes'):format(group) .. ' ===\n\n' | ||
if #recipes == 0 then | if #recipes == 0 then |