-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Описание PR <!-- Что вы изменили в этом пулл реквесте? --> добавила гостбар и пулл для него ## Почему / Баланс <!-- Почему оно было изменено? Ссылайтесь на любые обсуждения или вопросы здесь. Пожалуйста, обсудите, как это повлияет на игровой баланс. --> **Ссылка на публикацию в Discord** <!-- Укажите ссылки на соответствующие обсуждения, проблемы, баги, заказы в разработку или предложения - [Технические проблемы](ссылка) - [Баги](ссылка) - [Заказы-разработка](ссылка) - [Предложения](ссылка) - [Перенос контента](ссылка)--> веселье гостов ## Медиа <!-- Пулл реквесты, которые вносят внутриигровые изменения (добавление одежды, предметов, новых возможностей и т.д.), должны содержать медиа, демонстрирующие изменения. Небольшие исправления/рефакторы не требуют медиа. Если Вы не уверены в том, что Ваш пулл реквест требует медиа, спросите мейнтейнера. --> ## Требования <!-- В связи с наплывом ПР'ов нам необходимо убедиться, что ПР'ы следуют правильным рекомендациям. Пожалуйста, уделите время прочтению, если делаете пулл реквест (ПР) впервые. Отметьте поля ниже, чтобы подтвердить, что Вы действительно видели их (поставьте X в скобках, например [X]): --> - [x] Я прочитал(а) и следую [Руководство по созданию пулл реквестов](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html). Я понимаю, что в противном случае мой ПР может быть закрыт по усмотрению мейнтейнера. - [x] Я добавил скриншоты/видео к этому пулл реквесту, демонстрирующие его изменения в игре, **или** этот пулл реквест не требует демонстрации в игре ## Критические изменения <!-- Перечислите все критические изменения, включая изменения пространства имён, публичных классов/методов/полей, переименования прототипов, и предоставьте инструкции по их исправлению. --> **Чейнджлог** <!-- Здесь Вы можете заполнить журнал изменений, который будет автоматически добавлен в игру при мердже Вашего пулл реквест. Чтобы игроки узнали о новых возможностях и изменениях, которые могут повлиять на их игру, добавьте запись в журнал изменений. Не считайте суффикс типа записи (например, add) "частью" предложения: плохо: - add: новый инструмент для инженеров хорошо: - add: добавлен новый инструмент для инженеров Помещение имени после символа 🆑 изменит имя, которое будет отображаться в журнале изменений (в противном случае будет использоваться ваше имя пользователя GitHub). Например: 🆑 AruMoon --> 🆑 Ratyyy - add: Призраки нашли для себя целое кафе, в котором они могут отдыхать после смерти! --------- Co-authored-by: FaDeOkno <[email protected]> Co-authored-by: FaDeOkno <[email protected]>
- Loading branch information
1 parent
d7f1f09
commit 14afdf5
Showing
19 changed files
with
20,949 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Content.Client/ADT/UserInterface/Systems/Ghost/Controls/GhostBarRulesWindow.xaml
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,15 @@ | ||
<DefaultWindow xmlns="https://spacestation14.io" | ||
Title="{Loc 'ghost-target-window-ghostbar'}" | ||
MinSize="550 400" | ||
SetSize="550 400"> | ||
<BoxContainer Orientation="Vertical" | ||
HorizontalExpand="True"> | ||
<RichTextLabel Name="TopBanner" VerticalExpand="True"/> | ||
<Button Name="SpawnButton" | ||
Text="{Loc 'ghost-window-spawn-ghostbar-button'}" | ||
Disabled="True" | ||
TextAlign="Center" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" /> | ||
</BoxContainer> | ||
</DefaultWindow> |
53 changes: 53 additions & 0 deletions
53
Content.Client/ADT/UserInterface/Systems/Ghost/Controls/GhostBarRulesWindow.xaml.cs
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,53 @@ | ||
using Content.Shared.CCVar; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.CustomControls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Configuration; | ||
using Robust.Shared.Timing; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client.ADT.UserInterface.Systems.Ghost.Controls | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class GhostBarRulesWindow : DefaultWindow | ||
{ | ||
[Dependency] private readonly IConfigurationManager _cfg = IoCManager.Resolve<IConfigurationManager>(); | ||
private float _timer; | ||
|
||
public event Action? SpawnButtonPressed; | ||
public GhostBarRulesWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
var ghostBarTime = _cfg.GetCVar(CCVars.GhostRoleTime); | ||
_timer = ghostBarTime; | ||
|
||
if (ghostBarTime > 0f) | ||
{ | ||
SpawnButton.Text = Loc.GetString("ghost-window-spawn-ghostbar-button-timer", ("time", $"{_timer:0.0}")); | ||
TopBanner.SetMessage(FormattedMessage.FromMarkupPermissive(Loc.GetString("ghost-bar-rules") + "\n" + Loc.GetString("ghost-roles-window-rules-footer", ("time", ghostBarTime)))); | ||
SpawnButton.Disabled = true; | ||
} | ||
|
||
SpawnButton.OnPressed += _ => SpawnButtonPressed?.Invoke(); | ||
} | ||
|
||
|
||
protected override void FrameUpdate(FrameEventArgs args) | ||
{ | ||
base.FrameUpdate(args); | ||
if (!SpawnButton.Disabled) return; | ||
if (_timer > 0.0) | ||
{ | ||
_timer -= args.DeltaSeconds; | ||
SpawnButton.Text = Loc.GetString("ghost-window-spawn-ghostbar-button-timer", ("time", $"{_timer:0.0}")); | ||
} | ||
else | ||
{ | ||
SpawnButton.Disabled = false; | ||
SpawnButton.Text = Loc.GetString("ghost-window-spawn-ghostbar-button"); | ||
} | ||
} | ||
} | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
Content.Client/ADT/UserInterface/Systems/Ghost/GhostUIController.Ghostbar.cs
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,42 @@ | ||
using Content.Client.Gameplay; | ||
using Content.Client.Ghost; | ||
using Content.Client.UserInterface.Systems.Gameplay; | ||
using Content.Client.UserInterface.Systems.Ghost.Widgets; | ||
using Content.Shared.Ghost; | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.Controllers; | ||
using Content.Client.UserInterface.Systems.Ghost; | ||
|
||
namespace Content.Client.UserInterface.Systems.Ghost; | ||
|
||
// TODO hud refactor BEFORE MERGE fix ghost gui being too far up | ||
public sealed partial class GhostUIController | ||
{ | ||
private void GhostBarPressed() | ||
{ | ||
Gui?.GhostBarWindow.OpenCentered(); | ||
} | ||
|
||
private void GhostBarSpawnPressed() | ||
{ | ||
_system?.GhostBarSpawn(); | ||
} | ||
|
||
public void LoadGhostbarGui() | ||
{ | ||
if (Gui == null) | ||
return; | ||
|
||
Gui.GhostBarPressed += GhostBarPressed; | ||
Gui.GhostBarWindow.SpawnButtonPressed += GhostBarSpawnPressed; | ||
} | ||
|
||
public void UnloadGhostbarGui() | ||
{ | ||
if (Gui == null) | ||
return; | ||
|
||
Gui.GhostBarPressed -= GhostBarPressed; | ||
Gui.GhostBarWindow.SpawnButtonPressed -= GhostBarSpawnPressed; | ||
} | ||
} |
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
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
10 changes: 10 additions & 0 deletions
10
Content.Server/ADT/Ghostbar/Components/GhostBarPlayerComponent.cs
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,10 @@ | ||
namespace Content.Server.ADT.Ghostbar.Components; | ||
|
||
/// <summary> | ||
/// Tracker for ghostbar players | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class GhostBarPlayerComponent : Component | ||
{ | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
Content.Server/ADT/Ghostbar/Components/GhostBarSpawnPointComponent.cs
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,10 @@ | ||
namespace Content.Server.ADT.Ghostbar.Components; | ||
|
||
/// <summary> | ||
/// Target for ghosts to spawn at | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class GhostBarSpawnPointComponent : Component | ||
{ | ||
|
||
} |
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,62 @@ | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.Roles; | ||
using Content.Shared.Roles.Jobs; | ||
using Content.Shared.Weather; | ||
|
||
namespace Content.Server.ADT.Ghostbar; | ||
|
||
/// <summary> | ||
/// прототип самих гост баров | ||
/// <see cref="GhostBarSystem"/> | ||
/// </summary> | ||
[Prototype("ghostbarMap")] | ||
public sealed partial class GhostBarMapPrototype : IPrototype | ||
{ | ||
/// <inheritdoc/> | ||
[IdDataField] | ||
public string ID { get; private set; } = default!; | ||
|
||
/// <summary> | ||
/// путь до карты | ||
/// </summary> | ||
[DataField("path", required: true)] | ||
public string Path = string.Empty; | ||
|
||
/// <summary> | ||
/// включает/выключает пацифизм | ||
/// </summary> | ||
[DataField("pacified")] | ||
public bool Pacified = false; | ||
|
||
/// <summary> | ||
/// добавляет игрокам призрачную прозрачность, лучше не ставить меньше 0.8f | ||
/// </summary> | ||
[DataField("ghosted")] | ||
public float Ghosted = 1f; | ||
|
||
/// <summary> | ||
/// список профессий, которые могут быть в гостбаре | ||
/// </summary> | ||
[DataField] | ||
public List<JobComponent> Jobs = new() | ||
{ | ||
new JobComponent { Prototype = "Passenger" }, | ||
new JobComponent { Prototype = "Bartender" }, | ||
new JobComponent { Prototype = "Botanist" }, | ||
new JobComponent { Prototype = "Chef" }, | ||
new JobComponent { Prototype = "Janitor" } | ||
}; | ||
|
||
/// <summary> | ||
/// погода на карте. если не заполнять строку - её не будет. | ||
/// </summary> | ||
[DataField("weather")] | ||
public ProtoId<WeatherPrototype>? Weather = null; | ||
|
||
/// <summary> | ||
/// компоненты, добавляемые при заходе в гостбар человека(ТОЛЬКО КАСТОМНЫЕ, все компоненты туда лучше не добавлять) | ||
/// </summary> | ||
[DataField("componentsadd")] | ||
public ComponentRegistry Componentsadd = new(); | ||
} | ||
|
Oops, something went wrong.