コード例 #1
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int InventoryIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (InventoryIndex != -1)
            {
                if (!Main.ingameOptionsWindow && ResearchUI.visible)
                {
                    layers.Insert(InventoryIndex + 1, new LegacyGameInterfaceLayer(
                                      "TDoICore: ResearchUI",
                                      delegate
                    {
                        IResearchUI.Update(Main._drawInterfaceGameTime);
                        ResearchUI.Draw(Main.spriteBatch);

                        return(true);
                    }, InterfaceScaleType.UI));
                }
            }
        }
コード例 #2
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (index != -1)
            {
                layers.Insert(index, new LegacyGameInterfaceLayer(
                                  "ResearchFrom14: ResearchUI",
                                  delegate
                {
                    if (!Main.playerInventory)
                    {
                        ResearchUI.visible = false;
                    }

                    if (ResearchUI.visible)
                    {
                        ui.Draw(Main.spriteBatch);
                    }
                    return(true);
                },
                                  InterfaceScaleType.UI));

                layers.Insert(index, new LegacyGameInterfaceLayer(
                                  "ResearchFrom14: PrefixUI",
                                  delegate
                {
                    if (!Main.playerInventory)
                    {
                        PrefixUI.visible = false;
                    }

                    if (PrefixUI.visible)
                    {
                        preUI.Draw(Main.spriteBatch);
                    }
                    return(true);
                },
                                  InterfaceScaleType.UI));
            }
        }