-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Описание PR <!-- Что вы изменили в этом пулл реквесте? --> ## Почему / Баланс <!-- Почему оно было изменено? Ссылайтесь на любые обсуждения или вопросы здесь. Пожалуйста, обсудите, как это повлияет на игровой баланс. --> ## Техническая информация <!-- Если речь идет об изменении кода, кратко изложите на высоком уровне принцип работы нового кода. Это облегчает рецензирование.- --> ## Требования <!-- В связи с наплывом ПР'ов нам необходимо убедиться, что ПР'ы следуют правильным рекомендациям. Пожалуйста, уделите время прочтению, если делаете пулл реквест (ПР) впервые. Отметьте поля ниже, чтобы подтвердить, что Вы действительно видели их (поставьте X в скобках, например [X]): --> - [x] Я прочитал(а) и следую [Руководство по созданию пулл реквестов](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html). Я понимаю, что в противном случае мой ПР может быть закрыт по усмотрению мейнтейнера. - [x] Я добавил скриншоты/видео к этому пулл реквесту, демонстрирующие его изменения в игре, **или** этот пулл реквест не требует демонстрации в игре ## Критические изменения - [ ] Проверить норм ли это робит #435 по пути `Content.Server\Silicons\Laws\SiliconLawSystem.cs` ```cs protected override void OnUpdaterInsert(Entity<SiliconLawUpdaterComponent> ent, ref EntInsertedIntoContainerMessage args) { // TODO: Prediction dump this if (!TryComp(args.Entity, out SiliconLawBoundComponent? provider)) //ADT custom AI law return; var lawset = GetLaws(args.Entity, provider).Laws; //ADT custom AI law var query = EntityManager.CompRegistryQueryEnumerator(ent.Comp.Components); while (query.MoveNext(out var update)) { SetLaws(lawset, update); if (provider.LawUploadSound != null && _mind.TryGetMind(update, out var mindId, out _)) _roles.MindPlaySound(mindId, provider.LawUploadSound); } ///ADT AI Custom law start UpdateBorgsNTLaws(lawset); } ``` **Чейнджлог** :cl: Шрёдька - tweak: Подтянуты коммиты с Корвакса, 06.11.2024.
- Loading branch information
Showing
468 changed files
with
276,176 additions
and
167,923 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,62 @@ | ||
using Content.Shared.CCVar; | ||
using Robust.Client; | ||
using Robust.Client.Graphics; | ||
using Robust.Shared; | ||
using Robust.Shared.Configuration; | ||
|
||
namespace Content.Client.GameTicking.Managers; | ||
|
||
public sealed class TitleWindowManager | ||
{ | ||
[Dependency] private readonly IBaseClient _client = default!; | ||
[Dependency] private readonly IClyde _clyde = default!; | ||
[Dependency] private readonly IConfigurationManager _cfg = default!; | ||
[Dependency] private readonly IGameController _gameController = default!; | ||
|
||
public void Initialize() | ||
{ | ||
_cfg.OnValueChanged(CVars.GameHostName, OnHostnameChange, true); | ||
_cfg.OnValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange, true); | ||
|
||
_client.RunLevelChanged += OnRunLevelChangedChange; | ||
} | ||
|
||
public void Shutdown() | ||
{ | ||
_cfg.UnsubValueChanged(CVars.GameHostName, OnHostnameChange); | ||
_cfg.UnsubValueChanged(CCVars.GameHostnameInTitlebar, OnHostnameTitleChange); | ||
} | ||
|
||
private void OnHostnameChange(string hostname) | ||
{ | ||
var defaultWindowTitle = _gameController.GameTitle(); | ||
|
||
// Since the game assumes the server name is MyServer and that GameHostnameInTitlebar CCVar is true by default | ||
// Lets just... not show anything. This also is used to revert back to just the game title on disconnect. | ||
if (_client.RunLevel == ClientRunLevel.Initialize) | ||
{ | ||
_clyde.SetWindowTitle(defaultWindowTitle); | ||
return; | ||
} | ||
|
||
if (_cfg.GetCVar(CCVars.GameHostnameInTitlebar)) | ||
// If you really dislike the dash I guess change it here | ||
_clyde.SetWindowTitle(hostname + " - " + defaultWindowTitle); | ||
else | ||
_clyde.SetWindowTitle(defaultWindowTitle); | ||
} | ||
|
||
// Clients by default assume game.hostname_in_titlebar is true | ||
// but we need to clear it as soon as we join and actually receive the servers preference on this. | ||
// This will ensure we rerun OnHostnameChange and set the correct title bar name. | ||
private void OnHostnameTitleChange(bool colonthree) | ||
{ | ||
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName)); | ||
} | ||
|
||
// This is just used we can rerun the hostname change function when we disconnect to revert back to just the games title. | ||
private void OnRunLevelChangedChange(object? sender, RunLevelChangedEventArgs runLevelChangedEventArgs) | ||
{ | ||
OnHostnameChange(_cfg.GetCVar(CVars.GameHostName)); | ||
} | ||
} |
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
Oops, something went wrong.