Files
OldThink/Content.Client/Entry/EntryPoint.cs
keslik 92dd279988 [Transfer] Engi (#790)
* Suhariki (#4)

* init

* Porting is complete

Still WIP

* small stuff

* SmallStuff

* awawawa

* Нас рано

* Engi

* More luck

* removed some shit

(cherry picked from commit e1d745655b0e7253ea4e4814b82dd56e90153514)

* Самодельные отражайки (#6)

* Ghetto Mirror Shield

* Protorypes for ghetto mirrors

* locale

* idk, works fine on my machine

* forsenPls

(cherry picked from commit 4505739fd9430bcc578da3dec932d9aa7ca933ca)

* Шлем из ведра (#7)

* Bucket Helmet

* Code cleanup

* Squashed commit of the following:

commit 4505739fd9430bcc578da3dec932d9aa7ca933ca
Author: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com>
Date:   Sat Sep 21 17:10:02 2024 +0300

    Самодельные отражайки (#6)

    * Ghetto Mirror Shield

    * Protorypes for ghetto mirrors

    * locale

    * idk, works fine on my machine

    * forsenPls

commit 1f066876508dec8d3f21ad753dab9fcc13dc8d1a
Author: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com>
Date:   Sat Sep 21 14:57:30 2024 +0300

    Агрессивный вор (#5)

    * AggressiveThief

    * Попытка насрать обратно

commit e1d745655b0e7253ea4e4814b82dd56e90153514
Author: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com>
Date:   Sat Sep 21 14:46:38 2024 +0300

    Suhariki (#4)

    * init

    * Porting is complete

    Still WIP

    * small stuff

    * SmallStuff

    * awawawa

    * Нас рано

    * Engi

    * More luck

    * removed some shit

commit 08061b4f1fbbfd521e3a40ef53d9bc86fa140087
Author: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com>
Date:   Sat Sep 21 14:30:31 2024 +0300

    Engi rise up (#3)

commit 00e2f5c45ca7abfeff1f85d4893352d8875f8560
Author: BIGZi0348 <118811750+BIGZi0348@users.noreply.github.com>
Date:   Thu Sep 19 19:42:30 2024 +0300

    Bigzi upstream1 (#2)

    * init

    * Porting is complete

    Still WIP

    * Мелочи - Король крыс, диски, правки перевода и респрайт одеяния культа (#686)

    * Большой Крыс Отдыхает

    * Фикс размера фейк диска

    * Доработка диска очков РНД

    * Скоро перейду на райдер

    * Переводы

    * Диски одного размера

    * Респрайт робы и капюшона культа

    * Automatic changelog update

    * fix (#687)

    * Automatic changelog update

    * govno HD (#688)

    * Automatic changelog update

    * Hotfix loadouts (#689)

    * govno HD

    * hotfix loadouts

    * fuck

    * Automatic changelog update

    * Update PULL_REQUEST_TEMPLATE.md

    * Even smaller stuff (#690)

    * 45 to 44

    * Фикс ошибки перевода

    * Voice mask translate

    * Automatic changelog update

    * small stuff

    * SmallStuff

    * awawawa

    * Локализация шепелявости (#691)

    * БУМ!!!!!!!! (#692)

    * Automatic changelog update

    * Большой ребаланс милишки (#681)

    * MeleeThrowOnHit rework

    * buff baseball bat

    * better mjolnir

    * telebaton system unhardcode + refactor + transform TelescopicBatonComponent to KnockDownOnHitComponent

    * fix telebaton prototype

    * darova

    * fix KnockDownOnHitSystem

    * chaplain weapons rebalance

    * fix nullrod hit sound

    * BloodstreamSystem cleanup

    * bleeding rebalance

    * damage rebalance

    * small baseball bat fix

    * Automatic changelog update

    * Chaplain armor fix (#693)

    * Фикс описания (#696)

    * No passengers on this military complex (#695)

    * Automatic changelog update

    * Переводы (#698)

    * Пепеводы

    * Очепятки

    * Фикс прожектора и открутка цифр (#697)

    * Melochi

    * Фикс хамелеона

    * Переводы денег мне на карту

    * Automatic changelog update

    * Нас рано

    * Фикс пополнения зарядов РЦД используя стаки ресурсов (#699)

    * Фиксики

    * Спасли Валеру от банкротства

    * Very hot man (#700)

    * Automatic changelog update

    * reverted illegal code added by oniks

    ---------

    Co-authored-by: RavmorganButOnCocaine <valtos@nextmail.ru>
    Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
    Co-authored-by: Valtos <valtos@spaces.ru>
    Co-authored-by: Jabak <163307958+Jabaks@users.noreply.github.com>
    Co-authored-by: ThereDrD <88589686+ThereDrD0@users.noreply.github.com>

* ВЕДРО!!!

* Funny

* Oppsie

(cherry picked from commit 92ce631b0c0187678b6d1eea34d3c0830b9b0fac)

* Yes (#8)

(cherry picked from commit 3d083befca212455cffcae56b84ee55050ad62be)

* Small Fix

То чувство, когда можешь срать прямо в мэйн

(cherry picked from commit 8fa7cfb678711a55bf6704ced30f7ed9b4b1e8c4)

* bababooey (#9)

(cherry picked from commit f7ed9d287f6798c7d39ac437a2f969ec0dc10309)

* GoodLooking (#10)

(cherry picked from commit 1617dce502b71db22a6b736ac879c04c07ec54a0)

* Dadka scazal (#11)

(cherry picked from commit 50da866354952628185bb396f359c2f533d57340)

* Сортировка эксклюзива енги + респрайт деревянных столов и дверей (#12)

* Massive

* Чейндлок

(cherry picked from commit 4dc165e4c1aa75e8fd22f14db95ac72bf50c77f5)

* Big Zi bucket helmet fix

* Опять насрал в мастер

(cherry picked from commit bd866e0cd87770b1509885f66ec5c562dda3fd91)

* Боевые Молоты (#14)

(cherry picked from commit 64df6b4b91050273218007365cf81a45c3ea74a8)

* хотфикс сухариков

(cherry picked from commit a98265c22dc7de467693f501cf3a5d8577e94a54)

* funny sword (#15)

(cherry picked from commit 231aaa1b33b7e4edf00506c6ebdbd389257cf1ca)

* funny hammer

(cherry picked from commit 1e58eaa146cc95f34358d97d6c436ba4705d09a1)

* Добавил админ логирование PacifiedOnChaplainActionSystem (#19)

Update PacifiedOnChaplainActionSystem.cs

(cherry picked from commit f6aa42eab7cce294336aec14f7dfb6f0671267cf)

* Small refactor

(cherry picked from commit b38ad7e7b8afa35a22c84c2fb8836bf13736dfb3)

* Команда для отправки цели для станции (#21)

* Команда для отправки цели для станции

* Правки

(cherry picked from commit 93a79c4952e3a75c32ff5cc4d07df4018a9bf7db)

* Больше целей

(cherry picked from commit c3d34d6a4e000d8af66c8f53d60a898cfae0a454)

* Music for events

(cherry picked from commit 4a7214634b3e77caefd011bf5900f581055a0ac8)

* Санитизация

* unused

---------

Co-authored-by: BIGZi0348 <118811750+bigzi0348@users.noreply.github.com>
Co-authored-by: BIGZi0348 <svalker0348@gmail.com>
2024-11-27 05:25:36 +03:00

252 lines
11 KiB
C#

using Content.Client._White.Chat;
using Content.Client._White.JoinQueue;
using Content.Client._White.Jukebox;
using Content.Client._White.Reputation;
using Content.Client._White.Sponsors;
using Content.Client._White.Stalin;
using Content.Client._White.TTS;
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GhostKick;
using Content.Client.Guidebook;
using Content.Client.Info;
using Content.Client.Input;
using Content.Client.IoC;
using Content.Client.Launcher;
using Content.Client.MainMenu;
using Content.Client.Parallax.Managers;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Preferences;
using Content.Client.Radiation.Overlays;
using Content.Client.Replay;
using Content.Client.Screenshot;
using Content.Client.Singularity;
using Content.Client._White.Explosion;
using Content.Client.Stylesheets;
using Content.Client.Viewport;
using Content.Client.Voting;
using Content.Shared.Ame.Components;
using Content.Shared.Gravity;
using Content.Shared.Localizations;
using Robust.Client;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Replays.Loading;
using Robust.Client.State;
using Robust.Client.UserInterface;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Prototypes;
using Robust.Shared.Replays;
namespace Content.Client.Entry
{
public sealed class EntryPoint : GameClient
{
[Dependency] private readonly IBaseClient _baseClient = default!;
[Dependency] private readonly IGameController _gameController = default!;
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly IParallaxManager _parallaxManager = default!;
[Dependency] private readonly IConfigurationManager _configManager = default!;
[Dependency] private readonly IStylesheetManager _stylesheetManager = default!;
[Dependency] private readonly IScreenshotHook _screenshotHook = default!;
[Dependency] private readonly FullscreenHook _fullscreenHook = default!;
[Dependency] private readonly ChangelogManager _changelogManager = default!;
[Dependency] private readonly RulesManager _rulesManager = default!;
[Dependency] private readonly ViewportManager _viewportManager = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
[Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly IOverlayManager _overlayManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IClientPreferencesManager _clientPreferencesManager = default!;
[Dependency] private readonly EuiManager _euiManager = default!;
[Dependency] private readonly IVoteManager _voteManager = default!;
[Dependency] private readonly DocumentParsingManager _documentParsingManager = default!;
[Dependency] private readonly GhostKickManager _ghostKick = default!;
[Dependency] private readonly ExtendedDisconnectInformationManager _extendedDisconnectInformation = default!;
[Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
[Dependency] private readonly ContentLocalizationManager _contentLoc = default!;
[Dependency] private readonly ContentReplayPlaybackManager _playbackMan = default!;
[Dependency] private readonly IResourceManager _resourceManager = default!;
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!;
//WD-EDIT
[Dependency] private readonly SponsorsManager _sponsorsManager = default!;
[Dependency] private readonly JoinQueueManager _queueManager = default!;
[Dependency] private readonly StalinManager _stalinManager = default!;
[Dependency] private readonly ClientJukeboxSongsSyncManager _jukeboxSyncManager = default!;
[Dependency] private readonly TTSManager _ttsManager = default!;
[Dependency] private readonly ReputationManager _reputationManager = default!;
[Dependency] private readonly IChatAbbreviationManager _chatAbbreviationManager = default!;
//WD-EDIT
public override void Init()
{
ClientContentIoC.Register();
foreach (var callback in TestingCallbacks)
{
var cast = (ClientModuleTestingCallbacks) callback;
cast.ClientBeforeIoC?.Invoke();
}
IoCManager.BuildGraph();
IoCManager.InjectDependencies(this);
_contentLoc.Initialize();
_componentFactory.DoAutoRegistrations();
_componentFactory.IgnoreMissingComponents();
// Do not add to these, they are legacy.
_componentFactory.RegisterClass<SharedGravityGeneratorComponent>();
_componentFactory.RegisterClass<SharedAmeControllerComponent>();
// Do not add to the above, they are legacy
_prototypeManager.RegisterIgnore("utilityQuery");
_prototypeManager.RegisterIgnore("utilityCurvePreset");
_prototypeManager.RegisterIgnore("accent");
_prototypeManager.RegisterIgnore("gasReaction");
_prototypeManager.RegisterIgnore("seed"); // Seeds prototypes are server-only.
_prototypeManager.RegisterIgnore("objective");
_prototypeManager.RegisterIgnore("holiday");
_prototypeManager.RegisterIgnore("htnCompound");
_prototypeManager.RegisterIgnore("htnPrimitive");
_prototypeManager.RegisterIgnore("gameMap");
_prototypeManager.RegisterIgnore("gameMapPool");
_prototypeManager.RegisterIgnore("lobbyBackground");
_prototypeManager.RegisterIgnore("gamePreset");
_prototypeManager.RegisterIgnore("noiseChannel");
_prototypeManager.RegisterIgnore("spaceBiome");
_prototypeManager.RegisterIgnore("worldgenConfig");
_prototypeManager.RegisterIgnore("gameRule");
_prototypeManager.RegisterIgnore("worldSpell");
_prototypeManager.RegisterIgnore("entitySpell");
_prototypeManager.RegisterIgnore("instantSpell");
_prototypeManager.RegisterIgnore("roundAnnouncement");
_prototypeManager.RegisterIgnore("wireLayout");
_prototypeManager.RegisterIgnore("alertLevels");
_prototypeManager.RegisterIgnore("nukeopsRole");
_prototypeManager.RegisterIgnore("stationGoal"); // WD
_prototypeManager.RegisterIgnore("ghostRoleRaffleDecider");
//WD-EDIT
_prototypeManager.RegisterIgnore("loadout");
//WD-EDIT
_componentFactory.GenerateNetIds();
_adminManager.Initialize();
_screenshotHook.Initialize();
_fullscreenHook.Initialize();
_changelogManager.Initialize();
_rulesManager.Initialize();
_viewportManager.Initialize();
_ghostKick.Initialize();
_extendedDisconnectInformation.Initialize();
_jobRequirements.Initialize();
_playbackMan.Initialize();
//WD-EDIT
_stalinManager.Initialize();
_chatAbbreviationManager.Initialize();
//WD-EDIT
//AUTOSCALING default Setup!
_configManager.SetCVar("interface.resolutionAutoScaleUpperCutoffX", 1080);
_configManager.SetCVar("interface.resolutionAutoScaleUpperCutoffY", 720);
_configManager.SetCVar("interface.resolutionAutoScaleLowerCutoffX", 520);
_configManager.SetCVar("interface.resolutionAutoScaleLowerCutoffY", 240);
_configManager.SetCVar("interface.resolutionAutoScaleMinimum", 0.5f);
}
public override void PostInit()
{
base.PostInit();
_stylesheetManager.Initialize();
// Setup key contexts
ContentContexts.SetupContexts(_inputManager.Contexts);
_parallaxManager.LoadDefaultParallax();
_overlayManager.AddOverlay(new SingularityOverlay());
_overlayManager.AddOverlay(new ExplosionShockWaveOverlay());
_overlayManager.AddOverlay(new RadiationPulseOverlay());
// _overlayManager.AddOverlay(new GrainOverlay());
// _overlayManager.AddOverlay(new AtmOverlay());
_chatManager.Initialize();
_clientPreferencesManager.Initialize();
_euiManager.Initialize();
_voteManager.Initialize();
_userInterfaceManager.SetDefaultTheme("SS14DefaultTheme");
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));
_documentParsingManager.Initialize();
//WD-EDIT
_sponsorsManager.Initialize();
_queueManager.Initialize();
_jukeboxSyncManager.Initialize();
_ttsManager.Initialize();
_reputationManager.Initialize();
//WD-EDIT
_baseClient.RunLevelChanged += (_, args) =>
{
if (args.NewLevel == ClientRunLevel.Initialize)
{
SwitchToDefaultState(args.OldLevel == ClientRunLevel.Connected ||
args.OldLevel == ClientRunLevel.InGame);
}
};
// Disable engine-default viewport since we use our own custom viewport control.
_userInterfaceManager.MainViewport.Visible = false;
SwitchToDefaultState();
}
private void SwitchToDefaultState(bool disconnected = false)
{
// Fire off into state dependent on launcher or not.
// Check if we're loading a replay via content bundle!
if (_configManager.GetCVar(CVars.LaunchContentBundle)
&& _resourceManager.ContentFileExists(
ReplayConstants.ReplayZipFolder.ToRootedPath() / ReplayConstants.FileMeta))
{
_logManager.GetSawmill("entry").Info("Loading content bundle replay from VFS!");
var reader = new ReplayFileReaderResources(
_resourceManager,
ReplayConstants.ReplayZipFolder.ToRootedPath());
_replayMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath());
_replayLoad.LoadAndStartReplay(reader);
}
else if (_gameController.LaunchState.FromLauncher)
{
_stateManager.RequestStateChange<LauncherConnecting>();
var state = (LauncherConnecting) _stateManager.CurrentState;
if (disconnected)
{
state.SetDisconnected();
}
}
else
{
_stateManager.RequestStateChange<MainScreen>();
}
}
}
}