Skip to content

Commit

Permalink
Decorative Rocks in housing #399
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrim committed Feb 20, 2024
1 parent 1234b3a commit b757ea7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
20 changes: 10 additions & 10 deletions housing/construction.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -484,15 +484,15 @@ 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)
skill.name = skillName

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
Expand Down
17 changes: 17 additions & 0 deletions housing/itemList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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})
Expand Down
10 changes: 5 additions & 5 deletions item/builderstool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit b757ea7

Please sign in to comment.