Replace resolve dependency with attribute in components (#1995)
* Replace resolve dependency with attribute in components * Add changes that went missing in translation
This commit is contained in:
@@ -9,12 +9,14 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech
|
||||
[RegisterComponent]
|
||||
public class OwOAccentComponent : Component, IAccentComponent
|
||||
{
|
||||
[Dependency] private readonly IRobustRandom _random;
|
||||
|
||||
public override string Name => "OwOAccent";
|
||||
|
||||
private static readonly IReadOnlyList<string> Faces = new List<string>{
|
||||
" (・`ω´・)", " ;;w;;", " owo", " UwU", " >w<", " ^w^"
|
||||
}.AsReadOnly();
|
||||
private string RandomFace => IoCManager.Resolve<IRobustRandom>().Pick(Faces);
|
||||
private string RandomFace => _random.Pick(Faces);
|
||||
|
||||
private static readonly Dictionary<string, string> SpecialWords = new Dictionary<string, string>
|
||||
{
|
||||
@@ -23,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Mobs.Speech
|
||||
|
||||
public string Accentuate(string message)
|
||||
{
|
||||
foreach ((var word,var repl) in SpecialWords)
|
||||
foreach (var (word, repl) in SpecialWords)
|
||||
{
|
||||
message = message.Replace(word, repl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user