Skip to content

Commit

Permalink
Merge branch 'master' into fixfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkiich authored Dec 13, 2024
2 parents 9254099 + a20b2d2 commit 0f70146
Show file tree
Hide file tree
Showing 2,561 changed files with 1,830,359 additions and 481,825 deletions.
11 changes: 4 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@
Помещение имени после символа :cl: изменит имя, которое будет отображаться в журнале изменений (в противном случае будет использоваться ваше имя пользователя GitHub).
Например: :cl: AruMoon
-->

<!--
Чтобы шаблон Чейнджлога отображался, уберите его из блока комментариев. Чейнджлог должен содержать :cl: символ, чтобы бот распознал изменения и добавил их в журнал изменений игры.
:cl:
- add: Добавлено веселье!
- remove: Удалено веселье!
- tweak: Изменено веселье!
- fix: Исправлено веселье!
Чтобы шаблон Чейнджлога отображался, уберите его из блока комментариев.
Чейнджлог должен содержать cl символ,
чтобы бот распознал изменения и добавил их в журнал изменений игры.
Используйте ключевые слова add, remove, tweak и fix.
-->
31 changes: 31 additions & 0 deletions Content.Client/ADT/Administration/ExportManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Robust.Client.UserInterface;
using System.Text;
using Content.Shared.ADT.Export;


namespace Content.Client.ADT.Export
{
public sealed class ExportManager : SharedExportManager
{
[Dependency] private readonly IFileDialogManager _dialogManager = default!;

public override async void Load(ExportYmlMessage msg)
{
var data = msg.Data;
var file = await _dialogManager.SaveFile(new FileDialogFilters(new FileDialogFilters.Group("yml")));

if (file == null)
return;
if (file is not { fileStream: var stream })
return;

if (data != null)
{
await stream.WriteAsync(Encoding.ASCII.GetBytes(data));
await stream.FlushAsync();
await stream.DisposeAsync();
return;
}
}
}
}
16 changes: 10 additions & 6 deletions Content.Client/ADT/Bark/Systems/HumanoidProfileEditor.Barks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public sealed partial class HumanoidProfileEditor
{
private List<BarkPrototype> _barkList = new();

private void InitializeBarks()
private void InitializeBarks() // У меня случился небольшой затуп. Оно барки в обход кнопки сохраняет, но хотя бы работает ы
{
_barkList = _prototypeManager
.EnumeratePrototypes<BarkPrototype>()
Expand All @@ -20,6 +20,7 @@ private void InitializeBarks()
{
BarkProtoButton.SelectId(args.Id);
SetBarkProto(_barkList[args.Id].ID);
UpdateSaveButton();
};

PitchEdit.OnTextChanged += args =>
Expand All @@ -28,6 +29,7 @@ private void InitializeBarks()
return;

SetBarkPitch(newPitch);
UpdateSaveButton();
};

DelayVariationMinEdit.OnTextChanged += args =>
Expand All @@ -36,6 +38,7 @@ private void InitializeBarks()
return;

SetBarkMinVariation(newVar);
UpdateSaveButton();
};

DelayVariationMaxEdit.OnTextChanged += args =>
Expand All @@ -44,6 +47,7 @@ private void InitializeBarks()
return;

SetBarkMaxVariation(newVar);
UpdateSaveButton();
};

BarkPlayButton.OnPressed += _ => PlayPreviewBark();
Expand All @@ -56,9 +60,9 @@ private void UpdateBarkVoicesControls()

BarkProtoButton.Clear();

PitchEdit.Text = Profile.BarkPitch.ToString();
DelayVariationMinEdit.Text = Profile.BarkLowVar.ToString();
DelayVariationMaxEdit.Text = Profile.BarkHighVar.ToString();
PitchEdit.Text = Profile.Bark.Pitch.ToString();
DelayVariationMinEdit.Text = Profile.Bark.MinVar.ToString();
DelayVariationMaxEdit.Text = Profile.Bark.MaxVar.ToString();

var firstVoiceChoiceId = 1;
for (var i = 0; i < _barkList.Count; i++)
Expand All @@ -72,7 +76,7 @@ private void UpdateBarkVoicesControls()
firstVoiceChoiceId = i;
}

