public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int MouseTextIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));
            int Setting        = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Ingame Options"));

            layers[Setting] = new LegacyGameInterfaceLayer(
                "Vanilla: Ingame Options",
                delegate
            {
                if (Main.ingameOptionsWindow)
                {
                    newSetting.Draw(Main.spriteBatch);
                }

                return(true);
            },
                InterfaceScaleType.UI);

            layers.Insert(MouseTextIndex, new LegacyGameInterfaceLayer(
                              "AchievementsLibs : Mod Achievement List",
                              delegate
            {
                if (AchievementUI.visible)
                {
                    Main.playerInventory = false;
                    achievementUI.Draw(Main.spriteBatch);
                }
                return(true);
            },
                              InterfaceScaleType.UI)
                          );
        }
Пример #2
0
        public override void Load()
        {
            if (harmonyInstance == null)
            {
                harmonyInstance = HarmonyInstance.Create(Name);
            }

            harmonyInstance.PatchAll();

            keyToggle   = RegisterHotKey("Toggle", "NumPad1");
            keyStep     = RegisterHotKey("Step", "NumPad2");
            keyAutoStep = RegisterHotKey("Auto step", "NumPad3");
            keySettings = RegisterHotKey("Settings", "NumPad5");

            if (!Main.dedServ)
            {
                settingsUI    = new SettingsUI();
                userInterface = new UserInterface();
                userInterface.SetState(settingsUI);
                settingsUI.Activate();
                UILayer = new LegacyGameInterfaceLayer("MechScope: Settings menu",
                                                       delegate
                {
                    if (settingsUI.Visible)
                    {
                        settingsUI.Draw(Main.spriteBatch);
                        userInterface.Update(Main._drawInterfaceGameTime);
                    }
                    return(true);
                }
                                                       );
            }
        }
Пример #3
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Resource Bars"));

            if (idx == -1)
            {
                return;
            }

            var main_ui_layer = new LegacyGameInterfaceLayer("Stamina: Main Meter", this.StaminaBarUIDraw, InterfaceScaleType.UI);

            layers.Insert(idx + 1, main_ui_layer);

            int mouseTextIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));

            if (idx != -1)
            {
                layers.Insert(mouseTextIndex, new LegacyGameInterfaceLayer(
                                  "GHNM: Darkness",
                                  delegate {
                    if (darkUI.visible)
                    {
                        darknessInterface.Draw(Main.spriteBatch, new GameTime());
                    }
                    return(true);
                },
                                  InterfaceScaleType.UI)
                              );
            }
        }
Пример #4
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));

            if (idx == -1)
            {
                return;
            }

            //

            GameInterfaceDrawMethod debugDrawCallback = () => {
                try {
                    ModContent.GetInstance <PlayerMessages>().Draw(Main.spriteBatch);
                } catch (Exception e) {
                    LogLibraries.Warn(e.ToString());
                }
                return(true);
            };

            //

            if (LoadLibraries.IsCurrentPlayerInGame())
            {
                var debugLayer = new LegacyGameInterfaceLayer("ModLibsGeneral: Debug Display",
                                                              debugDrawCallback,
                                                              InterfaceScaleType.UI);
                layers.Insert(idx, debugLayer);
            }
        }
Пример #5
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            if (DynamicInvasionsMod.Config == null || !DynamicInvasionsMod.Config.Enabled)
            {
                return;
            }
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Invasion Progress Bars"));

            if (idx != -1)
            {
                var func = new GameInterfaceDrawMethod(delegate() {
                    if (Main.netMode != 2)                                 // Not server
                    {
                        var modworld = ModContent.GetInstance <DynamicInvasionsWorld>();

                        if (modworld.Logic.RunProgressBarAnimation())
                        {
                            modworld.Logic.DrawProgressBar(Main.spriteBatch);
                        }
                    }
                    return(true);
                });
                var layer = new LegacyGameInterfaceLayer(
                    "DynamicInvasions: Progress",
                    func,
                    InterfaceScaleType.UI
                    );

                layers.Insert(idx, layer);
            }
        }
