Beispiel #1
0
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

    /// <inheritdoc />
    public override void Entry(IModHelper helper)
    {
        I18n.Init(this.Helper.Translation);
        MultiplayerHelper = this.Helper.Multiplayer;
        ModMonitor        = this.Monitor;
        UNIQUEID          = this.ModManifest.UniqueID;
        Config            = AtraUtils.GetConfigOrDefault <ModConfig>(helper, this.Monitor);

        helper.Events.GameLoop.GameLaunched    += this.OnGameLaunched;
        helper.Events.GameLoop.SaveLoaded      += this.OnSaveLoaded;
        helper.Events.GameLoop.Saving          += this.OnSaving;
        helper.Events.GameLoop.ReturnedToTitle += this.OnReturnedToTitle;

        helper.Events.Multiplayer.ModMessageReceived += this.Multiplayer_ModMessageReceived;
        helper.Events.Multiplayer.PeerConnected      += this.Multiplayer_PeerConnected;

        helper.Events.Player.Warped += this.OnPlayerWarp;

        helper.Events.GameLoop.DayEnding  += this.OnDayEnd;
        helper.Events.Input.ButtonPressed += this.OnButtonPressed;

        helper.Events.Content.AssetRequested += this.OnAssetRequested;

#if DEBUG
        helper.Events.Input.ButtonPressed += this.DebugOutput;
#endif
    }
Beispiel #2
0
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

    /// <inheritdoc/>
    public override void Entry(IModHelper helper)
    {
        I18n.Init(helper.Translation);
        ModMonitor        = this.Monitor;
        GameContentHelper = this.Helper.GameContent;
        MultiplayerHelper = this.Helper.Multiplayer;
        InputHelper       = this.Helper.Input;
        UNIQUEID          = this.ModManifest.UniqueID;
        Config            = AtraUtils.GetConfigOrDefault <ModConfig>(helper, this.Monitor);

        helper.Events.GameLoop.GameLaunched    += this.OnGameLaunch;
        helper.Events.GameLoop.SaveLoaded      += this.SaveLoaded;
        helper.Events.GameLoop.Saving          += this.BeforeSaving;
        helper.Events.Player.Warped            += this.Player_Warped;
        helper.Events.GameLoop.ReturnedToTitle += this.ReturnedToTitle;

        helper.Events.Content.AssetRequested    += this.OnAssetRequested;
        helper.Events.Content.AssetsInvalidated += this.OnAssetInvalidated;
        helper.Events.Content.LocaleChanged     += this.OnLocaleChange;

        helper.Events.Multiplayer.ModMessageReceived += this.OnModMessageRecieved;
        helper.Events.Multiplayer.PeerConnected      += this.OnPlayerConnected;

        this.ApplyPatches(new Harmony(this.ModManifest.UniqueID));
    }
Beispiel #3
0
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

    /// <inheritdoc />
    public override void Entry(IModHelper helper)
    {
        I18n.Init(helper.Translation);
        ModMonitor = this.Monitor;

        helper.Events.Content.AssetRequested += this.OnAssetRequested;
        Config = AtraUtils.GetConfigOrDefault <ModConfig>(helper, this.Monitor);

        helper.Events.GameLoop.GameLaunched += this.OnGameLaunched;
        helper.Events.GameLoop.SaveLoaded   += this.OnSaveLoaded;
        helper.Events.GameLoop.Saved        += this.OnSaved;
    }
Beispiel #4
0
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.

    /// <inheritdoc/>
    public override void Entry(IModHelper helper)
    {
        ModMonitor = this.Monitor;

        StringUtils.Initialize(this.Monitor);
        GameContentHelper = helper.GameContent;
        TranslationHelper = helper.Translation;

        I18n.Init(helper.Translation);
        Config = AtraUtils.GetConfigOrDefault <ModConfig>(helper, this.Monitor);

        helper.Events.GameLoop.GameLaunched += this.OnGameLaunched;

        helper.Events.Player.Warped             += this.Player_Warped;
        helper.Events.Content.AssetRequested    += this.OnAssetRequested;
        helper.Events.Content.LocaleChanged     += this.OnLocaleChanged;
        helper.Events.Content.AssetsInvalidated += this.OnAssetInvalidated;
    }