convert News read tab to PDA Cartridge (#18368)

* Add Console, PDA news tab, and ringstone popup

* Add English localization

* Add mass-media console board to Advanced Entertainment resrarch

* Fix misprint

* Deleting unused libraries

* Fix round restart problem

* Fixing restart problem

* Just another fix

* Сode optimization

* Code optimization

* Convert News read tab to cartridge

Convert the News read tab into a cartridge, and fix a couple of bugs

* Just another fix

* Some updates

* More fixing!!

Fix cooldown, add author label to read menu

* Again, fix cooldown bug

* Some minor changes

* Revert "Some minor changes"

This reverts commit 470c8d727629ac79994f70e56162adae8659e944.

* Some minor updates
This commit is contained in:
MishaUnity
2023-07-28 22:59:03 +03:00
committed by GitHub
parent 70ceba5fbc
commit e4dcdc0c6e
32 changed files with 395 additions and 363 deletions

View File

@@ -44,7 +44,6 @@ namespace Content.Server.PDA
SubscribeLocalEvent<PdaComponent, PdaShowMusicMessage>(OnUiMessage);
SubscribeLocalEvent<PdaComponent, PdaShowUplinkMessage>(OnUiMessage);
SubscribeLocalEvent<PdaComponent, PdaLockUplinkMessage>(OnUiMessage);
SubscribeLocalEvent<PdaComponent, PdaOpenNewsMessage>(OnUiMessage);
SubscribeLocalEvent<StationRenamedEvent>(OnStationRenamed);
SubscribeLocalEvent<AlertLevelChangedEvent>(OnAlertLevelChanged);
@@ -115,7 +114,6 @@ namespace Content.Server.PDA
var address = GetDeviceNetAddress(uid);
var hasInstrument = HasComp<InstrumentComponent>(uid);
var showUplink = HasComp<StoreComponent>(uid) && IsUnlocked(uid);
var showNews = HasComp<NewsReadComponent>(uid);
UpdateStationName(uid, pda);
UpdateAlertLevel(uid, pda);
@@ -137,7 +135,6 @@ namespace Content.Server.PDA
pda.StationName,
showUplink,
hasInstrument,
showNews,
address);
_cartridgeLoader?.UpdateUiState(uid, state);
@@ -200,18 +197,6 @@ namespace Content.Server.PDA
}
}
private void OnUiMessage(EntityUid uid, PdaComponent pda, PdaOpenNewsMessage msg)
{
if (!PdaUiKey.Key.Equals(msg.UiKey))
return;
if (TryComp<NewsReadComponent>(uid, out var news))
{
_news.ToggleUi(msg.Session.AttachedEntity!.Value, uid, news);
UpdatePdaUi(uid, pda);
}
}
private bool IsUnlocked(EntityUid uid)
{
return !TryComp<RingerUplinkComponent>(uid, out var uplink) || uplink.Unlocked;