Add explicit support for brutal handwork

This commit is contained in:
ZioPao
2024-03-24 22:30:04 +01:00
parent 93a00d1b48
commit 639841cf20
3 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
--* BRUTAL HANDS -- *
local function HandleModCompatibility()
if getActivatedMods():contains('BrutalHandwork') then
BrutalHands = BrutalHands or {}
BrutalHands.TOC = require("TOC/API")
-- Brutal hands has a TOC_COMPAT but its check is wrong and uses an old API.
end
end
Events.OnGameStart.Add(HandleModCompatibility)

View File

@@ -106,9 +106,31 @@ local function AddInvAmputationOptions(player, context, sawItem, stitchesItem, b
local subMenu = context:getNew(context)
context:addSubMenu(option, subMenu)
-- TODO Separate into groups
-- Amputate -> Top/Bottom - > Left/Right - > Limb
-- for i=1, #StaticData.PROSTHESES_GROUPS_STR do
-- local group = StaticData.PROSTHESES_GROUPS_STR[i]
-- for j=1, #StaticData.SIDES_IND_STR do
-- end
-- end
-- for k,v in pairs(StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR) do
-- TOC_DEBUG.print(k)
-- end
local dc = DataController.GetInstance()
for i = 1, #StaticData.LIMBS_STR do
local limbName = StaticData.LIMBS_STR[i]
if not DataController.GetInstance():getIsCut(limbName) then
if not dc:getIsCut(limbName) then
local limbTranslatedName = getText("ContextMenu_Limb_" .. limbName)
subMenu:addOption(limbTranslatedName, player, PerformAction, player, limbName, sawItem, stitchesItem, bandageItem)
end