Skip to content

Commit

Permalink
Inclusion of jewellery equipment slots in selections of glyphed items…
Browse files Browse the repository at this point in the history
…, amendment of german translation necessary #392
  • Loading branch information
brightrim committed Oct 5, 2024
1 parent 16fab34 commit 9fd92eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
6 changes: 3 additions & 3 deletions magic/arcane/enchanting/core/glyphed_item_into_shards.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ function M.start(user, actionstate)
return
end

local jewelleryList = shared.listGlyphedJewelleryAtBelt(user)
local jewelleryList = shared.listGlyphedJewelleryAtBeltAndJewellerySlots(user)

if #jewelleryList == 0 then
user:inform("Du musst mit einer Glyphe versehenen Schmuck in deinem Gürtel haben, wenn du eine Glyphe aus dem Schmuckstück entfernen willst. Deine Fertigkeit im Glyphenschmieden muss ausreichen, um die Glyphe herstellen zu können.",
"You need to have a glyphed piece of jewellery that you are skilled enough to craft the glyph of in a belt slot if you want to remove a glyph from one.")
user:inform("Du musst mit einer Glyphe versehenen Schmuck in deinem Gürtel GERMAN TRANSLATION AMENDMENT NEEDED haben, wenn du eine Glyphe aus dem Schmuckstück entfernen willst. Deine Fertigkeit im Glyphenschmieden muss ausreichen, um die Glyphe herstellen zu können.",
"You need to have a glyphed piece of jewellery that you are skilled enough to craft the glyph of in a belt slot or equipped if you want to remove a glyph from one.")
return
end

Expand Down
4 changes: 2 additions & 2 deletions magic/arcane/enchanting/core/inspection_of_glyphed_item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ end

function M.start(user)

local jewelleryAtBelt = shared.listGlyphedJewelleryAtBelt(user, true)
local jewelleryAtBelt = shared.listGlyphedJewelleryAtBeltAndJewellerySlots(user, true)

if #jewelleryAtBelt == 0 then
user:inform("Das Schmuckstück muss an deinem Gürtel sein, um es untersuchen zu können.", "The piece of enchanted jewellery needs to be in a belt slot if you want to inspect it.")
user:inform("Das Schmuckstück muss an deinem Gürtel GERMAN TRANSLATION AMENDMENT NEEDED sein, um es untersuchen zu können.", "The piece of enchanted jewellery needs to be in a belt slot or equipped if you want to inspect it.")
return
end

Expand Down
26 changes: 20 additions & 6 deletions magic/arcane/enchanting/core/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ end

local belt = {Character.belt_pos_1, Character.belt_pos_2, Character.belt_pos_3, Character.belt_pos_4, Character.belt_pos_5, Character.belt_pos_6}

local jewellerySlots = {Character.neck, Character.finger_left_hand, Character.finger_right_hand}

function M.listGlyphsAtBelt(user)

local retList = {}
Expand All @@ -386,17 +388,29 @@ function M.listGlyphsAtBelt(user)

end

function M.listGlyphedJewelleryAtBelt(user, inspection)
local function checkSlotForGlyphedItem(user, theSlot, inspection, retList)

local theItem = user:getItemAt(theSlot)

local glyphCharges = theItem:getData("glyphCharges")

if not common.IsNilOrEmpty(glyphCharges) and (M.userSkillMatchesItem(user, theItem) or inspection) then --The item is glyphed and user is high enough level or just inspecting
table.insert(retList, theItem)
end

return retList
end

function M.listGlyphedJewelleryAtBeltAndJewellerySlots(user, inspection)

local retList = {}

for _, beltSlot in pairs(belt) do
local beltItem = user:getItemAt(beltSlot)
local glyphCharges = beltItem:getData("glyphCharges")
retList = checkSlotForGlyphedItem(user, beltSlot, inspection, retList)
end

if not common.IsNilOrEmpty(glyphCharges) and (M.userSkillMatchesItem(user, beltItem) or inspection) then --The item is glyphed and user is high enough level or just inspecting
table.insert(retList, beltItem)
end
for _, jewellerySlot in pairs(jewellerySlots) do
retList = checkSlotForGlyphedItem(user, jewellerySlot, inspection, retList)
end

return retList
Expand Down

0 comments on commit 9fd92eb

Please sign in to comment.