Skip to content

Commit

Permalink
Merge remote-tracking branch 'hivehum/spelf-to-thaven' into publish-t…
Browse files Browse the repository at this point in the history
…o-staging
  • Loading branch information
irismessage committed Jan 14, 2025
2 parents 80fc4b9 + f283e4f commit 04ce9a6
Show file tree
Hide file tree
Showing 305 changed files with 3,261 additions and 3,261 deletions.
42 changes: 0 additions & 42 deletions Content.Client/_Impstation/Spelfs/Eui/SpelfMoodsEui.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Content.Client/_Impstation/Spelfs/SpelfMoodSystem.cs

This file was deleted.

41 changes: 0 additions & 41 deletions Content.Client/_Impstation/Spelfs/SpelfMoodsBoundUserInterface.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
>
<customControls:HSeparator></customControls:HSeparator>
<BoxContainer Orientation="Vertical">
<LineEdit Name="SpelfMoodTitle" Access="Public" Margin="5 0 0 0" />
<LineEdit Name="ThavenMoodTitle" Access="Public" Margin="5 0 0 0" />
<PanelContainer
Margin="20 10 0 0"
MinHeight="128"
Expand All @@ -16,15 +16,15 @@
<graphics:StyleBoxFlat BackgroundColor="#1B1B1B"></graphics:StyleBoxFlat>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Horizontal" SeparationOverride="5">
<TextEdit Name="SpelfMoodContent" Access="Public" HorizontalExpand="True" Editable="True" MinWidth="500" MinHeight="80"></TextEdit>
<TextEdit Name="ThavenMoodContent" Access="Public" HorizontalExpand="True" Editable="True" MinWidth="500" MinHeight="80"></TextEdit>
</BoxContainer>
</PanelContainer>
</BoxContainer>
<BoxContainer Orientation="Horizontal" Margin="0 5 0 0" MaxHeight="64" Align="Begin">
<Button Name="MoveUp" Access="Public" Text="{Loc spelf-mood-admin-ui-move-up}" StyleClasses="OpenRight"></Button>
<Button Name="MoveDown" Access="Public" Text="{Loc spelf-mood-admin-ui-move-down}" StyleClasses="OpenLeft"></Button>
<Button Name="MoveUp" Access="Public" Text="{Loc thaven-mood-admin-ui-move-up}" StyleClasses="OpenRight"></Button>
<Button Name="MoveDown" Access="Public" Text="{Loc thaven-mood-admin-ui-move-down}" StyleClasses="OpenLeft"></Button>
</BoxContainer>
<BoxContainer Orientation="Horizontal" Align="End" Margin="0 10 5 10">
<Button Name="Delete" Access="Public" Text="{Loc spelf-mood-admin-ui-delete}" ModulateSelfOverride="Red"></Button>
<Button Name="Delete" Access="Public" Text="{Loc thaven-mood-admin-ui-delete}" ModulateSelfOverride="Red"></Button>
</BoxContainer>
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
using Content.Shared._Impstation.Spelfs;
using Content.Shared._Impstation.Thaven;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;

namespace Content.Client._Impstation.Spelfs.Eui;
namespace Content.Client._Impstation.Thaven.Eui;

