Exemple #1
0
        protected override void OnEnter(object data)
        {
            if (this.PlayerWho != Main.myPlayer)
            {
                return;
            }

            var myplayer = TmlHelpers.SafelyGetModPlayer <RewardsPlayer>(this.Player);

            if (Main.netMode == 0)
            {
                myplayer.OnConnectSingle();
            }
            if (Main.netMode == 1)
            {
                myplayer.OnConnectCurrentClient();
            }

            InboxMessages.SetMessage("RewardsModConfigUpdate",
                                     "Rewards config files updated to use ModConfig (tML v0.11+). The old config files " +
                                     "(Rewards Config.json, Rewards Points Config.json, Rewards Shop Config.json) are now obsolete. " +
                                     "If any mod settings have been changed from their defaults in the past, you'll need to import them " +
                                     "manually (preferably via. the menu's Mod Configuration).",
                                     false
                                     );
        }
Exemple #2
0
        public override void OnEnterWorld(Player player)
        {
            if (player.whoAmI != Main.myPlayer)
            {
                return;
            }
            if (this.player.whoAmI != Main.myPlayer)
            {
                return;
            }

            var mymod = (StarvationMod)this.mod;

            if (Main.netMode == 0)
            {
                this.OnConnectSingle();
            }
            else if (Main.netMode == 1)
            {
                this.OnConnectClient();
            }

            if (mymod.Config.CraftableUnlifeCrystal && mymod.Config.AddedWellFedDrainRatePerTickMultiplierPerMaxHealthOver100 > 0)
            {
                if (mymod.Config.UnlifeCrystalReturnsLifeCrystal)
                {
                    InboxMessages.SetMessage("StarvationUnlifeTip", "Craft and use Unlife Crystals to lower max HP to reduce hunger drain while traveling (produces Life Crystals on use).", false);
                }
                else
                {
                    InboxMessages.SetMessage("StarvationUnlifeTip", "Craft and use Unlife Crystals to lower max HP to reduce hunger drain while traveling.", false);
                }
            }
        }
Exemple #3
0
        public override void PostAddRecipes()
        {
            var mymod = OnARailMod.Instance;

            if (mymod.Config.ExtensibleInventoryDefaultRestrictedToTrain)
            {
                var ei_mod = ModLoader.GetMod("ExtensibleInventory");

                if (ei_mod != null)
                {
                    InboxMessages.SetMessage("OnARailExtensibleInventoryAlert", "Extensible Inventory is now available from your train. See config settings for options.", false);
                }
            }

            if (mymod.Config.DebugModeReset)
            {
                Promises.AddSafeWorldLoadEachPromise(() => {
                    foreach (ModTileEntity ent in ModTileEntity.ByID.Values.ToArray())
                    {
                        if (ent is TrainTunnelTileEntity)
                        {
                            ModTileEntity.ByID.Remove(ent.ID);
                            ModTileEntity.ByPosition.Remove(ent.Position);
                        }
                    }
                });
            }
        }
        public override void OnEnterWorld(Player player)
        {
            if (player.whoAmI != Main.myPlayer)
            {
                return;
            }
            if (this.player.whoAmI != Main.myPlayer)
            {
                return;
            }

            var mymod = (ExtensibleInventoryMod)this.mod;

            if (!mymod.Config.EnableSharedInventoryRecipesViaRecipeHack)
            {
                InboxMessages.SetMessage("ExtensibleInventoryRecipeHackAlert",
                                         "As of v1.4.1.3, Extensible Inventory disables recipes between shared pages, due to compatibility issues. If you want to risk using it, simply enable the EnableSharedInventoryRecipesViaRecipeHack setting.",
                                         false
                                         );
            }

            if (Main.netMode == 0)
            {
                this.OnConnectSingle();
            }
            else if (Main.netMode == 1)
            {
                this.OnConnectClient();
            }

            string msg = "You can now quickly scroll inventory pages by selecting an item and using the mouse wheel while viewing your inventory.";

            InboxMessages.SetMessage("ExtensibleInventoryScroll", msg, false);
        }
Exemple #5
0
 public override void PostSetupContent()
 {
     InboxMessages.SetMessage(
         "LivesFeaturingContinues",
         "As of v2.0.0, Lives mod now features continues. These need to be enabled by config. Set \"ContinuesLimit\" to -1 for unlimited continues, or > 0 for a finite amount.",
         false
         );
 }
        public void ReadLatestMessage()
        {
            string msg = InboxMessages.DequeueMessage();

            if (msg == null)
            {
                return;
            }

            Main.NewText("New message: " + msg, Color.LightYellow);
            this.MessageScrollPos = this.Messages.Current - 1;
        }
        ////////////////

        public bool ReadOldMessage(int pos)
        {
            bool   isUnread;
            string msg = InboxMessages.GetMessageAt(pos, out isUnread);

            if (msg != null && !isUnread)
            {
                Main.NewText("Message " + (pos + 1) + "/" + this.Messages.Current + ": " + msg, Color.Gray);
                return(true);
            }
            return(false);
        }
Exemple #8
0
        ////////////////

        public bool ReadOldMessage(int pos)
        {
            string msg;

            if (!InboxMessages.GetMessageAt(pos, out msg) || msg != null)
            {
                Main.NewText("Message " + (pos + 1) + "/" + this.Messages.Current + ": " + msg, Color.Gray);
                return(true);
            }

            return(false);
        }