Пример #6
0
        ////////////////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (idx == -1)
            {
                return;
            }

            GameInterfaceDrawMethod func = delegate {
                Player player   = Main.LocalPlayer;
                Item   heldItem = player.HeldItem;

                if (heldItem == null || heldItem.IsAir || heldItem.type != ModContent.ItemType <PaintBlasterItem>())
                {
                    return(true);
                }

                var myitem = (PaintBlasterItem)heldItem.modItem;

                if (myitem.IsUsingUI)
                {
                    myitem.DrawPainterUI(Main.spriteBatch);
                }
                myitem.DrawScreen(Main.spriteBatch);
                myitem.DrawHUD(Main.spriteBatch);

                return(true);
            };

            var interfaceLayer = new LegacyGameInterfaceLayer("BetterPaint: Paint Blaster UI", func, InterfaceScaleType.UI);

            layers.Insert(idx, interfaceLayer);
        }
Пример #7
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            Mod      mod       = ModLoader.GetMod("Events");
            Player   player    = Main.LocalPlayer;
            MyPlayer modPlayer = player.GetModPlayer <MyPlayer>(mod);

            if (MyWorld.activeEvents.Count > 0 && modPlayer.weatherTech == true)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                LegacyGameInterfaceLayer eventThing = new LegacyGameInterfaceLayer("event:thing",
                                                                                   delegate
                {
                    DrawEventAcc(Main.spriteBatch);
                    return(true);
                },
                                                                                   InterfaceScaleType.UI);
                layers.Insert(index, eventThing);
            }

            int inventoryLayerIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));

            if (inventoryLayerIndex != -1)
            {
                layers.Insert(inventoryLayerIndex, new LegacyGameInterfaceLayer(
                                  "RecipeBrowser: UI",
                                  delegate
                {
                    eventsUserInterface.Draw(Main.spriteBatch, new GameTime());
                    return(true);
                },
                                  InterfaceScaleType.UI)
                              );
            }
        }
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));

            if (idx == -1)
            {
                return;
            }

            //

            GameInterfaceDrawMethod cpDrawCallback = () => {
                this.DrawCP(Main.spriteBatch);
                return(true);
            };

            //

            if (LoadLibraries.IsCurrentPlayerInGame())
            {
                var cpLayer = new LegacyGameInterfaceLayer("ModControlPanel: Control Panel",
                                                           cpDrawCallback,
                                                           InterfaceScaleType.UI);
                layers.Insert(idx, cpLayer);
            }
        }
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int layerIdx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (layerIdx == -1)
            {
                return;
            }

            GameInterfaceDrawMethod invOver = delegate {
                if (!Main.playerInventory)
                {
                    return(true);
                }

                var mymod = EncumbranceMod.Instance;
                if (mymod.Config.BurdenedItemSlotOverlayOpacity == 0f)
                {
                    return(true);
                }

                var myplayer = (EncumbrancePlayer)TmlHelpers.SafelyGetModPlayer(Main.LocalPlayer, this, "EncumbrancePlayer");
                int capacity = myplayer.GetCurrentCapacity();

                float invScale = 0.85f;
                //if( (plr.chest != -1 || Main.npcShop > 0) && !Main.recBigList ) {
                //	inv_scale = 0.755f;
                //}

                for (int i = 0; i < 10; i++)
                {
                    for (int j = 0; j < 5; j++)
                    {
                        int idx = i + j * 10;

                        if (idx < capacity)
                        {
                            continue;
                        }

                        Texture2D tex   = this.ShadowBox;
                        int       posX  = (int)(20f + ((float)i * 56f) * invScale);
                        int       posY  = (int)(20f + ((float)j * 56f) * invScale);
                        var       pos   = new Vector2(posX, posY);
                        Color     color = Color.White * mymod.Config.BurdenedItemSlotOverlayOpacity;

                        Main.spriteBatch.Draw(tex, pos, null, color, 0f, default(Vector2), invScale, SpriteEffects.None, 1f);
                    }
                }

                return(true);
            };

            var invOverLayer = new LegacyGameInterfaceLayer("Encumbrance: Inventory Overlay", invOver, InterfaceScaleType.UI);

            layers.Insert(layerIdx + 1, invOverLayer);
        }
