コード例 #1
0
		////////////////

		public void LoadGameMode() {
			if( LicensesMod.Config.DebugModeInfo ) {
				LogHelpers.Alert( "Loading game mode..." );
			}

			NihilismAPI.InstancedFiltersOn();
			NihilismAPI.OnSyncOrWorldLoad( ( isSync ) => {
				if( isSync ) { return; }
				this.LoadNihilismFilters();
				NihilismAPI.NihilateCurrentWorld( true );
			}, 0f );

			LoadHooks.AddWorldLoadEachHook( () => {
				if( LicensesMod.Config.RemoveRewardsGrinding ) {
					RewardsPointsConfig rewConfig = ModContent.GetInstance<RewardsPointsConfig>();
					rewConfig.GrindKillMultiplier = 0f;
				}
				if( LicensesMod.Config.ForceSpawnWayfarer ) {
					RewardsAPI.SpawnWayfarer( false );
				}
				
				this.LoadLicensePacks();
			} );

			this.PostLoadGameMode();

			if( LicensesMod.Config.DebugModeInfo ) {
				LogHelpers.Alert( "Finished loading game mode" );
			}
		}
コード例 #2
0
        ////////////////

        internal InboxMessages()
        {
            this.Current = 0;

            LoadHooks.AddWorldLoadEachHook(() => {
                bool success = this.LoadFromFile();
            });
        }
コード例 #3
0
        ////////////////

        public PaintLayer()
        {
            this.Colors = new Dictionary <ushort, IDictionary <ushort, Color> >();
            this.Glows  = new Dictionary <ushort, IDictionary <ushort, byte> >();

            LoadHooks.AddWorldLoadEachHook(() => {
                Main.OnPreDraw += this.RefreshTilesOnMap;
            });
            LoadHooks.AddWorldUnloadEachHook(() => {
                Main.OnPreDraw -= this.RefreshTilesOnMap;
                this.ClearTilesOnMap();
            });
        }
コード例 #4
0
        ////////////////

        internal LoadHelpers()
        {
            LoadHooks.AddWorldLoadEachHook(() => {
                this.WorldStartupDelay = 0;
            });
            LoadHooks.AddWorldUnloadEachHook(() => {
                this.WorldStartupDelay       = 0;
                this.IsClientPlaying_Hackish = false;
            });
            LoadHooks.AddPostWorldUnloadEachHook(() => {              // Redundant?
                this.WorldStartupDelay       = 0;
                this.IsClientPlaying_Hackish = false;
            });
        }
        ////////////////

        private void InitializeToggler()
        {
            this.IsTogglerLit = false;

            LoadHooks.AddWorldLoadEachHook(() => {
                var uiModCtrlPanel = (UIModControlPanelTab)ModHelpersMod.Instance.ControlPanel.DefaultTab;
                int modUpdateCount = uiModCtrlPanel.GetModUpdatesAvailable();

                if (modUpdateCount > 0)
                {
                    InboxMessages.SetMessage("mod_updates", modUpdateCount + " mod updates available. See mod browser.", true);
                }
            });
        }
コード例 #6
0
        public override void Load()
        {
            LoadHooks.AddWorldLoadEachHook(delegate {
                this.CurrentNetMode = Main.netMode;
            });

            CustomLoadHooks.AddHook(ResetModeMod.WorldExitValidator, (_) => {
                this.CurrentNetMode = -1;
                return(true);
            });

            this.Session.OnModLoad();

            DataDumper.SetDumpSource("ResetMode", () => {
                return(ResetModeMod.Instance.Session.Data.ToString());
            });
        }