Project Zomboid

Project Zomboid

評價次數不足
Metalwelding Build Menu Compatibility
由 Tchernobill 發表
Most mods adding options to the Metalwelding menu override the whole menu.
This prevents mods compatibility.

Below is a snippet to use by any mod to achieve compatibility.
   
獎勵
加入最愛
已加入最愛
移除最愛
Snippet
--override the name of that function local myModdedFunctionToAddOptionToMetalWeldingMenu = function(subMenuMW, player) --add here your own options --see Build Roof mod for a full exemple link below end local myModdedMetalWeldingCallback = function(player, context, worldobjects, test) if test or not context then return end local buildMWOption = context:getOptionFromName(getText("ContextMenu_MetalWelding")) if not buildMWOption then return end local subMenuMW = context:getSubMenu(buildMWOption.subOption) if subMenuMW then myModdedFunctionToAddOptionToMetalWeldingMenu(subMenuMW, player)--override the name of that function end end Events.OnFillWorldObjectContextMenu.Add(myModdedMetalWeldingCallback);

e.g. see exemple mod under BuildRoof/media/lua/client/CBuildMetalRoof.lua