Пример #10
0
        ////////////////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int layerIdx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (layerIdx == -1)
            {
                return;
            }

            GameInterfaceDrawMethod controlUi = delegate {
                if (!Main.playerInventory || Main.myPlayer < 0 || Main.LocalPlayer == null || !Main.LocalPlayer.active)
                {
                    if (Main.LocalPlayer != null && !Main.LocalPlayer.active)
                    {
                        TmlHelpers.SafelyGetModPlayer <ExtensibleInventoryPlayer>(Main.LocalPlayer);
                        if (!Main.LocalPlayer.active)
                        {
                            return(true);
                        }
                    }
                    //if( Main.playerInventory ) {
                    //	LogHelpers.LogOnce( ""+(Main.myPlayer<0)+","+(Main.LocalPlayer == null)+","+(!Main.LocalPlayer.active) );
                    //}
                    return(true);
                }

                var mymod = ExtensibleInventoryMod.Instance;

                try {
                    mymod.InvUIMngr?.Update(Main._drawInterfaceGameTime);
                    mymod.InvUI?.Draw(Main.spriteBatch);

                    if (!this.Config.HideScrollModeIcon)
                    {
                        var myplayer = TmlHelpers.SafelyGetModPlayer <ExtensibleInventoryPlayer>(Main.LocalPlayer);
                        if (myplayer.ScrollModeOn & this.ScrollIcon != null)
                        {
                            var   pos        = new Vector2(Main.mouseX - 24, Main.mouseY);
                            float colorScale = 0.35f * ((float)myplayer.ScrollModeDuration / (float)ExtensibleInventoryPlayer.ScrollModeMaxDuration);

                            Main.spriteBatch.Draw(this.ScrollIcon, pos, Color.White * colorScale);
                        }
                    }
                } catch (Exception e) {
                    throw new ModHelpersException("", e);
                }

                return(true);
            };

            var invOverLayer = new LegacyGameInterfaceLayer("Extensible Inventory: Page Controls", controlUi, InterfaceScaleType.UI);

            layers.Insert(layerIdx + 1, invOverLayer);
        }
Пример #11
0
        public override void Unload()
        {
            harmonyInstance.UnpatchAll();

            keyToggle     = null;
            keyStep       = null;
            keyAutoStep   = null;
            keySettings   = null;
            settingsUI    = null;
            userInterface = null;
            UILayer       = null;
        }
Пример #12
0
        private void AddTilePlacementInterfaceLayer(List <GameInterfaceLayer> layers, int layerIdx)
        {
            bool placementUI()
            {
                TilesInterfaceLogic.DrawCurrentTilePlacementOutline();
                TilesInterfaceLogic.DrawCurrentTilePlacementGuides();
                return(true);
            };

            var tradeLayer = new LegacyGameInterfaceLayer("Ergophobia: Placement Indicators", placementUI, InterfaceScaleType.UI);

            layers.Insert(layerIdx, tradeLayer);
        }
Пример #13
0
        ////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int barsIdx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Resource Bars"));

            if (barsIdx == -1)
            {
                return;
            }

            int npcChatIdx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: NPC / Sign Dialog"));

            if (npcChatIdx == -1)
            {
                return;
            }

            int topIdx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Over"));

            if (topIdx == -1)
            {
                return;
            }

            //

            var particleLayer = new LegacyGameInterfaceLayer(
                "Necrotis: UI Particles",
                () => {
                CustomParticle.DrawParticles(Main.spriteBatch, false);
                return(true);
            },
                InterfaceScaleType.UI
                );

            /*var hoverLayer = new LegacyGameInterfaceLayer(
             *      "Necrotis: Ankh Hover Tooltip",
             *      drawAnkhHoverTip,
             *      InterfaceScaleType.UI
             * );*/

            GameInterfaceLayer npcButtonWDLayer = this.GetInterfaceLayer_NpcChatButton_WitchDoctor_HealNecrotis();

            //

            layers.Add(particleLayer);                  //barsIdx + 1

            //layers.Insert( topIdx + 1, hoverLayer );

            layers.Insert(npcChatIdx + 1, npcButtonWDLayer);
        }
 public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
 {
     if (TGEMWorld.forestInvasionUp)
     {
         int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
         LegacyGameInterfaceLayer CustomProgress = new LegacyGameInterfaceLayer("ForgottenMemories: ProgressLayer",
                                                                                delegate
         {
             ProgressBar.DrawCustomInvasionProgress();
             return(true);
         },
                                                                                InterfaceScaleType.UI);
         layers.Insert(index, CustomProgress);
     }
 }
