Add Alt-click functionality (#4497)
* Fix ItemSlot Bug * Add Alt-use Key * Fix TransferAmount window bug * Alt-click functionality * Added AltInteract verbs * Add new verbs * verb icons * Changed Comments * Change Comments * Fix disposal verbs * Changed Get...() to Get...OrNull() * Changed alt-interact combat behaviour * Update verb icons * Inventory interact event * Add Alt+E secondary binding * Add alt-z keybinding * Rename AltUse -> AltActivateItemInWorld
This commit is contained in:
@@ -207,7 +207,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("self-insert-verb-get-data-text");
|
||||
data.Text = Loc.GetString("disposal-self-insert-verb-get-data-text");
|
||||
}
|
||||
|
||||
protected override void Activate(IEntity user, DisposalUnitComponent component)
|
||||
@@ -230,8 +230,8 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
}
|
||||
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
data.Text = Loc.GetString("flush-verb-get-data-text");
|
||||
data.IconTexture = "/Textures/Interface/VerbIcons/eject.svg.192dpi.png";
|
||||
data.Text = Loc.GetString("disposal-flush-verb-get-data-text");
|
||||
data.IconTexture = "/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png";
|
||||
}
|
||||
|
||||
protected override void Activate(IEntity user, DisposalUnitComponent component)
|
||||
@@ -240,6 +240,37 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
}
|
||||
}
|
||||
|
||||
[Verb]
|
||||
private sealed class EjectVerb : Verb<DisposalUnitComponent>
|
||||
{
|
||||
public override bool AlternativeInteraction => true;
|
||||
|
||||
protected override void GetData(IEntity user, DisposalUnitComponent component, VerbData data)
|
||||
{
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanInteract(user) ||
|
||||
component.ContainedEntities.Contains(user))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Only show verb if actually containing any entities.
|
||||
if (component.ContainedEntities.Count > 0)
|
||||
data.Visibility = VerbVisibility.Visible;
|
||||
else
|
||||
data.Visibility = VerbVisibility.Invisible;
|
||||
|
||||
data.Text = Loc.GetString("disposal-eject-verb-get-data-text");
|
||||
data.IconTexture = "/Textures/Interface/VerbIcons/eject.svg.192dpi.png";
|
||||
}
|
||||
|
||||
protected override void Activate(IEntity user, DisposalUnitComponent component)
|
||||
{
|
||||
EntitySystem.Get<DisposalUnitSystem>().TryEjectContents(component);
|
||||
}
|
||||
}
|
||||
|
||||
void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs)
|
||||
{
|
||||
EntitySystem.Get<DisposalUnitSystem>().TryEjectContents(this);
|
||||
|
||||
Reference in New Issue
Block a user