Module talk:Items

Intro
I did a lot more editing on this than I intended due to:
 * The code using the for loop to iterate data modules was getting complex to control the formatting. Was ending up with a lot of "if this, then that" blocks.
 * I noticed pairs used a lot since we were dealing with key/values. Unfortunately pairs ordering is undefined and can change per execution.
 * Added a bunch of comments hopefully to explain my thought process and the sequence.
 * Also since different editors will put numbers as either 11,00 or 11.00; I added code to format the numbers according to locale and it changes to a dot for US. Will need to test to make sure it retains the comma for non-US. This way, it won't matter the decimal format. This is only for "Weight" currently.
 * Order of keys is forced using "data_key_order" tables, otherwise the order would be undefined so could change. This is for display consistency.
 * I renamed the headers but retained the original links to Crafted, Equipment, etc. Specifically, I was trying to imply a relationship between "Recipes" and "Recipe Bonus Stats" - not sure if everyone will understand the layout.

Changes
Kellewic (talk) 02:55, 8 July 2020 (UTC)
 * Module:Items/Data
 * Removed the data_modules key.
 * There's a function Module:Items.getModuleData that pulls item data from each module. If there's nothing in a data module for the item, it returns nil. These are then processed in a specific order so they show up in the table in the order we want.
 * Module:Items/Data/Crafted
 * Removed the "Recipe X" keys due to pairs vs ipairs ordering. ["Materials Needed"] is now a list and the order in the data table is the order they will appear in the display. Within each list entry, the materials are also a list iterated using ipairs so they will also appear in data module order.
 * Module:Items/Data/Equipment
 * Removed the "Recipe X" keys for the same reason stated above. Also added in empty tables for recipes that give no stat bonuses. These are treated special inside the code to display "None".