Пример #15
0
 public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
 {
     if (InvasionWorld.CyberWrath)
     {
         int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
         LegacyGameInterfaceLayer orionProgress = new LegacyGameInterfaceLayer("Tremor: Invasion2",
                                                                               delegate
         {
             DrawOrionEvent(Main.spriteBatch);
             return(true);
         },
                                                                               InterfaceScaleType.UI);
         layers.Insert(index, orionProgress);
     }
 }
Пример #16
0
 public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
 {
     if (CascadeWorld.TheCascade)
     {
         int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
         LegacyGameInterfaceLayer CascadeSpoon = new LegacyGameInterfaceLayer("Cascade: Spoon",
                                                                              delegate
         {
             DrawCascadeUi(Main.spriteBatch);
             return(true);
         },
                                                                              InterfaceScaleType.UI);
         layers.Insert(index, CascadeSpoon);
     }
 }
Пример #17
0
        ////////////////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            var loadLibs = ModContent.GetInstance <LoadLibraries>();

            if (loadLibs == null)
            {
                return;
            }

            //

            var layerDisable = LayerDisable.Instance;

            foreach (GameInterfaceLayer layer in layers)
            {
                if (layerDisable.DisabledLayers.Contains(layer.Name))
                {
                    layer.Active = false;
                }
            }

            //

            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));

            if (idx == -1)
            {
                return;
            }

            //

            GameInterfaceDrawMethod hudDrawCallback = () => {
                FreeHUD.Instance?.UIContext.Draw(Main.spriteBatch, Main._drawInterfaceGameTime);
                return(true);
            };

            //

            if (LoadLibraries.IsCurrentPlayerInGame())
            {
                var hudLayer = new LegacyGameInterfaceLayer("ModLibsUI: HUD UI",
                                                            hudDrawCallback,
                                                            InterfaceScaleType.UI);
                layers.Insert(idx, hudLayer);
            }
        }
Пример #18
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            Titles modPlayer = Main.player[Main.myPlayer].GetModPlayer <Titles>();

            if (modPlayer.text)
            {
                var textLayer     = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                var computerState = new LegacyGameInterfaceLayer("CSkies: UI",
                                                                 delegate
                {
                    BossTitle(modPlayer.BossID);
                    return(true);
                },
                                                                 InterfaceScaleType.UI);
                layers.Insert(textLayer, computerState);
            }
        }
Пример #19
0
        ////////////////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Resource Bars"));                   //Vanilla: Inventory

            if (idx != -1)
            {
                GameInterfaceDrawMethod func = delegate {
                    this.HealthLoss.DrawSubHealth(this, Main.spriteBatch);
                    this.HealthLoss.DrawCurrentHeartDropAnimation(this, Main.spriteBatch);

                    return(true);
                };
                var interfaceLayer = new LegacyGameInterfaceLayer("Injury: Heart Overlay", func, InterfaceScaleType.UI);

                layers.Insert(idx + 1, interfaceLayer);
            }
        }
Пример #20
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            TidePlayer modPlayer1 = Main.player[Main.myPlayer].GetModPlayer <TidePlayer>();

            if (TideWorld.TheTide)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                LegacyGameInterfaceLayer TideThing = new LegacyGameInterfaceLayer("SpiritMod: TideBenis",
                                                                                  delegate
                {
                    DrawTide(Main.spriteBatch);
                    return(true);
                },
                                                                                  InterfaceScaleType.UI);
                layers.Insert(index, TideThing);
            }
        }