var voiceChoiceId = _barkList.FindIndex(x => x.ID == Profile.BarkProto);
var voiceChoiceId = _barkList.FindIndex(x => x.ID == Profile.Bark.Proto);
if (!BarkProtoButton.TrySelectId(voiceChoiceId) &&
BarkProtoButton.TrySelectId(firstVoiceChoiceId))
{
Expand All @@ -85,6 +89,6 @@ private void PlayPreviewBark()
if (Profile is null)
return;

_entManager.System<SpeechBarksSystem>().PlayDataPrewiew(Profile.BarkProto, Profile.BarkPitch, Profile.BarkLowVar, Profile.BarkHighVar);
_entManager.System<SpeechBarksSystem>().PlayDataPrewiew(Profile.Bark.Proto, Profile.Bark.Pitch, Profile.Bark.MinVar, Profile.Bark.MaxVar);
}
}
72 changes: 72 additions & 0 deletions Content.Client/ADT/BookPrinter/BookPrinterBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Content.Shared.ADT.BookPrinter;
using Content.Shared.Containers.ItemSlots;
using JetBrains.Annotations;

namespace Content.Client.ADT.BookPrinter
{
[UsedImplicitly]
public sealed class BookPrinterBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private BookPrinterWindow? _window;

[ViewVariables]
private BookPrinterBoundUserInterfaceState? _lastState;

public BookPrinterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

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

_window = new()
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
};

_window.EjectButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent("bookSlot"));
_window.ClearButton.OnPressed += _ => SendMessage(new BookPrinterClearContainerMessage());
_window.UploadButton.OnPressed += _ => SendMessage(new BookPrinterUploadMessage());
_window.CopyPasteButton.OnPressed += _ => SendMessage(new BookPrinterCopyPasteMessage());


_window.OpenCentered();
_window.OnClose += Close;

_window.OnPrintBookButtonPressed += (args, button) => SendMessage(new BookPrinterPrintBookMessage(button.BookEntry));
_window.OnPrintBookButtonMouseEntered += (args, button) =>
{
if (_lastState is not null)
_window.UpdateContainerInfo(_lastState);
};
_window.OnPrintBookButtonMouseExited += (args, button) =>
{
if (_lastState is not null)
_window.UpdateContainerInfo(_lastState);
};
}

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

var castState = (BookPrinterBoundUserInterfaceState)state;
_lastState = castState;

_window?.UpdateState(castState);
}

[Obsolete]
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);

if (disposing)
{
_window?.Dispose();
}
}
}
}
45 changes: 45 additions & 0 deletions Content.Client/ADT/BookPrinter/BookPrinterWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<DefaultWindow
xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
Title="{Loc 'book-printer-title'}"
SetSize="525 475"
MinSize="525 475">
<BoxContainer Orientation="Vertical">
<ScrollContainer HScrollEnabled="False" HorizontalExpand="True" VerticalExpand="True" MinSize="0 250">
<BoxContainer Orientation="Vertical" Name="BooksList" Access="Public">
</BoxContainer>
</ScrollContainer>
<Control MinSize="0 10"/>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'book-printer-window-book-label'}"/>
<Control MinSize="10 0"/>
<Button Name="UploadButton"
Access="Public"
Text="{Loc 'book-printer-window-upload-button'}"
StyleClasses="OpenRight"/>
<Button Name="ClearButton"
Access="Public"
Text="{Loc 'book-printer-window-clear-button'}"
StyleClasses="OpenBoth"/>
<Button Name="CopyPasteButton"
Access="Public"
Text="{Loc 'book-printer-window-copy-button'}"
StyleClasses="OpenBoth"/>
<Button Name="EjectButton"
Access="Public"
Text="{Loc 'book-printer-window-eject-button'}"
StyleClasses="OpenLeft"/>
</BoxContainer>
<Control MinSize="0 10"/>
<PanelContainer SizeFlagsStretchRatio="6" MinSize="0 100">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1b1b1e" />
</PanelContainer.PanelOverride>
<BoxContainer Name="ContainerInfo"
Orientation="Vertical"
HorizontalExpand="True">
<Label Text="{Loc 'book-printer-window-no-book-loaded-text'}"/>
</BoxContainer>
</PanelContainer>
</BoxContainer>
</DefaultWindow>
Loading

0 comments on commit 0f70146

Please sign in to comment.