Removed old Loc.GetString() use instances (#4155)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -654,12 +654,14 @@ namespace Content.Server.Botany.Components
|
||||
{
|
||||
if (seeds.Seed == null)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("The packet seems to be empty. You throw it away."));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-empty-seed-packet-message"));
|
||||
usingItem.QueueDelete();
|
||||
return false;
|
||||
}
|
||||
|
||||
user.PopupMessageCursor(Loc.GetString("You plant the {0} {1}.", seeds.Seed.SeedName, seeds.Seed.SeedNoun));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-plant-success-message",
|
||||
("seedName", seeds.Seed.SeedName),
|
||||
("seedNoun", seeds.Seed.SeedNoun)));
|
||||
|
||||
Seed = seeds.Seed;
|
||||
Dead = false;
|
||||
@@ -675,7 +677,7 @@ namespace Content.Server.Botany.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
user.PopupMessageCursor(Loc.GetString("The {0} already has seeds in it!", Owner.Name));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-seeded-message", ("name", Owner.Name)));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -683,14 +685,14 @@ namespace Content.Server.Botany.Components
|
||||
{
|
||||
if (WeedLevel > 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("You remove the weeds from the {0}.", Owner.Name));
|
||||
user.PopupMessageOtherClients(Loc.GetString("{0} starts uprooting the weeds.", user.Name));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-weeds-message",("name", Owner.Name)));
|
||||
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-weeds-others-message",("otherName", user.Name)));
|
||||
WeedLevel = 0;
|
||||
UpdateSprite();
|
||||
}
|
||||
else
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("This plot is devoid of weeds! It doesn't need uprooting."));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-no-weeds-message"));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -700,13 +702,13 @@ namespace Content.Server.Botany.Components
|
||||
{
|
||||
if (Seed != null)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("You remove the plant from the {0}.", Owner.Name));
|
||||
user.PopupMessageOtherClients(Loc.GetString("{0} removes the plant.", user.Name));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-plant-message",("name", Owner.Name)));
|
||||
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-plant-others-message",("name", user.Name)));
|
||||
RemovePlant();
|
||||
}
|
||||
else
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("There is no plant to remove."));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-no-plant-message"));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -731,13 +733,13 @@ namespace Content.Server.Botany.Components
|
||||
var split = solution.Drain(amount);
|
||||
if (split.TotalVolume == 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("{0:TheName} is empty!", usingItem));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-empty-message",("owner", usingItem)));
|
||||
return true;
|
||||
}
|
||||
|
||||
user.PopupMessageCursor(Loc.GetString(
|
||||
sprayed ? "You spray {0:TheName}" : "You transfer {1}u to {0:TheName}",
|
||||
Owner, split.TotalVolume));
|
||||
user.PopupMessageCursor(Loc.GetString(sprayed ? "plant-holder-component-spray-message" : "plant-holder-component-transfer-message",
|
||||
("owner",Owner),
|
||||
("amount",split.TotalVolume)));
|
||||
|
||||
_solutionContainer?.TryAddSolution(split);
|
||||
|
||||
@@ -750,25 +752,25 @@ namespace Content.Server.Botany.Components
|
||||
{
|
||||
if (Seed == null)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("There is nothing to take a sample of!"));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-nothing-to-sample-message"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Sampled)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("This plant has already been sampled."));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-sampled-message"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Dead)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("This plant is dead."));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-dead-plant-message"));
|
||||
return false;
|
||||
}
|
||||
|
||||
var seed = Seed.SpawnSeedPacket(user.Transform.Coordinates);
|
||||
seed.RandomOffset(0.25f);
|
||||
user.PopupMessageCursor(Loc.GetString($"You take a sample from the {Seed.DisplayName}."));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-take-sample-message", ("seedName", Seed.DisplayName)));
|
||||
Health -= (_random.Next(3, 5) * 10);
|
||||
|
||||
if (_random.Prob(0.3f))
|
||||
@@ -788,8 +790,13 @@ namespace Content.Server.Botany.Components
|
||||
|
||||
if (usingItem.HasComponent<ProduceComponent>())
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("You compost {1:theName} into {0:theName}.", Owner, usingItem));
|
||||
user.PopupMessageOtherClients(Loc.GetString("{0:TheName} composts {1:theName} into {2:theName}.", user, usingItem, Owner));
|
||||
user.PopupMessageCursor(Loc.GetString("plant-holder-component-compost-message",
|
||||
("owner", Owner),
|
||||
("usingItem", usingItem)));
|
||||
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-compost-others-message",
|
||||
("user",user),
|
||||
("usingItem", usingItem),
|
||||
("owner", Owner)));
|
||||
|
||||
if (usingItem.TryGetComponent(out SolutionContainerComponent? solution2))
|
||||
{
|
||||
@@ -826,45 +833,51 @@ namespace Content.Server.Botany.Components
|
||||
|
||||
if (Seed == null)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("It has nothing planted in it.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-nothing-planted-message") + "\n");
|
||||
}
|
||||
else if (!Dead)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString($"[color=green]{Seed.DisplayName}[/color] {(Seed.DisplayName.EndsWith('s') ? "are" : "is")} growing here.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-something-already-growing-message",
|
||||
("seedName", Seed.DisplayName),
|
||||
("toBeForm", Seed.DisplayName.EndsWith('s') ? "are" : "is"))
|
||||
+ "\n");
|
||||
|
||||
if(Health <= Seed.Endurance / 2)
|
||||
message.AddMarkup(Loc.GetString($"The plant looks [color=red]{(Age > Seed.Lifespan ? "old and wilting" : "unhealthy")}[/color].\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-something-already-growing-low-health-message",
|
||||
("healthState", Loc.GetString(Age > Seed.Lifespan ? "plant-holder-component-plant-old-adjective" :
|
||||
"plant-holder-component-plant-unhealthy-adjective")))
|
||||
+ "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("It is full of [color=red]dead plant matter[/color].\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-dead-plant-matter-message") + "\n");
|
||||
}
|
||||
|
||||
if(WeedLevel >= 5)
|
||||
message.AddMarkup(Loc.GetString("It is filled with [color=green]weeds[/color]!\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-weed-high-level-message") + "\n");
|
||||
|
||||
if(PestLevel >= 5)
|
||||
message.AddMarkup(Loc.GetString("It is filled with [color=gray]tiny worms[/color]!\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-pest-high-level-message") + "\n");
|
||||
|
||||
message.AddMarkup(Loc.GetString($"Water: [color=cyan]{(int)WaterLevel}[/color]\n"));
|
||||
message.AddMarkup(Loc.GetString($"Nutrient: [color=orange]{(int)NutritionLevel}[/color]\n"));
|
||||
message.AddMarkup(Loc.GetString($"plant-holder-component-water-level-message",("waterLevel", (int)WaterLevel)) + "\n");
|
||||
message.AddMarkup(Loc.GetString($"plant-holder-component-nutrient-level-message", ("nutritionLevel", (int)NutritionLevel)) + "\n");
|
||||
|
||||
if (DrawWarnings)
|
||||
{
|
||||
if(Toxins > 40f)
|
||||
message.AddMarkup(Loc.GetString("The [color=red]toxicity level alert[/color] is flashing red.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-toxins-high-warning") + "\n");
|
||||
|
||||
if(ImproperLight)
|
||||
message.AddMarkup(Loc.GetString("The [color=yellow]improper light level alert[/color] is blinking.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-light-improper-warning") + "\n");
|
||||
|
||||
if(ImproperHeat)
|
||||
message.AddMarkup(Loc.GetString("The [color=orange]improper temperature level alert[/color] is blinking.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-heat-improper-warning") + "\n");
|
||||
|
||||
if(ImproperPressure)
|
||||
message.AddMarkup(Loc.GetString("The [color=lightblue]improper environment pressure alert[/color] is blinking.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-pressure-improper-warning") + "\n");
|
||||
|
||||
if(_missingGas > 0)
|
||||
message.AddMarkup(Loc.GetString("The [color=cyan]improper gas environment alert[/color] is blinking.\n"));
|
||||
message.AddMarkup(Loc.GetString("plant-holder-component-gas-missing-warning") + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,18 +32,20 @@ namespace Content.Server.Botany.Components
|
||||
|
||||
if (Seed == null)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString("It doesn't seem to contain any seeds.\n"));
|
||||
message.AddMarkup(Loc.GetString("seed-component-no-seeds-message") + "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
message.AddMarkup(Loc.GetString($"It has a picture of [color=yellow]{Seed.DisplayName}[/color] on the front.\n"));
|
||||
message.AddMarkup(Loc.GetString($"seed-component-description", ("seedName", Seed.DisplayName)) + "\n");
|
||||
|
||||
if(!Seed.RoundStart)
|
||||
message.AddMarkup(Loc.GetString($"It's tagged as variety [color=lightgray]no. {Seed.Uid}[/color].\n"));
|
||||
if (!Seed.RoundStart)
|
||||
{
|
||||
message.AddMarkup(Loc.GetString($"seed-component-has-variety-tag", ("seedUid", Seed.Uid)) + "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
message.AddMarkup(Loc.GetString($"Plant Yield: [color=lightblue]{Seed.Yield}[/color]\n"));
|
||||
message.AddMarkup(Loc.GetString($"Plant Potency: [color=lightblue]{Seed.Potency}[/color]\n"));
|
||||
message.AddMarkup(Loc.GetString($"seed-component-plant-yield-text", ("seedYield", Seed.Yield)) + "\n");
|
||||
message.AddMarkup(Loc.GetString($"seed-component-plant-potency-text", ("seedPotency", Seed.Potency)) + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.Botany.Components
|
||||
|
||||
if (eventArgs.Using.TryGetComponent(out ProduceComponent? produce) && produce.Seed != null)
|
||||
{
|
||||
eventArgs.User.PopupMessageCursor(Loc.GetString("You extract some seeds from the {0}.", eventArgs.Using.Name));
|
||||
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", eventArgs.Using.Name)));
|
||||
|
||||
eventArgs.Using.QueueDelete();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#nullable enable
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -30,35 +30,35 @@ namespace Content.Server.Botany
|
||||
SelfHarvest,
|
||||
}
|
||||
|
||||
/*
|
||||
public enum PlantSpread : byte
|
||||
{
|
||||
NoSpread,
|
||||
Creepers,
|
||||
Vines,
|
||||
}
|
||||
/*
|
||||
public enum PlantSpread : byte
|
||||
{
|
||||
NoSpread,
|
||||
Creepers,
|
||||
Vines,
|
||||
}
|
||||
|
||||
public enum PlantMutation : byte
|
||||
{
|
||||
NoMutation,
|
||||
Mutable,
|
||||
HighlyMutable,
|
||||
}
|
||||
public enum PlantMutation : byte
|
||||
{
|
||||
NoMutation,
|
||||
Mutable,
|
||||
HighlyMutable,
|
||||
}
|
||||
|
||||
public enum PlantCarnivorous : byte
|
||||
{
|
||||
NotCarnivorous,
|
||||
EatPests,
|
||||
EatLivingBeings,
|
||||
}
|
||||
public enum PlantCarnivorous : byte
|
||||
{
|
||||
NotCarnivorous,
|
||||
EatPests,
|
||||
EatLivingBeings,
|
||||
}
|
||||
|
||||
public enum PlantJuicy : byte
|
||||
{
|
||||
NotJuicy,
|
||||
Juicy,
|
||||
Slippery,
|
||||
}
|
||||
*/
|
||||
public enum PlantJuicy : byte
|
||||
{
|
||||
NotJuicy,
|
||||
Juicy,
|
||||
Slippery,
|
||||
}
|
||||
*/
|
||||
|
||||
[DataDefinition]
|
||||
public struct SeedChemQuantity
|
||||
@@ -265,7 +265,7 @@ namespace Content.Server.Botany
|
||||
sprite.LayerSetSprite(0, new SpriteSpecifier.Rsi(PlantRsi, "seed"));
|
||||
}
|
||||
|
||||
seed.Name = Loc.GetString($"packet of {SeedName} {SeedNoun}");
|
||||
seed.Name = Loc.GetString("botany-seed-packet-name", ("seedName", SeedName), ("seedNount", SeedNoun));
|
||||
|
||||
return seed;
|
||||
}
|
||||
@@ -297,11 +297,11 @@ namespace Content.Server.Botany
|
||||
|
||||
if (ProductPrototypes == null || ProductPrototypes.Count == 0 || Yield <= 0)
|
||||
{
|
||||
user.PopupMessageCursor(Loc.GetString("You fail to harvest anything useful."));
|
||||
user.PopupMessageCursor(Loc.GetString("botany-harvest-fail-message"));
|
||||
return Enumerable.Empty<IEntity>();
|
||||
}
|
||||
|
||||
user.PopupMessageCursor(Loc.GetString($"You harvest from the {DisplayName}"));
|
||||
user.PopupMessageCursor(Loc.GetString("botany-harvest-success-message", ("name", DisplayName)));
|
||||
return GenerateProduct(user.Transform.Coordinates, yieldMod);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ namespace Content.Server.Botany
|
||||
if (Mysterious)
|
||||
{
|
||||
entity.Name += "?";
|
||||
entity.Description += Loc.GetString(" On second thought, something about this one looks strange.");
|
||||
entity.Description += " " + Loc.GetString("botany-mysterious-description-addon");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user