wire panel now opens when a wire tool is used (#3200)
This commit is contained in:
@@ -397,7 +397,7 @@ namespace Content.Server.GameObjects.Components.Doors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.Action == Mend)
|
else if (args.Action == Mend)
|
||||||
{
|
{
|
||||||
switch (args.Identifier)
|
switch (args.Identifier)
|
||||||
{
|
{
|
||||||
@@ -420,7 +420,7 @@ namespace Content.Server.GameObjects.Components.Doors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.Action == Cut)
|
else if (args.Action == Cut)
|
||||||
{
|
{
|
||||||
switch (args.Identifier)
|
switch (args.Identifier)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -482,10 +482,25 @@ namespace Content.Server.GameObjects.Components
|
|||||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||||
{
|
{
|
||||||
if (!eventArgs.Using.TryGetComponent<ToolComponent>(out var tool))
|
if (!eventArgs.Using.TryGetComponent<ToolComponent>(out var tool))
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
if (!await tool.UseTool(eventArgs.User, Owner, 0.5f, ToolQuality.Screwing))
|
}
|
||||||
return false;
|
|
||||||
|
|
||||||
|
// opens the wires ui if using a tool with cutting or multitool quality on it
|
||||||
|
if (IsPanelOpen &&
|
||||||
|
(tool.HasQuality(ToolQuality.Cutting) ||
|
||||||
|
tool.HasQuality(ToolQuality.Multitool)))
|
||||||
|
{
|
||||||
|
if (eventArgs.User.TryGetComponent(out IActorComponent? actor))
|
||||||
|
{
|
||||||
|
OpenInterface(actor.playerSession);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// screws the panel open if the tool can do so
|
||||||
|
else if (await tool.UseTool(eventArgs.User, Owner, 0.5f, ToolQuality.Screwing))
|
||||||
|
{
|
||||||
IsPanelOpen = !IsPanelOpen;
|
IsPanelOpen = !IsPanelOpen;
|
||||||
EntitySystem.Get<AudioSystem>()
|
EntitySystem.Get<AudioSystem>()
|
||||||
.PlayFromEntity(IsPanelOpen ? "/Audio/Machines/screwdriveropen.ogg" : "/Audio/Machines/screwdriverclose.ogg",
|
.PlayFromEntity(IsPanelOpen ? "/Audio/Machines/screwdriveropen.ogg" : "/Audio/Machines/screwdriverclose.ogg",
|
||||||
@@ -493,6 +508,9 @@ namespace Content.Server.GameObjects.Components
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString(IsPanelOpen
|
message.AddMarkup(Loc.GetString(IsPanelOpen
|
||||||
|
|||||||
Reference in New Issue
Block a user