Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 10/25/2024 #90

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void UpdateState(NewsArticle article, int targetNum, int totalNum, bool n
Author.Visible = true;

PageName.Text = article.Title;
PageText.SetMarkup(article.Content);
PageText.SetMarkupPermissive(article.Content);

PageNum.Text = $"{targetNum}/{totalNum}";

Expand Down
13 changes: 4 additions & 9 deletions Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ public void SetProfile(HumanoidCharacterProfile? profile, int? slot)
UpdateSkinColor();
UpdateSpawnPriorityControls();
UpdateFlavorTextEdit();
UpdateCustomSpecieNameEdit();
UpdateAgeEdit();
UpdateEyePickers();
UpdateSaveButton();
Expand Down Expand Up @@ -1206,15 +1207,9 @@ private void UpdateNameEdit()

private void UpdateCustomSpecieNameEdit()
{
if (Profile == null)
return;

_customspecienameEdit.Text = Profile.Customspeciename ?? "";

if (!_prototypeManager.TryIndex<SpeciesPrototype>(Profile.Species, out var speciesProto))
return;

_ccustomspecienamecontainerEdit.Visible = speciesProto.CustomName;
var species = _species.Find(x => x.ID == Profile?.Species) ?? _species.First();
_customspecienameEdit.Text = string.IsNullOrEmpty(Profile?.Customspeciename) ? Loc.GetString(species.Name) : Profile.Customspeciename;
_ccustomspecienamecontainerEdit.Visible = species.CustomName;
}

private void UpdateFlavorTextEdit()
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/MassMedia/Ui/ArticleEditorPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void OnPreview(BaseButton.ButtonEventArgs eventArgs)

TextEditPanel.Visible = !_preview;
PreviewPanel.Visible = _preview;
PreviewLabel.SetMarkup(Rope.Collapse(ContentField.TextRope));
PreviewLabel.SetMarkupPermissive(Rope.Collapse(ContentField.TextRope));
}

private void OnCancel(BaseButton.ButtonEventArgs eventArgs)
Expand Down
18 changes: 18 additions & 0 deletions Content.Client/Message/RichTextLabelExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,27 @@ namespace Content.Client.Message;

public static class RichTextLabelExt
{


/// <summary>
/// Sets the labels markup.
/// </summary>
/// <remarks>
/// Invalid markup will cause exceptions to be thrown. Don't use this for user input!
/// </remarks>
public static RichTextLabel SetMarkup(this RichTextLabel label, string markup)
{
label.SetMessage(FormattedMessage.FromMarkup(markup));
return label;
}

/// <summary>
/// Sets the labels markup.<br/>
/// Uses <c>FormatedMessage.FromMarkupPermissive</c> which treats invalid markup as text.
/// </summary>
public static RichTextLabel SetMarkupPermissive(this RichTextLabel label, string markup)
{
label.SetMessage(FormattedMessage.FromMarkupPermissive(markup));
return label;
}
}
2 changes: 1 addition & 1 deletion Content.Client/Tips/TippyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private void NextState(TippyUI tippy)
sprite.LayerSetVisible("hiding", false);
}
sprite.Rotation = 0;
tippy.Label.SetMarkup(_currentMessage.Msg);
tippy.Label.SetMarkupPermissive(_currentMessage.Msg);
tippy.Label.Visible = false;
tippy.LabelPanel.Visible = false;
tippy.Visible = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ private void SpawnEntities(EntityUid uid, PsionicComponent component, EntitySpaw
foreach (var tileref in tiles)
Spawn(_random.Pick(entry.Spawns), _mapSystem.ToCenterCoordinates(tileref, grid));
}
}
}

This file was deleted.

88 changes: 0 additions & 88 deletions Content.Server/DeltaV/StationEvents/Events/GlimmerMobSpawnRule.cs

This file was deleted.

9 changes: 6 additions & 3 deletions Content.Server/Ensnaring/EnsnareableSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed partial class EnsnareableSystem : SharedEnsnareableSystem
[Dependency] private readonly ContainerSystem _container = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly PopupSystem _popup = default!;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -48,8 +48,11 @@ private void OnDoAfter(EntityUid uid, EnsnareableComponent component, DoAfterEve
Dirty(component);
ensnaring.Ensnared = null;

_hands.PickupOrDrop(args.Args.User, args.Args.Used.Value);

if (ensnaring.DestroyOnRemove)
QueueDel(args.Args.Used);
else
_hands.PickupOrDrop(args.Args.User, args.Args.Used.Value);

_popup.PopupEntity(Loc.GetString("ensnare-component-try-free-complete", ("ensnare", args.Args.Used)), uid, uid, PopupType.Medium);

UpdateAlert(args.Args.Target.Value, component);
Expand Down
60 changes: 60 additions & 0 deletions Content.Server/LifeDrainer/LifeDrainerComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;

namespace Content.Server.LifeDrainer;

/// <summary>
/// Adds a verb to drain life from a crit mob that matches a whitelist.
/// Successfully draining a mob rejuvenates you completely.
/// </summary>
[RegisterComponent, Access(typeof(LifeDrainerSystem))]
public sealed partial class LifeDrainerComponent : Component
{
/// <summary>
/// Damage to give to the target when draining is complete
/// </summary>
[DataField(required: true)]
public DamageSpecifier Damage = new();

/// <summary>
/// Mobs have to match this whitelist to be drained.
/// </summary>
[DataField]
public EntityWhitelist? Whitelist;

/// <summary>
/// The time that it takes to drain an entity.
/// </summary>
[DataField]
public TimeSpan Delay = TimeSpan.FromSeconds(8.35f);

/// <summary>
/// Sound played while draining a mob.
/// </summary>
[DataField]
public SoundSpecifier DrainSound = new SoundPathSpecifier("/Audio/DeltaV/Effects/clang2.ogg");

/// <summary>
/// Sound played after draining is complete.
/// </summary>
[DataField]
public SoundSpecifier FinishSound = new SoundPathSpecifier("/Audio/Effects/guardian_inject.ogg");

[DataField]
public EntityUid? DrainStream;

/// <summary>
/// A current drain doafter in progress.
/// </summary>
[DataField]
public DoAfterId? DoAfter;

/// <summary>
/// What mob is being targeted for draining.
/// When draining stops the AI will try to drain this target again until successful.
/// </summary>
[DataField]
public EntityUid? Target;
}
Loading
Loading