Пример #21
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            BloomPlayer modPlayer1 = Main.player[Main.myPlayer].GetModPlayer <BloomPlayer>();

            if (BloomWorld.TheBloom)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                LegacyGameInterfaceLayer bloomProgress = new LegacyGameInterfaceLayer("Emperia: Invasion2",
                                                                                      delegate
                {
                    DrawBloom(Main.spriteBatch);
                    return(true);
                },
                                                                                      InterfaceScaleType.UI);
                layers.Insert(index, bloomProgress);
            }
        }
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            QwertyWorld modWorld = (QwertyWorld)GetModWorld("QwertyWorld");

            if (QwertyWorld.DinoEvent)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                LegacyGameInterfaceLayer orionProgress = new LegacyGameInterfaceLayer("Dino Militia",
                                                                                      delegate
                {
                    DrawDinoEvent(Main.spriteBatch);
                    return(true);
                },
                                                                                      InterfaceScaleType.UI);
                layers.Insert(index, orionProgress);
            }
        }
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            Player    player    = Main.LocalPlayer;
            KeyPlayer keyPlayer = player.GetModPlayer <KeyPlayer>();

            if ((ModContent.GetInstance <KeyClientConfig>().AlwaysShowMP || (player.HeldItem.modItem is Keybrand && player.HeldItem.modItem.AltFunctionUse(player)) || player.HeldItem.type == ModContent.ItemType <Items.Other.Cure.CureSpell>() || player.HeldItem.type == ModContent.ItemType <Items.Other.Cure.CuraSpell>() || player.HeldItem.type == ModContent.ItemType <Items.Other.Cure.CuragaSpell>()) && !player.dead && !Main.playerInventory)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Ruler"));
                LegacyGameInterfaceLayer mpBar = new LegacyGameInterfaceLayer("KeybrandsPlus: MP Gauge",
                                                                              delegate
                {
                    DrawMPGauge(Main.spriteBatch);
                    return(true);
                },
                                                                              InterfaceScaleType.UI);
                layers.Insert(index, mpBar);
            }
        }
Пример #24
0
        ////////////////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            if (this.HUDData == null)
            {
                return;
            }

            int cursorIdx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Cursor"));

            if (cursorIdx == -1)
            {
                return;
            }

            var crosshairHUD = ModContent.GetInstance <CrosshairHUD>();

            //

            GameInterfaceDrawMethod draw = () => {
                crosshairHUD.DrawIf(Main.spriteBatch, this.HUDData);

                if (TMRConfig.Instance.DebugModeInfo)
                {
                    this.DrawDebugLine();
                }
                return(true);
            };

            var interfaceLayer = new LegacyGameInterfaceLayer(
                "TheMadRanger: Crosshair",
                draw,
                InterfaceScaleType.UI
                );

            //

            if (crosshairHUD.ConsumesCursor(this.HUDData))
            {
                layers.RemoveAt(cursorIdx);
            }

            layers.Insert(cursorIdx, interfaceLayer);
        }
Пример #25
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            if (forgingHotbarActive)
            {
                if (Main.playerInventory)
                {
                    forgingHotbarActive = false;
                    return;
                }
                int hotbarIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Hotbar"));
                if (hotbarIndex != -1)
                {
                    layers[hotbarIndex] = new LegacyGameInterfaceLayer(
                        "Light: ForgeHotbarUI",
                        delegate {
                        ForgingHotbarUI.Draw();
                        return(true);
                    },
                        InterfaceScaleType.UI);
                }
            }
            int inventoryIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (inventoryIndex != -1)
            {
                if (!Main.playerInventory && ForgeSelectorUIActive)
                {
                    UI.SetState(null);
                    return;
                }
                layers.Insert(inventoryIndex + 1, new LegacyGameInterfaceLayer(
                                  "Light: ForgeInventoryUI",
                                  delegate {
                    // If the current UIState of the UserInterface is null, nothing will draw. We don't need to track a separate .visible value.
                    UI.Draw(Main.spriteBatch, new GameTime());
                    return(true);
                },
                                  InterfaceScaleType.UI)
                              );
            }
        }
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            MCAWorld modWorld = (MCAWorld)GetModWorld("MCAWorld");

            /*
             * RaidWorld modWorldInvasion = (RaidWorld)GetModWorld("RaidWorld");
             */

            if (RaidWorld.RaidEvent)
            {
                int index = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));
                LegacyGameInterfaceLayer orionProgress = new LegacyGameInterfaceLayer("Raid ",
                                                                                      delegate
                {
                    DrawRaidEvent(Main.spriteBatch);
                    return(true);
                },
                                                                                      InterfaceScaleType.UI);
                layers.Insert(index, orionProgress);
            }
        }