Exemple #9
0
        ////////////////

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

            Promises.AddWorldLoadEachPromise(() => {
                int mod_update_count = this.ModUpdatesAvailable();

                if (mod_update_count > 0)
                {
                    InboxMessages.SetMessage("mod_updates", mod_update_count + " mod updates available. See mod browser.", true);
                }
            });
        }
        ////

        internal void FinishModSettingsSync()
        {
            string msg = "Want to summon custom invasions? Craft a Cross Dimensional Aggregator item at a Tinkerer's Workship with: ";

            if (DynamicInvasionsMod.Config.MirrorsPerAggregator > 0)
            {
                msg += DynamicInvasionsMod.Config.MirrorsPerAggregator + "x Magic/Ice Mirror, ";
            }
            msg += DynamicInvasionsMod.Config.BannersPerAggregator + "x monster banners (any), ";
            msg += "1x Music Box (recorded)";

            InboxMessages.SetMessage("DynamicInvasionsRecipe", msg, false);
        }
Exemple #11
0
        ////////////////

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

            Promises.AddWorldLoadEachPromise(() => {
                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);
                }
            });
        }
        public override void Load()
        {
            //ErrorLogger.Log( "Loading Mod Helpers. Ensure you have .NET Framework v4.6+ installed, if you're having problems." );
            //if( Environment.Version < new Version( 4, 0, 30319, 42000 ) ) {
            //	SystemHelpers.OpenUrl( "https://dotnet.microsoft.com/download/dotnet-framework-runtime" );
            //	throw new FileNotFoundException( "Mod Helpers "+this.Version+" requires .NET Framework v4.6+ to work." );
            //}

            this.LoadFull();

            InboxMessages.SetMessage("ModHelpers:ControlPanelTags",
                                     "Mod tag lists have now been added to the Control Panel. Mod tags can be modified in the Mod Info menu page via. the main menu.",
                                     false
                                     );
        }
        ////////////////

        public void Welcome(Player player)
        {
            var mymod = ResetModeMod.Instance;

            if (!mymod.Config.AutoStartSession)
            {
                if (Main.netMode == 0)
                {
                    InboxMessages.SetMessage("reset_mode_welcome", "Type /rm-start to start Reset Mode. Type /help for a list of other available commands.", true);
                }
                else
                {
                    InboxMessages.SetMessage("reset_mode_welcome", "Type rm-start in the server console to start Reset Mode.", true);
                }
            }
        }
        public static OutgoingInboxMessage Parse(InboxMessages x)
        {
            if (x == null)
            {
                return(null);
            }

            return(new OutgoingInboxMessage
            {
                Id = x.Id,
                DateSent = x.DateSent,
                MiscellaneousHtmlId = x.MiscellaneousId,
                Title = x.MiscellaneousHtmlTable.PageName,
                UserSentBy = OutgoingMinimalUser.Parse(x.UserSentBy)
            });
        }
        ////////////////

        internal void Draw(SpriteBatch sb)
        {
            int     unread   = InboxMessages.CountUnreadMessages();
            var     rect     = new Rectangle((int)this.IconPos.X, (int)this.IconPos.Y, this.Icon.Width, this.Icon.Height);
            bool    isHover  = UIHelpers.MouseInRectangle(rect);
            Vector2 mousePos = new Vector2(Main.mouseX + 16, Main.mouseY);

            if (Main.mouseLeft && isHover)
            {
                if (!this.IsIconClicked)
                {
                    this.IsIconClicked = true;

                    if (unread > 0)
                    {
                        this.ReadLatestMessage();
                        unread--;
                    }
                }
            }
            else
            {
                this.IsIconClicked = false;
            }

            if (unread <= 0)
            {
                if (Main.playerInventory)
                {
                    if (isHover)
                    {
                        sb.DrawString(Main.fontMouseText, "No new messages", mousePos, Color.LightGray);
                    }
                    this.DrawIcon(sb);
                }
            }
            else
            {
                string msg = unread == 1 ? unread + " new message!" : unread + " new messages!";

                if (isHover)
                {
                    sb.DrawString(Main.fontMouseText, msg, mousePos, Color.White);
                }
                this.DrawIconLit(sb, unread);
            }
        }
Exemple #16
0
        ////////////////

        public override void Load()
        {
            BetterPaintMod.Instance = this;

            LoadHooks.AddPostWorldLoadEachHook(() => {
                string intro1    = "1 of 5 - Eager to try out better painting? You'll need a Paint Blaster, crafted via " + (this.Config.PaintBlasterRecipeClentaminator ? "Clentaminator" : "Illegal Gun Parts") + " and Paint Sprayer at a Tinkerer's Workshop.";
                string intro2    = "2 of 5 - To make paint, you'll need a Paint Mixer, crafted via Dye Vat" + (this.Config.PaintMixerRecipeBlendOMatic ? ", Blend-O-Matic, " : " ") + "and Extractinator at a Tinkerer's Workshop.";
                string intro3    = "3 of 5 - To paint, you'll need Color Cartridges, crafted via colored Paints (any " + this.Config.PaintRecipePaints + ") and Gel (" + this.Config.PaintRecipeGels + ") at a Paint Mixer.";
                string postIntro = "4 of 5 - Use the Control Panel (single player only) to configure settings, including whether the Painter NPC should sell Better Paint items, if crafting isn't your cup of tea.";
                string pander    = "5 of 5 - If you enjoy this mod and want to see more, please give your support at: https://www.patreon.com/hamstar0";

                InboxMessages.SetMessage("BetterPaintIntro1", intro1, false);
                InboxMessages.SetMessage("BetterPaintIntro2", intro2, false);
                InboxMessages.SetMessage("BetterPaintIntro3", intro3, false);
                InboxMessages.SetMessage("BetterPaintPostIntro", postIntro, false);
                InboxMessages.SetMessage("BetterPaintPander", pander, false);

                if (Main.netMode != 0)
                {
                    InboxMessages.SetMessage("BetterPaintNoMuliYet", "Better Paint (as of v1.2.0) is not yet compatible with multiplayer.", true);
                }
            });
        }