mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
* - add: StyleSheetify * - add: APC style * - tweak: Select only APC now! * - fix: Window positioning * - fix: animations * - add: Fancy chat * - tweak: change some margin think * - fix: add assemblies of stylesheetify for packaging * - tweak: update StyleSheetify * - add: custom LauncherConnection * - tweak: change to paper * - tweak: Update StyleSheetify * - add: fancy lobby screen * - tweak: some beauty think in lobby screen * - add: new icons * - tweak: change icons * - tweak: //WWDP EDIT * - fix: disable style while testing * - fix: Channel Popup button style revert * - fix: test again * - tweak: Update StyleSheetify
86 lines
2.3 KiB
C#
86 lines
2.3 KiB
C#
using System.Numerics;
|
|
using Content.Client.UserInterface.Controls;
|
|
using Prometheus;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.ResourceManagement;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.ContentPack;
|
|
|
|
|
|
namespace Content.Client.Lobby.UI;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class LobbyCharacterPreviewPanel : Control
|
|
{
|
|
[Dependency] private readonly IEntityManager _entManager = default!;
|
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
|
|
|
// public Button CharacterSetupButton => CharacterSetup;
|
|
|
|
private readonly Texture BackgroundTexture; //WWDP EDIT
|
|
|
|
private EntityUid? _previewDummy;
|
|
|
|
public LobbyCharacterPreviewPanel()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
IoCManager.InjectDependencies(this);
|
|
BackgroundTexture = _resourceCache.GetResource<TextureResource>("/Textures/_White/NovaUI/Paper/photo_scaled.png").Texture; //WWDP EDIT
|
|
}
|
|
|
|
public void SetLoaded(bool value)
|
|
{
|
|
Loaded.Visible = value;
|
|
Unloaded.Visible = !value;
|
|
}
|
|
|
|
public void SetSummaryText(string value)
|
|
{
|
|
Summary.Text = value;
|
|
}
|
|
|
|
public void SetSprite(EntityUid uid)
|
|
{
|
|
if (_previewDummy != null)
|
|
{
|
|
_entManager.DeleteEntity(_previewDummy);
|
|
}
|
|
|
|
_previewDummy = uid;
|
|
|
|
ViewBox.DisposeAllChildren();
|
|
var spriteView = new SpriteView
|
|
{
|
|
OverrideDirection = Direction.South,
|
|
Scale = new Vector2(4f, 4f),
|
|
MaxSize = new Vector2(112, 112),
|
|
Stretch = SpriteView.StretchMode.Fill,
|
|
};
|
|
spriteView.SetEntity(uid);
|
|
//WWDP EDIT START
|
|
var panelContainer = new PanelContainer()
|
|
{
|
|
PanelOverride = new StyleBoxTexture()
|
|
{
|
|
Texture = BackgroundTexture
|
|
},
|
|
SetSize = new Vector2(192,192),
|
|
};
|
|
|
|
panelContainer.AddChild(spriteView);
|
|
|
|
ViewBox.AddChild(panelContainer);
|
|
//WWDP EDIT END
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
_entManager.DeleteEntity(_previewDummy);
|
|
_previewDummy = null;
|
|
}
|
|
}
|