Exemplo n.º 1
0
        ////////////////

        public override void PostDrawTiles()
        {
//DataStore.Add( DebugHelpers.GetCurrentContext()+"_A", 1 );
            Player player = Main.LocalPlayer;

            if (player == null)
            {
                return;
            }
            RasterizerState rasterizer = Main.gameMenu ||
                                         (double)player.gravDir == 1.0 ?
                                         RasterizerState.CullCounterClockwise : RasterizerState.CullClockwise;

            bool _;

            XnaHelpers.DrawBatch(
                (sb) => {
                var mymod = (ModHelpersMod)this.mod;
                mymod.CustomEntMngr?.DrawPostTilesAll(sb);
                DebugHelpers.DrawAllRects(sb);
            },
                SpriteSortMode.Deferred,
                BlendState.AlphaBlend,
                Main.DefaultSamplerState,
                DepthStencilState.None,
                rasterizer,
                (Effect)null,
                Main.GameViewMatrix.TransformationMatrix,
                out _
                );
//DataStore.Add( DebugHelpers.GetCurrentContext()+"_B", 1 );
        }
        ////////////////

        internal void Draw()
        {
            if (Main.mouseLeft && this.IsMouseOverMenuItem())
            {
                this.MenuItemScale = 0.8f;

                Main.PlaySound(11);

                this.MyAction();
            }
            else
            {
                bool _;
                XnaHelpers.DrawBatch((sb) => this.DrawMenuItem(),
                                     SpriteSortMode.Deferred,
                                     BlendState.AlphaBlend,
                                     SamplerState.LinearClamp,
                                     DepthStencilState.None,
                                     RasterizerState.CullCounterClockwise,
                                     null,
                                     Main.UIScaleMatrix,
                                     out _
                                     );
            }
        }
        public void UnloadOuter()
        {
            this.ReflectionHelpers         = null;
            this.PacketProtocolMngr        = null;
            this.ExceptionMngr             = null;
            this.Timers                    = null;
            this.ConfigJson                = null;
            this.LogHelpers                = null;
            this.ModFeaturesHelpers        = null;
            this.BuffHelpers               = null;
            this.NetHelpers                = null;
            this.ItemIdentityHelpers       = null;
            this.NPCIdentityHelpers        = null;
            this.ProjectileIdentityHelpers = null;
            this.BuffIdentityHelpers       = null;
            this.NPCBannerHelpers          = null;
            this.RecipeIdentityHelpers     = null;
            this.RecipeGroupHelpers        = null;
            this.PlayerHooks               = null;
            this.LoadHelpers               = null;
            this.GetModInfo                = null;
            this.GetModTags                = null;
            this.WorldStateHelpers         = null;
            this.ModLock                   = null;
            this.EntityGroups              = null;
            this.AnimatedColors            = null;
            this.PlayerMessages            = null;
            this.Inbox                 = null;
            this.ControlPanel          = null;
            this.MenuItemMngr          = null;
            this.MenuContextMngr       = null;
            this.MusicHelpers          = null;
            this.PlayerIdentityHelpers = null;
            this.CustomEntMngr         = null;
            this.Promises              = null;
            this.DataStore             = null;
            this.CustomHotkeys         = null;
            this.XnaHelpers            = null;
            this.ServerInfo            = null;
            //this.PlayerDataMngr = null;
            this.SupportInfo    = null;
            this.RecipeHack     = null;
            this.ModListHelpers = null;

            this.ControlPanelHotkey = null;
            this.DataDumpHotkey     = null;
        }
        private void LoadOuter()
        {
            this.ReflectionHelpers = new ReflectionHelpers();
            this.DataStore         = new DataStore();
            this.Promises          = new Promises();
            this.LoadHelpers       = new LoadHelpers();

            this.Timers             = new Timers();
            this.LogHelpers         = new LogHelpers();
            this.ModFeaturesHelpers = new ModFeaturesHelpers();
            this.PacketProtocolMngr = new PacketProtocolManager();

            this.BuffHelpers               = new BuffHelpers();
            this.NetHelpers                = new NetHelpers();
            this.ItemIdentityHelpers       = new ItemIdentityHelpers();
            this.NPCIdentityHelpers        = new NPCIdentityHelpers();
            this.ProjectileIdentityHelpers = new ProjectileIdentityHelpers();
            this.BuffIdentityHelpers       = new BuffIdentityHelpers();
            this.NPCBannerHelpers          = new NPCBannerHelpers();
            this.RecipeIdentityHelpers     = new RecipeIdentityHelpers();
            this.RecipeGroupHelpers        = new RecipeGroupHelpers();
            this.PlayerHooks               = new ExtendedPlayerHooks();
            this.WorldStateHelpers         = new WorldStateHelpers();
            this.ControlPanel              = new UIControlPanel();
            this.ModLock               = new ModLockService();
            this.EntityGroups          = new EntityGroups();
            this.PlayerMessages        = new PlayerMessages();
            this.Inbox                 = new InboxControl();
            this.GetModInfo            = new GetModInfo();
            this.GetModTags            = new GetModTags();
            this.MenuItemMngr          = new MenuItemManager();
            this.MenuContextMngr       = new MenuContextServiceManager();
            this.MusicHelpers          = new MusicHelpers();
            this.PlayerIdentityHelpers = new PlayerIdentityHelpers();
            this.CustomEntMngr         = new CustomEntityManager();
            this.CustomHotkeys         = new CustomHotkeys();
            this.XnaHelpers            = new XnaHelpers();
            this.ServerInfo            = new ServerInfo();
            //this.PlayerDataMngr = new PlayerDataManager();
            this.SupportInfo    = new SupportInfoDisplay();
            this.RecipeHack     = new RecipeHack();
            this.ModListHelpers = new ModListHelpers();
        }
Exemplo n.º 5
0
        ////////////////

        private static void _Draw(GameTime gt)
        {
            if (!Main.gameMenu)
            {
                return;
            }
            if (Main.spriteBatch == null)
            {
                return;
            }

            var mymod = ModHelpersMod.Instance;

            if (mymod == null || mymod.Config == null || mymod.Config.DisableSupportLinks || Main.MenuUI == null)
            {
                return;
            }

            try {
                if (Main.MenuUI.CurrentState != null)
                {
                    Type uiType = Main.MenuUI.CurrentState.GetType();

                    if (uiType.Name != "UIMods" && MenuContextService.ContainsMenuContexts(uiType.Name))
                    {
                        return;
                    }
                }

                bool _;
                XnaHelpers.DrawBatch((sb) => {
                    mymod.SupportInfo?.Update();
                    mymod.SupportInfo?.Draw(sb);
                }, out _);
            } catch (Exception e) {
                LogHelpers.LogOnce(e.ToString());
            }
        }
Exemplo n.º 6
0
        private static void _DrawPostDrawAll(GameTime _)
        {
            var mymod = ModHelpersMod.Instance;

            if (mymod == null)
            {
                return;
            }
            var entMngr = mymod.CustomEntMngr;

            if (entMngr == null)
            {
                return;
            }
            if (entMngr.WorldEntitiesByIndexes.Count == 0)
            {
                return;
            }

            bool __;

            XnaHelpers.DrawBatch(
                (sb) => {
                var mymod2 = ModHelpersMod.Instance;
                mymod2.CustomEntMngr.DrawPostDrawAll(sb);
            },
                SpriteSortMode.Deferred,
                BlendState.AlphaBlend,
                Main.DefaultSamplerState,
                DepthStencilState.None,
                Main.instance.Rasterizer,
                null,
                Main.BackgroundViewMatrix.TransformationMatrix,
                out __
                );
        }