Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
BL02DL committed Sep 26, 2024
2 parents dbbf9cf + 5417844 commit 4aa40b7
Show file tree
Hide file tree
Showing 16 changed files with 3,481 additions and 2,695 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/close-master-pr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Close PRs on master

on:
workflow_dispatch:
pull_request_target:
types: [ opened, ready_for_review ]

jobs:
run:
Expand Down
25 changes: 24 additions & 1 deletion Content.Client/Corvax/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Player;
using Robust.Client.Player;
using Robust.Shared.Utility;
using Content.Client.Language.Systems;
using Content.Client.Administration.Managers;
using Content.Shared.Administration;
using Content.Shared.Ghost;
using System.Linq;
using JetBrains.Annotations;


namespace Content.Client.Corvax.TTS;
Expand All @@ -28,6 +31,7 @@ public sealed class TTSSystem : EntitySystem
[Dependency] private readonly IResourceCache _resourceCache = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly ISharedPlayerManager _playerManager = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly LanguageSystem _language = default!;
[Dependency] private readonly IClientAdminManager _adminMgr = default!;

Expand Down Expand Up @@ -81,6 +85,7 @@ private void OnPlayTTS(PlayTTSEvent ev)
#endif
if (!canPlay)
return;

//_sawmill.Debug($"Play TTS audio {ev.Data.Length} bytes from {ev.SourceUid} entity");

var volume = AdjustVolume(ev.IsWhisper);
Expand Down Expand Up @@ -108,14 +113,32 @@ private void OnPlayTTS(PlayTTSEvent ev)
if (ev.SourceUid != null)
{
var sourceUid = GetEntity(ev.SourceUid.Value);
Filter sources = Filter.Pvs(sourceUid);
var sourceExists = false;
foreach (var src in sources.Recipients)
{
if (src.AttachedEntity != null && src.AttachedEntity == player)
{
sourceExists = true;
break;
}
else
continue;
}
if (!sourceExists) //если в диапазоне Pvs нет источника, то звук не проигрывается
return;

//Logger.Warning($"Playing TTS on Entity {sourceUid}");
_audio.PlayEntity(soundPath, new EntityUid(), sourceUid); // recipient arg ignored on client
}
else
{
//_audio.PlayGlobal(soundPath, Filter.Local(), false); // поскольку источника нет/не видно, то пусть молчит
//Logger.Warning("Playing TTS Globally");
_audio.PlayGlobal(soundPath, Filter.Local(), false);
}

_contentRoot.RemoveFile(filePath);
//Logger.Warning($"TTS File successfully removed!");
}

private float AdjustVolume(bool isWhisper)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System.Numerics;
using Content.Shared.Ghost;
using Content.Shared._White.CustomGhostSystem;
using Robust.Client.GameObjects;

namespace Content.Client._White.CustomGhostSpriteSystem;

