Add explicit support for brutal handwork
This commit is contained in:
15
media/lua/client/TOC/Compat.lua
Normal file
15
media/lua/client/TOC/Compat.lua
Normal 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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,6 +29,9 @@ StaticData.SIDES_IND_STR = {
|
||||
R = "R",
|
||||
L = "L"
|
||||
}
|
||||
StaticData.SIDES_STR = {
|
||||
"R", "L"
|
||||
}
|
||||
StaticData.PARTS_IND_STR = {
|
||||
Hand = "Hand",
|
||||
ForeArm = "ForeArm",
|
||||
|
||||
Reference in New Issue
Block a user