Пример #27
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Inventory"));

            if (idx == -1)
            {
                return;
            }

            GameInterfaceDrawMethod locksUI = () => {
                if (Main.playerInventory && Main.EquipPage == 0)                    //== 2 is misc page
                {
                    this.DrawDisabledAccessorySlotOverlays(Main.spriteBatch);
                }
                return(true);
            };

            var tradeLayer = new LegacyGameInterfaceLayer("LockedAbilities: Accessory Locks", locksUI, InterfaceScaleType.UI);

            layers.Insert(idx + 1, tradeLayer);
        }
Пример #28
0
        ////////////////

        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            if (!this.IsEnabled())
            {
                return;
            }

            var myWorld = ModContent.GetInstance <HonorBoundWorld>();
            var myLogic = myWorld.Logic;

            if (!myLogic.IsGameModeBegun)
            {
                myLogic.RefreshAllowedHonorifics();

                int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));
                if (idx != -1)
                {
                    var interface_layer = new LegacyGameInterfaceLayer("HonorBound: Honorific Picker",
                                                                       delegate {
                        this.UI.RefreshAllowedOptions(myLogic);

                        if (this.LastSeenScreenWidth != Main.screenWidth || this.LastSeenScreenHeight != Main.screenHeight)
                        {
                            this.LastSeenScreenWidth  = Main.screenWidth;
                            this.LastSeenScreenHeight = Main.screenHeight;
                            this.UI.RecalculateBackend();
                        }

                        this.UI.CheckTogglerMouseInteraction();
                        this.UI.UpdateBackend(Main._drawInterfaceGameTime);

                        this.UI.Draw(Main.spriteBatch);
                        this.UI.DrawToggler(Main.spriteBatch);

                        return(true);
                    });
                    layers.Insert(idx, interface_layer);
                }
            }
        }
Пример #29
0
        public override void ModifyInterfaceLayers(List <GameInterfaceLayer> layers)
        {
            if (!this.Config.Enabled)
            {
                return;
            }

            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Resource Bars"));

            if (idx == -1)
            {
                return;
            }

            if (this.Config.ShowMainStaminaBar)
            {
                var mainUiLayer = new LegacyGameInterfaceLayer(
                    "Stamina: Main Meter",
                    () => {
                    this.StaminaBarUIDraw();
                    return(true);
                },
                    InterfaceScaleType.UI
                    );
                layers.Insert(idx + 1, mainUiLayer);
            }

            if (this.Config.ShowMiniStaminaBar)
            {
                var plrUiLayer = new LegacyGameInterfaceLayer(
                    "Stamina: Player Meter",
                    () => {
                    this.StaminaBarPlayerDraw();
                    return(true);
                },
                    InterfaceScaleType.Game
                    );
                layers.Insert(idx + 1, plrUiLayer);
            }
        }
Пример #30
0
        ////

        private void AddTitleDisplayLayer(List <GameInterfaceLayer> layers)
        {
            int idx = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));

            if (idx == -1)
            {
                return;
            }

            GameInterfaceDrawMethod ui = () => {
                Cutscene cutscene = CutsceneManager.Instance.GetCurrentCutscene_Player(Main.LocalPlayer);
                if (cutscene != null)
                {
                    cutscene.DrawInterface();
                }
                return(true);
            };

            ////

            var tradeLayer = new LegacyGameInterfaceLayer("Cutscene Lib: Titles", ui, InterfaceScaleType.UI);

            layers.Insert(idx, tradeLayer);
        }