public sealed class CustomGhostVisualizer : VisualizerSystem<GhostComponent>
{
protected override void OnAppearanceChange(EntityUid uid, GhostComponent component, ref AppearanceChangeEvent args)
{
base.OnAppearanceChange(uid, component, ref args);

if (args.Sprite == null)
return;

if (AppearanceSystem.TryGetData<string>(uid, CustomGhostAppearance.Sprite, out var rsiPath, args.Component))
{
args.Sprite.LayerSetRSI(0, rsiPath);
}

if (AppearanceSystem.TryGetData<float>(uid, CustomGhostAppearance.AlphaOverride, out var alpha, args.Component))
{
args.Sprite.Color = args.Sprite.Color.WithAlpha(alpha);
}

if (AppearanceSystem.TryGetData<Vector2>(uid, CustomGhostAppearance.SizeOverride, out var size, args.Component))
{
args.Sprite.Scale = size;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using Content.Server.Ghost.Components;
using Content.Shared.Ghost;
using Content.Shared._White.CustomGhostSystem;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

namespace Content.Server._White.CustomGhostSpriteSystem;

public sealed class CustomGhostSpriteSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<GhostComponent, PlayerAttachedEvent>(OnChangeAppearance);
}

private void OnChangeAppearance(EntityUid uid, GhostComponent component, PlayerAttachedEvent args)
{
if (!_playerManager.TryGetSessionByEntity(uid, out var session))
return;

TrySetCustomSprite(uid, session.Name);
}

public void TrySetCustomSprite(EntityUid ghostUid, string ckey)
{
var prototypes = _prototypeManager.EnumeratePrototypes<CustomGhostPrototype>();

foreach (var customGhostPrototype in prototypes)
{
if (!string.Equals(customGhostPrototype.Ckey, ckey, StringComparison.CurrentCultureIgnoreCase))
continue;
_appearanceSystem.SetData(ghostUid, CustomGhostAppearance.Sprite, customGhostPrototype.CustomSpritePath.ToString());
_appearanceSystem.SetData(ghostUid, CustomGhostAppearance.SizeOverride, customGhostPrototype.SizeOverride);

if (customGhostPrototype.AlphaOverride > 0)
{
_appearanceSystem.SetData(ghostUid, CustomGhostAppearance.AlphaOverride, customGhostPrototype.AlphaOverride);
}

if (customGhostPrototype.GhostName != string.Empty)
{
_metaData.SetEntityName(ghostUid, customGhostPrototype.GhostName);
}

if (customGhostPrototype.GhostDescription != string.Empty)
{
_metaData.SetEntityDescription(ghostUid, customGhostPrototype.GhostDescription);
}

return;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile,
}

#if LPP_Sponsors
if (sponsorTier >= 5 && !whitelisted)
if (sponsorTier >= 5 || (whitelisted && job.Requirements != null && job.Requirements.OfType<CharacterWhitelistRequirement>().Any()))
{
reason = null;
return true;
Expand Down Expand Up @@ -232,7 +232,7 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile,
}

#if LPP_Sponsors
if (sponsorTier >= 5 && !whitelisted)
if (sponsorTier >= 5 || (whitelisted && job.Requirements != null && job.Requirements.OfType<CharacterWhitelistRequirement>().Any()))
{
reason = null;
return true;
Expand Down Expand Up @@ -306,7 +306,7 @@ public override bool IsValid(JobPrototype job, HumanoidCharacterProfile profile,
}

#if LPP_Sponsors
if (sponsorTier >= 5 && !whitelisted)
if (sponsorTier >= 5 || (whitelisted && job.Requirements != null && job.Requirements.OfType<CharacterWhitelistRequirement>().Any()))
{
reason = null;
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.Numerics;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;

namespace Content.Shared._White.CustomGhostSystem;

/// <summary>
/// Use this for custom ghost's
/// </summary>
[Prototype("customGhost")]
public sealed class CustomGhostPrototype : IPrototype
{
[IdDataField]
public string ID { get; } = default!;

[DataField(required: true)]
public string Ckey { get; } = default!;

[DataField("sprite", required: true)]
public ResPath CustomSpritePath { get; } = default!;

[DataField("alpha")]
public float AlphaOverride { get; } = -1;

[DataField("ghostName")]
public string GhostName = string.Empty;

[DataField("ghostDescription")]
public string GhostDescription = string.Empty;

[DataField("size")]
public Vector2 SizeOverride = Vector2.One;
}

[Serializable, NetSerializable]
public enum CustomGhostAppearance
{
Sprite,
AlphaOverride,
SizeOverride
}
9 changes: 9 additions & 0 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6656,3 +6656,12 @@ Entries:
id: 6387
time: '2024-09-24T00:56:45.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/945
- author: VMSolidus
changes:
- type: Fix
message: >-
IPC now weigh 71kg by default instead of 5kg. Seriously who the fuck
made the BeepBoops out of feathers!?!
id: 6388
time: '2024-09-25T05:09:06.0000000+00:00'
url: https://github.com/Simple-Station/Einstein-Engines/pull/959
71 changes: 71 additions & 0 deletions Resources/Changelog/ChangelogLPP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -676,3 +676,74 @@ Entries:
id: 63
time: '2024-09-23T18:30:37.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/193
- author: BL02DL
changes:
- type: Add
message: Добавлены платы кузниц!
- type: Add
message: Добавлены две разновидности кузницы!
- type: Add
message: Добавлены две Т2 и две Т3 технологии в ветку алмазной индустрии!
- type: Add
message: >-
Добавлены новые технологии продвинутого конструирования скафандров в
ветки СБ промышленности и сервиса!
- type: Add
message: Добавлен продвинутый источник исследований!
- type: Remove
message: Убран отражающий щит с СБмата!
- type: Tweak
message: Изменён перевод противолазерного щита в отражающий!
- type: Tweak
message: Теперь отражающий щит отражает лазеры!
- type: Tweak
message: Теперь отражающий жилет не получить с лотереи!
- type: Tweak
message: Теперь отражающий скафандр не получить с покупки в карго!
- type: Tweak
message: Изменена скорость с надетым скафандром полевого врача!
- type: Tweak
message: Изменён блокируемый тип урона отражающим щитом!
- type: Tweak
message: >-
Изменена редкость алмазной залежи с 1 до 3 это среднее между золотом и
плазмой!
- type: Fix
message: Исправлена цена технологии Продвинутое алмазное шахтёрское оборудование!
- type: Fix
message: >-
Исправлено появление алмазов на карте, теперь там появляются по 1 алмазу
не более!
id: 64
time: '2024-09-25T16:06:31.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/191
- author: SpicyDarkFox
changes:
- type: Add
message: Добавлена механика анимированного кастома для призраков
id: 65
time: '2024-09-25T20:04:04.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/198
- author: PowerKAT1
changes:
- type: Fix
message: Ботаника и мелкие фиксы на Нормандии
id: 66
time: '2024-09-25T21:28:53.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/197
- author: SpicyDarkFox
changes:
- type: Tweak
message: Изменена система ТТС, чтобы предотвращать звуки вне слышимости
- type: Fix
message: Исправлена ошибка с ВЛом ролей и спонсоркой
id: 67
time: '2024-09-25T21:55:16.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/199
- author: Evgencheg
changes:
- type: Add
message: Добавлено требование 25+ лет возраста для ГП, ГСБ, ОСЩ, ВС и Капитана.
id: 68
time: '2024-09-25T22:35:34.0000000+00:00'
url: https://github.com/Lost-Paradise-Project/Lost-Paradise/pull/196
Loading

0 comments on commit 4aa40b7

Please sign in to comment.