diff --git a/housing/construction.lua b/housing/construction.lua index 12393d0b3..32144b83f 100644 --- a/housing/construction.lua +++ b/housing/construction.lua @@ -46,11 +46,11 @@ local function loadIngredients(object) return ingredients, remnants end -local function showObject(user, object, category, skill, carpentryEstateCatalogue) +local function showObject(user, object, category, skill, overloaded) - if carpentryEstateCatalogue ~= nil - and ((carpentryEstateCatalogue and object.typeOf ~= "Estate") - or (not carpentryEstateCatalogue and object.typeOf == "Estate")) + if overloaded ~= nil + and ((overloaded and object.typeOf ~= "Estate") + or (not overloaded and object.typeOf == "Estate")) then return false end @@ -63,8 +63,8 @@ local function showObject(user, object, category, skill, carpentryEstateCatalogu return false end -local function loadObjects(user, products, index, object, category, skill, carpentryEstateCatalogue) - if showObject(user, object, category, skill, carpentryEstateCatalogue) then +local function loadObjects(user, products, index, object, category, skill, overloaded) + if showObject(user, object, category, skill, overloaded) then local ingredients, remnants = loadIngredients(object) local id, tile if object.itemId then @@ -81,7 +81,7 @@ local function loadObjects(user, products, index, object, category, skill, carpe return false end -local function loadProducts(user, categories, skill, carpentryEstateCatalogue) +local function loadProducts(user, categories, skill, overloaded) local products = {} for index, category in ipairs(categories) do local theList = itemList.items @@ -90,7 +90,7 @@ local function loadProducts(user, categories, skill, carpentryEstateCatalogue) end for _, object in ipairs(theList) do - if loadObjects(user, products, index, object, category, skill, carpentryEstateCatalogue) then + if loadObjects(user, products, index, object, category, skill, overloaded) then category.productAmount = category.productAmount + 1 end end @@ -484,7 +484,7 @@ local function multiSkillsThatAreCountedAsOne(user, skill, productLevel, hasSkil end -function M.showDialog(user, skillName, carpentryEstateCatalogue) +function M.showDialog(user, skillName, overloaded) local skill = {} skill.level = loadSkill(user, skillName) @@ -492,7 +492,7 @@ function M.showDialog(user, skillName, carpentryEstateCatalogue) local categories = loadCategories(user, skill) - local products = loadProducts(user, categories, skill, carpentryEstateCatalogue) + local products = loadProducts(user, categories, skill, overloaded) if not utility.allowBuilding(user) then return diff --git a/housing/itemList.lua b/housing/itemList.lua index e551ddf55..65764203c 100644 --- a/housing/itemList.lua +++ b/housing/itemList.lua @@ -1039,6 +1039,22 @@ table.insert(M.items, {itemId = 3985, typeOf = "Estate", category = "Walls", nam table.insert(M.items, {itemId = 3986, typeOf = "Estate", category = "Walls", nameDe = "Bruchsteinpfeiler - Norden", nameEn = "Drystone Pillar North", skill = "mining", level = 40, ingredient1 = 733, ingredient1Amount = 10, ingredient2 = 26, ingredient2Amount = 5, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) table.insert(M.items, {itemId = 3987, typeOf = "Estate", category = "Walls", nameDe = "Bruchsteinpfeiler - Osten", nameEn = "Drystone Pillar East", skill = "mining", level = 40, ingredient1 = 733, ingredient1Amount = 10, ingredient2 = 26, ingredient2Amount = 5, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) table.insert(M.items, {itemId = 3988, typeOf = "Estate", category = "Walls", nameDe = "Bruchsteinpfeiler - Mitte", nameEn = "Drystone Pillar Central", skill = "mining", level = 40, ingredient1 = 733, ingredient1Amount = 10, ingredient2 = 26, ingredient2Amount = 5, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1196, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 40, ingredient1 = 735, ingredient1Amount = 20, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1197, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 60, ingredient1 = 735, ingredient1Amount = 80, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1245, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1246, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1247, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1250, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1251, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1254, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1257, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1273, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1276, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1278, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 20, ingredient1 = 735, ingredient1Amount = 10, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1265, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 10, ingredient1 = 735, ingredient1Amount = 5, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) +table.insert(M.items, {itemId = 1272, typeOf = "Estate", category = "Decorative Rocks", skill = "mining", level = 10, ingredient1 = 735, ingredient1Amount = 5, ingredient2 = nil, ingredient2Amount = nil, ingredient3 = nil, ingredient3Amount = nil, ingredient4 = nil, ingredient4Amount = nil}) + + M.tiles = {} table.insert(M.tiles, {displayId = Item.parquet , tileId = 40, typeOf = "House", category = "Parquet", skill = "carpentry", level = 0, ingredient1 = 2716, ingredient1Amount = 25}) @@ -1099,6 +1115,7 @@ table.insert(M.categories, {categoryEn = "Columns", categoryDe = "S table.insert(M.categories, {categoryEn = "Roof", categoryDe = "Dach", Estate = true}) table.insert(M.categories, {categoryEn = "Stairs", categoryDe = "Treppe", Estate = true}) table.insert(M.categories, {categoryEn = "Walls", categoryDe = "Mauern", Estate = true}) +table.insert(M.categories, {categoryEn = "Decorative Rocks", categoryDe = "GERMAN TRANSLATION", Estate = true}) table.insert(M.categories, {categoryEn = "Windows", categoryDe = "Fenster", Estate = true}) table.insert(M.categories, {categoryEn = "Fences", categoryDe = "Zäune", Estate = true}) table.insert(M.categories, {categoryEn = "Gates", categoryDe = "Tore", Estate = true}) diff --git a/item/builderstool.lua b/item/builderstool.lua index 16447bcca..770b490dc 100644 --- a/item/builderstool.lua +++ b/item/builderstool.lua @@ -22,7 +22,7 @@ local common = require("base.common") local M = {} -local function carpentrySelection(user) +local function overloadedSelection(user, skill) local callback = function(dialog) local success = dialog:getSuccess() @@ -34,9 +34,9 @@ local function carpentrySelection(user) local index = dialog:getSelectedIndex()+1 if index == 1 then - construction.showDialog(user, "carpentry", false) + construction.showDialog(user, skill, false) else - construction.showDialog(user, "carpentry", true) + construction.showDialog(user, skill, true) end end @@ -56,8 +56,8 @@ local function craftSelection(user) local success = dialog:getSuccess() if success then local index = dialog:getSelectedIndex()+1 - if skills[index].name == "carpentry" and utility.checkIfEstate(user) then - carpentrySelection(user) + if (skills[index].name == "carpentry" or skills[index].name == "mining") and utility.checkIfEstate(user) then --Carpentry and mining have too many items to display in one crafting menu alone, so they are separated into estate and shell housing categories + overloadedSelection(user, skills[index].name) else construction.showDialog(user, skills[index].name, nil) end