-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
8,610 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<DefaultWindow xmlns="https://spacestation14.io" | ||
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls" | ||
Title="{Loc cd-actions-admin-modify-records}" | ||
MinSize="300 300"> | ||
<BoxContainer Orientation="Vertical"> | ||
<LineEdit Name="EntityEdit" PlaceHolder="Entity" HorizontalExpand="True" /> | ||
<OptionButton Name="EntityEntryType" HorizontalExpand="True" /> | ||
<LineEdit Name="EntityEntryIndex" PlaceHolder="Index"/> | ||
<BoxContainer Orientation="Horizontal" > | ||
<cc:CommandButton Name="PurgeCommand" Text="{Loc cd-actions-admin-modify-reset}"/> | ||
<cc:CommandButton Name="DelCommand" Text="{Loc cd-actions-admin-modify-del-entry}"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</DefaultWindow> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Content.Shared._CD.Records; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.CustomControls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client._CD.Admin.UI; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class ModifyCharacterRecords : DefaultWindow | ||
{ | ||
public ModifyCharacterRecords() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
|
||
foreach (var v in Enum.GetValues<CharacterRecordType>()) | ||
{ | ||
EntityEntryType.AddItem(v.ToString()); | ||
} | ||
|
||
EntityEntryType.OnItemSelected += args => | ||
{ | ||
EntityEntryType.SelectId(args.Id); | ||
UpdateCommands(); | ||
}; | ||
|
||
EntityEdit.OnTextChanged += _ => UpdateCommands(); | ||
EntityEntryIndex.OnTextChanged += _ => UpdateCommands(); | ||
} | ||
|
||
private void UpdateCommands() | ||
{ | ||
if (!int.TryParse(EntityEdit.Text, out var uid)) | ||
{ | ||
return; | ||
} | ||
|
||
if (!int.TryParse(EntityEntryIndex.Text, out var idx)) | ||
{ | ||
return; | ||
} | ||
|
||
var ty = (CharacterRecordType)EntityEntryType.SelectedId; | ||
|
||
PurgeCommand.Command = $"purgecharacterrecords {uid}"; | ||
DelCommand.Command = $"delrecordentry {uid} {ty.ToString()} {idx}"; | ||
} | ||
} |
Oops, something went wrong.