Visual popup types (#9523)

* Visual popup types

* Pass over `PopupCoordinates` and `PopupCursor`

* `PopupEntity` pass

* Disease and reagent popup pass

* COLOUR
This commit is contained in:
Kara
2022-07-09 02:09:52 -07:00
committed by GitHub
parent 1d3d8efbc9
commit dc28b58468
47 changed files with 272 additions and 117 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.Botany.Components;
using Content.Server.Kitchen.Components;
using Content.Shared.Botany;
using Content.Shared.Examine;
using Content.Shared.Popups;
using Content.Shared.Random.Helpers;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
@@ -106,12 +107,12 @@ public sealed partial class BotanySystem
if (proto.ProductPrototypes.Count == 0 || proto.Yield <= 0)
{
_popupSystem.PopupCursor(Loc.GetString("botany-harvest-fail-message"),
Filter.Entities(user));
Filter.Entities(user), PopupType.Medium);
return Enumerable.Empty<EntityUid>();
}
_popupSystem.PopupCursor(Loc.GetString("botany-harvest-success-message", ("name", proto.DisplayName)),
Filter.Entities(user));
Filter.Entities(user), PopupType.Medium);
return GenerateProduct(proto, Transform(user).Coordinates, yieldMod);
}
@@ -132,7 +133,7 @@ public sealed partial class BotanySystem
if (totalYield > 1 || proto.HarvestRepeat != HarvestType.NoRepeat)
proto.Unique = false;
for (var i = 0; i < totalYield; i++)
{
var product = _robustRandom.Pick(proto.ProductPrototypes);

View File

@@ -8,6 +8,7 @@ using Content.Shared.Examine;
using Content.Shared.Tag;
using Content.Shared.FixedPoint;
using Content.Shared.Audio;
using Content.Shared.Popups;
using Content.Shared.Random.Helpers;
using Robust.Shared.Player;
using Robust.Shared.Timing;
@@ -102,7 +103,7 @@ namespace Content.Server.Botany.Systems
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-plant-success-message",
("seedName", seed.Name),
("seedNoun", seed.Noun)), Filter.Entities(args.User));
("seedNoun", seed.Noun)), Filter.Entities(args.User), PopupType.Medium);
component.Seed = seed;
component.Dead = false;
@@ -119,7 +120,7 @@ namespace Content.Server.Botany.Systems
}
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-already-seeded-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User));
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium);
return;
}
@@ -128,9 +129,9 @@ namespace Content.Server.Botany.Systems
if (component.WeedLevel > 0)
{
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User));
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium);
_popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-weeds-others-message",
("otherName", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.Pvs(args.User).RemoveWhereAttachedEntity(puid => puid == args.User));
("otherName", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.PvsExcept(args.User));
component.WeedLevel = 0;
component.UpdateSprite();
}
@@ -147,9 +148,9 @@ namespace Content.Server.Botany.Systems
if (component.Seed != null)
{
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-remove-plant-message",
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User));
("name", Comp<MetaDataComponent>(uid).EntityName)), Filter.Entities(args.User), PopupType.Medium);
_popupSystem.PopupEntity(Loc.GetString("plant-holder-component-remove-plant-others-message",
("name", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.Pvs(args.User).RemoveWhereAttachedEntity(puid => puid == args.User));
("name", Comp<MetaDataComponent>(args.User).EntityName)), uid, Filter.PvsExcept(args.User));
component.RemovePlant();
}
else
@@ -185,7 +186,7 @@ namespace Content.Server.Botany.Systems
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-spray-message",
("owner", uid),
("amount", split.TotalVolume)), Filter.Entities(args.User));
("amount", split.TotalVolume)), Filter.Entities(args.User), PopupType.Medium);
_solutionSystem.TryAddSolution(targetEntity, targetSolution, split);
@@ -238,11 +239,11 @@ namespace Content.Server.Botany.Systems
{
_popupSystem.PopupCursor(Loc.GetString("plant-holder-component-compost-message",
("owner", uid),
("usingItem", args.Used)), Filter.Entities(args.User));
("usingItem", args.Used)), Filter.Entities(args.User), PopupType.Medium);
_popupSystem.PopupEntity(Loc.GetString("plant-holder-component-compost-others-message",
("user", args.User),
("usingItem", args.Used),
("owner", uid)), uid, Filter.Pvs(args.User).RemoveWhereAttachedEntity(puid => puid == args.User));
("owner", uid)), uid, Filter.PvsExcept(args.User));
if (_solutionSystem.TryGetSolution(args.Used, produce.SolutionName, out var solution2))
{

View File

@@ -3,6 +3,7 @@ using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Robust.Shared.Player;
using Robust.Shared.Random;
@@ -31,7 +32,7 @@ public sealed class SeedExtractorSystem : EntitySystem
return;
_popupSystem.PopupCursor(Loc.GetString("seed-extractor-component-interact-message",("name", args.Used)),
Filter.Entities(args.User));
Filter.Entities(args.User), PopupType.Medium);
QueueDel(args.Used);