Skip to content

Commit

Permalink
Sign
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Sep 23, 2023
1 parent 222b2f7 commit e69e810
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Content.Client/Paper/UI/PaperBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using Content.Shared.Paper;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
using Robust.Shared.Utility;
//using Content.Shared.Paper;
//using static Content.Shared.Paper.StampComponent;
using static Content.Shared.Paper.SharedPaperComponent;

namespace Content.Client.Paper.UI;
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Paper/UI/PaperWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Content.Client.Paper.UI
[GenerateTypedNameReferences]
public sealed partial class PaperWindow : BaseWindow
{
[ViewVariables]
private static Color DefaultTextColor = new(25, 25, 25);

// <summary>
Expand Down Expand Up @@ -227,7 +228,7 @@ public void Populate(SharedPaperComponent.PaperBoundUserInterfaceState state)
StampDisplay.RemoveStamps();
foreach(var stamper in state.StampedBy)
{
StampDisplay.AddStamp(new StampWidget{ StampInfo = stamper });
StampDisplay.AddStamp(new StampWidget(stamper.StampedBorderless) { StampInfo = stamper });
}
}

Expand Down
23 changes: 22 additions & 1 deletion Content.Client/Paper/UI/StampWidget.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public StampWidget()
var prototypes = IoCManager.Resolve<IPrototypeManager>();
_stampShader = prototypes.Index<ShaderPrototype>("PaperStamp").InstanceUnique();
}

public StampWidget(bool borderless)
{
RobustXamlLoader.Load(this);
Expand All @@ -62,6 +61,28 @@ public StampWidget(bool borderless)
_stampShader = prototypes.Index<ShaderPrototype>("PaperStamp").InstanceUnique();
}

//public StampWidget(bool borderless)
//{
// RobustXamlLoader.Load(this);
// var resCache = IoCManager.Resolve<IResourceCache>();
// var borderImage = resCache.GetResource<TextureResource>(
// "/Textures/Interface/Paper/paper_stamp_border.svg.96dpi.png");

// if (borderless)
// {
// borderImage = resCache.GetResource<TextureResource>(
// "/Textures/Interface/Paper/paper_stamp_noborder.svg.96dpi.png");
// }

// _borderTexture = new StyleBoxTexture
// {
// Texture = borderImage,
// };

// var prototypes = IoCManager.Resolve<IPrototypeManager>();
// _stampShader = prototypes.Index<ShaderPrototype>("PaperStamp").InstanceUnique();
//}

protected override void Draw(DrawingHandleScreen handle)
{
_stampShader?.SetParameter("objCoord", GlobalPosition * UIScale * new Vector2(1, -1));
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Paper/PaperSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private StampDisplayInfo GetStampInfo(StampComponent stamp)
{
StampedName = stamp.StampedName,
StampedColor = stamp.StampedColor,
StampedPersonal = stamp.StampedPersonal
StampedBorderless = stamp.StampedBorderless
};
}

Expand Down
4 changes: 2 additions & 2 deletions Content.Shared/Paper/StampComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public partial struct StampDisplayInfo
[DataField("stampedColor")]
public Color StampedColor;

[DataField("stampedPersonal")]
public bool StampedPersonal = false;
[DataField("stampedBorderless")]
public bool StampedBorderless;
};

[RegisterComponent]
Expand Down

0 comments on commit e69e810

Please sign in to comment.