Fancy Verb Menu & Verb API Refactor (#928)
This commit is contained in:
committed by
GitHub
parent
4527fc9e84
commit
cad59d2cb4
@@ -328,16 +328,9 @@ namespace Content.Server.GameObjects.Components
|
||||
[Verb]
|
||||
private sealed class LockToggleVerb : Verb<EntityStorageComponent>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override string GetText(IEntity user, EntityStorageComponent component)
|
||||
protected override void GetData(IEntity user, EntityStorageComponent component, VerbData data)
|
||||
{
|
||||
return component._locked ? "Unlock" : "Lock";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override VerbVisibility GetVisibility(IEntity user, EntityStorageComponent component)
|
||||
{
|
||||
return VerbVisibility.Visible;
|
||||
data.Text = component._locked ? "Unlock" : "Lock";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -350,16 +343,15 @@ namespace Content.Server.GameObjects.Components
|
||||
[Verb]
|
||||
private sealed class OpenToggleVerb : Verb<EntityStorageComponent>
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override string GetText(IEntity user, EntityStorageComponent component)
|
||||
protected override void GetData(IEntity user, EntityStorageComponent component, VerbData data)
|
||||
{
|
||||
return component.Open ? "Close" : "Open";
|
||||
}
|
||||
if (component.NoDoor)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
return;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override VerbVisibility GetVisibility(IEntity user, EntityStorageComponent component)
|
||||
{
|
||||
return component.NoDoor ? VerbVisibility.Invisible : VerbVisibility.Visible;
|
||||
data.Text = component.Open ? "Close" : "Open";
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user