Fix tooltips for non-disabled verbs (#19009)
This commit is contained in:
@@ -34,7 +34,7 @@ public sealed class IdExaminableSystem : EntitySystem
|
|||||||
Text = Loc.GetString("id-examinable-component-verb-text"),
|
Text = Loc.GetString("id-examinable-component-verb-text"),
|
||||||
Category = VerbCategory.Examine,
|
Category = VerbCategory.Examine,
|
||||||
Disabled = !detailsRange,
|
Disabled = !detailsRange,
|
||||||
Message = Loc.GetString("id-examinable-component-verb-disabled"),
|
Message = detailsRange ? null : Loc.GetString("id-examinable-component-verb-disabled"),
|
||||||
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/character.svg.192dpi.png"))
|
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/character.svg.192dpi.png"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Server.DetailExaminable
|
|||||||
Text = Loc.GetString("detail-examinable-verb-text"),
|
Text = Loc.GetString("detail-examinable-verb-text"),
|
||||||
Category = VerbCategory.Examine,
|
Category = VerbCategory.Examine,
|
||||||
Disabled = !detailsRange,
|
Disabled = !detailsRange,
|
||||||
Message = Loc.GetString("detail-examinable-verb-disabled"),
|
Message = detailsRange ? null : Loc.GetString("detail-examinable-verb-disabled"),
|
||||||
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/examine.svg.192dpi.png"))
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/examine.svg.192dpi.png"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace Content.Server.DeviceLinking.Systems
|
|||||||
if (!args.CanAccess || !args.CanInteract || (args.Hands == null))
|
if (!args.CanAccess || !args.CanInteract || (args.Hands == null))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var disabled = component.State == TwoWayLeverState.Left;
|
||||||
InteractionVerb verbLeft = new()
|
InteractionVerb verbLeft = new()
|
||||||
{
|
{
|
||||||
Act = () =>
|
Act = () =>
|
||||||
@@ -63,14 +64,15 @@ namespace Content.Server.DeviceLinking.Systems
|
|||||||
StateChanged(uid, component);
|
StateChanged(uid, component);
|
||||||
},
|
},
|
||||||
Category = VerbCategory.Lever,
|
Category = VerbCategory.Lever,
|
||||||
Message = Loc.GetString("two-way-lever-cant"),
|
Message = disabled ? Loc.GetString("two-way-lever-cant") : null,
|
||||||
Disabled = component.State == TwoWayLeverState.Left,
|
Disabled = disabled,
|
||||||
Icon = new SpriteSpecifier.Texture(new ($"/Textures/Interface/VerbIcons/{_leftToggleImage}")),
|
Icon = new SpriteSpecifier.Texture(new ($"/Textures/Interface/VerbIcons/{_leftToggleImage}")),
|
||||||
Text = Loc.GetString("two-way-lever-left"),
|
Text = Loc.GetString("two-way-lever-left"),
|
||||||
};
|
};
|
||||||
|
|
||||||
args.Verbs.Add(verbLeft);
|
args.Verbs.Add(verbLeft);
|
||||||
|
|
||||||
|
disabled = component.State == TwoWayLeverState.Right;
|
||||||
InteractionVerb verbRight = new()
|
InteractionVerb verbRight = new()
|
||||||
{
|
{
|
||||||
Act = () =>
|
Act = () =>
|
||||||
@@ -84,8 +86,8 @@ namespace Content.Server.DeviceLinking.Systems
|
|||||||
StateChanged(uid, component);
|
StateChanged(uid, component);
|
||||||
},
|
},
|
||||||
Category = VerbCategory.Lever,
|
Category = VerbCategory.Lever,
|
||||||
Message = Loc.GetString("two-way-lever-cant"),
|
Message = disabled ? Loc.GetString("two-way-lever-cant") : null,
|
||||||
Disabled = component.State == TwoWayLeverState.Right,
|
Disabled = disabled,
|
||||||
Icon = new SpriteSpecifier.Texture(new ($"/Textures/Interface/VerbIcons/{_rightToggleImage}")),
|
Icon = new SpriteSpecifier.Texture(new ($"/Textures/Interface/VerbIcons/{_rightToggleImage}")),
|
||||||
Text = Loc.GetString("two-way-lever-right"),
|
Text = Loc.GetString("two-way-lever-right"),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public sealed class HealthExaminableSystem : EntitySystem
|
|||||||
Text = Loc.GetString("health-examinable-verb-text"),
|
Text = Loc.GetString("health-examinable-verb-text"),
|
||||||
Category = VerbCategory.Examine,
|
Category = VerbCategory.Examine,
|
||||||
Disabled = !detailsRange,
|
Disabled = !detailsRange,
|
||||||
Message = Loc.GetString("health-examinable-verb-disabled"),
|
Message = detailsRange ? null : Loc.GetString("health-examinable-verb-disabled"),
|
||||||
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png"))
|
Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/rejuvenate.svg.192dpi.png"))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ public sealed class PickRandomSystem : EntitySystem
|
|||||||
|
|
||||||
var user = args.User;
|
var user = args.User;
|
||||||
|
|
||||||
|
var enabled = false;
|
||||||
|
if (storage.StoredEntities != null)
|
||||||
|
enabled = storage.StoredEntities.Any(item => comp.Whitelist?.IsValid(item, EntityManager) ?? true);
|
||||||
|
|
||||||
// alt-click / alt-z to pick an item
|
// alt-click / alt-z to pick an item
|
||||||
args.Verbs.Add(new AlternativeVerb
|
args.Verbs.Add(new AlternativeVerb
|
||||||
{
|
{
|
||||||
@@ -37,8 +41,8 @@ public sealed class PickRandomSystem : EntitySystem
|
|||||||
}),
|
}),
|
||||||
Impact = LogImpact.Low,
|
Impact = LogImpact.Low,
|
||||||
Text = Loc.GetString(comp.VerbText),
|
Text = Loc.GetString(comp.VerbText),
|
||||||
Disabled = !(storage.StoredEntities?.Any(item => comp.Whitelist?.IsValid(item, EntityManager) ?? true) ?? false),
|
Disabled = !enabled,
|
||||||
Message = Loc.GetString(comp.EmptyText, ("storage", uid))
|
Message = enabled ? null : Loc.GetString(comp.EmptyText, ("storage", uid))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user