[GenerateTypedNameReferences]
public sealed partial class MoodContainer : BoxContainer
{
public MoodContainer(SpelfMood? mood = null)
public MoodContainer(ThavenMood? mood = null)
{
RobustXamlLoader.Load(this);

if (mood != null)
{
SpelfMoodTitle.Text = mood.GetLocName();
SpelfMoodContent.TextRope = new Rope.Leaf(mood.GetLocDesc());
ThavenMoodTitle.Text = mood.GetLocName();
ThavenMoodContent.TextRope = new Rope.Leaf(mood.GetLocDesc());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<controls:FancyWindow
xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc spelf-moods-admin-ui-title}"
Title="{Loc thaven-moods-admin-ui-title}"
MinSize="560 400"
>
<!-->
Expand All @@ -10,8 +10,8 @@
<!-->
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal" Align="End">
<Button Name="NewMoodButton" Text="{Loc spelf-moods-admin-ui-new-mood}" MaxSize="256 64" StyleClasses="OpenRight"></Button>
<Button Name="SaveButton" Text="{Loc spelf-moods-admin-ui-save}" MaxSize="256 64" Access="Public" StyleClasses="OpenLeft"></Button>
<Button Name="NewMoodButton" Text="{Loc thaven-moods-admin-ui-new-mood}" MaxSize="256 64" StyleClasses="OpenRight"></Button>
<Button Name="SaveButton" Text="{Loc thaven-moods-admin-ui-save}" MaxSize="256 64" Access="Public" StyleClasses="OpenLeft"></Button>
</BoxContainer>
</BoxContainer>
<BoxContainer Orientation="Vertical" Margin="4 60 0 0">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using Content.Client.UserInterface.Controls;
using Content.Shared._Impstation.Spelfs;
using Content.Shared._Impstation.Thaven;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;

namespace Content.Client._Impstation.Spelfs.Eui;
namespace Content.Client._Impstation.Thaven.Eui;

[GenerateTypedNameReferences]
public sealed partial class SpelfMoodUi : FancyWindow
public sealed partial class ThavenMoodUi : FancyWindow
{
private List<SpelfMood> _moods = new();
private List<ThavenMood> _moods = new();

public SpelfMoodUi()
public ThavenMoodUi()
{
RobustXamlLoader.Load(this);
NewMoodButton.OnPressed += _ => AddNewMood();
Expand All @@ -22,26 +22,26 @@ private void AddNewMood()
MoodContainer.AddChild(new MoodContainer());
}

public List<SpelfMood> GetMoods()
public List<ThavenMood> GetMoods()
{
var newMoods = new List<SpelfMood>();
var newMoods = new List<ThavenMood>();

foreach (var control in MoodContainer.Children)
{
if (control is not MoodContainer moodControl)
continue;

if (string.IsNullOrWhiteSpace(moodControl.SpelfMoodTitle.Text))
if (string.IsNullOrWhiteSpace(moodControl.ThavenMoodTitle.Text))
continue;

var moodText = Rope.Collapse(moodControl.SpelfMoodContent.TextRope).Trim();
var moodText = Rope.Collapse(moodControl.ThavenMoodContent.TextRope).Trim();

if (string.IsNullOrWhiteSpace(moodText))
continue;

var mood = new SpelfMood()
var mood = new ThavenMood()
{
MoodName = moodControl.SpelfMoodTitle.Text,
MoodName = moodControl.ThavenMoodTitle.Text,
MoodDesc = moodText,
};

Expand Down Expand Up @@ -76,7 +76,7 @@ private void Delete(int index)
SetMoods(_moods);
}

public void SetMoods(List<SpelfMood> moods)
public void SetMoods(List<ThavenMood> moods)
{
_moods = moods;
MoodContainer.RemoveAllChildren();
Expand Down
42 changes: 42 additions & 0 deletions Content.Client/_Impstation/Thaven/Eui/ThavenMoodsEui.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using Content.Client.Eui;
using Content.Shared.Eui;
using Content.Shared._Impstation.Thaven;

namespace Content.Client._Impstation.Thaven.Eui;

public sealed class ThavenMoodsEui : BaseEui
{
private readonly EntityManager _entityManager;

private ThavenMoodUi _thavenMoodUi;
private NetEntity _target;

public ThavenMoodsEui()
{
_entityManager = IoCManager.Resolve<EntityManager>();

_thavenMoodUi = new ThavenMoodUi();
_thavenMoodUi.SaveButton.OnPressed += _ => SaveMoods();
}

private void SaveMoods()
{
var newMoods = _thavenMoodUi.GetMoods();
SendMessage(new ThavenMoodsSaveMessage(newMoods, _target));
_thavenMoodUi.SetMoods(newMoods);
}

public override void Opened()
{
_thavenMoodUi.OpenCentered();
}

public override void HandleState(EuiStateBase state)
{
if (state is not ThavenMoodsEuiState s)
return;

_target = s.Target;
_thavenMoodUi.SetMoods(s.Moods);
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Linq;
using Content.Client.Chat.Managers;
using Content.Client.Message;
using Content.Shared._Impstation.Spelfs;
using Content.Shared._Impstation.Thaven;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Client._Impstation.Spelfs;
namespace Content.Client._Impstation.Thaven;

[GenerateTypedNameReferences]
public sealed partial class MoodDisplay : Control
Expand All @@ -22,7 +22,7 @@ private string GetSharedString()
return $"[italic][font size=10][color=gray]{Loc.GetString("moods-ui-shared-mood")}[/color][/font][/italic]";
}

public MoodDisplay(SpelfMood mood, bool shared)
public MoodDisplay(ThavenMood mood, bool shared)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/_Impstation/Thaven/ThavenMoodSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared._Impstation.Thaven;

namespace Content.Client._Impstation.Thaven;

public sealed partial class ThavenMoodSystem : SharedThavenMoodSystem
{
}
41 changes: 41 additions & 0 deletions Content.Client/_Impstation/Thaven/ThavenMoodsBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Content.Client._Impstation.Thaven;
using Content.Shared._Impstation.Thaven;
using Content.Shared._Impstation.Thaven.Components;
using JetBrains.Annotations;
using Robust.Client.UserInterface;

namespace Content.Client._Impstation.Thaven;

[UsedImplicitly]
public sealed class ThavenMoodsBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private ThavenMoodsMenu? _menu;
private EntityUid _owner;
private List<ThavenMood>? _moods;
private List<ThavenMood>? _sharedMoods;

public ThavenMoodsBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_owner = owner;
}

protected override void Open()
{
base.Open();

_menu = this.CreateWindow<ThavenMoodsMenu>();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not ThavenMoodsBuiState msg)
return;

_moods = msg.Moods;
_sharedMoods = msg.SharedMoods;
_menu?.Update(_owner, msg);
}
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using Content.Client.UserInterface.Controls;
using Content.Shared._Impstation.Spelfs.Components;
using Content.Shared._Impstation.Thaven.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;

namespace Content.Client._Impstation.Spelfs;
namespace Content.Client._Impstation.Thaven;

[GenerateTypedNameReferences]
public sealed partial class SpelfMoodsMenu : FancyWindow
public sealed partial class ThavenMoodsMenu : FancyWindow
{
public SpelfMoodsMenu()
public ThavenMoodsMenu()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
}

public void Update(EntityUid uid, SpelfMoodsBuiState state)
public void Update(EntityUid uid, ThavenMoodsBuiState state)
{
MoodDisplayContainer.Children.Clear();

Expand Down
Loading

0 comments on commit 04ce9a6

Please sign in to comment.