42 lines
942 B
C#
Executable file
42 lines
942 B
C#
Executable file
using AutoDropBedding;
|
|
|
|
namespace XRL.World.Parts
|
|
{
|
|
public class AutoDropBeddingMenu : IPart
|
|
{
|
|
private static string NAME = "SetUpBedroll";
|
|
|
|
public override bool WantEvent(int ID, int cascade) =>
|
|
ID == InventoryActionEvent.ID ||
|
|
ID == GetCookingActionsEvent.ID ||
|
|
base.WantEvent(ID, cascade);
|
|
|
|
public override bool HandleEvent(GetCookingActionsEvent E)
|
|
{
|
|
if (Config.AddMenuOptionToCamp && Helpers.HasBedroll())
|
|
{
|
|
Helpers.Log("Adding menu option.");
|
|
E.AddAction(NAME,
|
|
"Lay out bedding",
|
|
NAME,
|
|
Key: 'b',
|
|
Default: 0,
|
|
Priority: 200);
|
|
}
|
|
|
|
return base.HandleEvent(E);
|
|
}
|
|
|
|
public override bool HandleEvent(InventoryActionEvent E)
|
|
{
|
|
if (E.Command == NAME)
|
|
{
|
|
Helpers.Log("Got setup bed command.");
|
|
Helpers.PutDownBedroll(campfireCell: E.CellTarget);
|
|
E.RequestInterfaceExit();
|
|
}
|
|
return base.HandleEvent(E);
|
|
}
|
|
}
|
|
}
|