Ejemplo n.º 1
0
 protected override void DrawSelf(SpriteBatch spritebatch)
 {
     if (area.ContainsPoint(Main.MouseWorld))
     {
         Main.LocalPlayer.mouseInterface = true;
     }
 }
Ejemplo n.º 2
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     if (mainPanel.ContainsPoint(Main.MouseScreen))
     {
         Main.LocalPlayer.mouseInterface = true;
     }
 }
Ejemplo n.º 3
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     UpdateCheckboxes();
     if (keyboardPanel.ContainsPoint(Main.MouseScreen))
     {
         Main.player[Main.myPlayer].mouseInterface = true;
     }
 }
Ejemplo n.º 4
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     // Do not allow usage of items when clicking interface
     if (FlagModifierPanel.ContainsPoint(Main.MouseScreen))
     {
         Main.LocalPlayer.mouseInterface = true;
     }
 }
Ejemplo n.º 5
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     if (colorPalettePanel.ContainsPoint(Main.MouseScreen))
     {
         Main.LocalPlayer.mouseInterface = true;
     }
     base.DrawSelf(spriteBatch);
 }
Ejemplo n.º 6
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     SpawnDusts();
     if (mainPanel.ContainsPoint(Main.MouseScreen))
     {
         Main.LocalPlayer.mouseInterface = true;
     }
     DrawSpawnRectangle();
 }
Ejemplo n.º 7
0
        ////////////////////////////////////no edit after that/////////////////////////////////////////////////////////

        protected override void DrawSelf(SpriteBatch spriteBatch)         //I think this steals the priority of the click when inside the UI box (doesnt call the object function when clicking on button)
        {
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (backgroundPanel.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
        }
Ejemplo n.º 8
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (checklistPanel.ContainsPoint(MousePosition))
            {
                Main.player[Main.myPlayer].mouseInterface = true;
            }
        }
Ejemplo n.º 9
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            UpdateHuntList();
            Vector2 mousePos = new Vector2(Main.mouseX, Main.mouseY);

            if (panel.ContainsPoint(mousePos))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
        }
Ejemplo n.º 10
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2(Main.mouseX, Main.mouseY);

            if (MainPanel.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
            Recalculate();
        }
Ejemplo n.º 11
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     if (reforgePanel.ContainsPoint(Main.MouseScreen))
     {
         Main.LocalPlayer.mouseInterface = true;
         Main.HoverItem.TurnToAir();
         Main.hoverItemName = "";
     }
     Main.HidePlayerCraftingMenu = true;
     reforgeButton.Visible       = !reforgeSlot.item.IsAir;
 }
Ejemplo n.º 12
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2((float)Terraria.Main.mouseX, (float)Terraria.Main.mouseY);

            if (backPanel.ContainsPoint(MousePosition))
            {
                Terraria.Main.LocalPlayer.mouseInterface = true;
            }

            base.DrawSelf(spriteBatch);
        }
Ejemplo n.º 13
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            playerIndexDisplay.SetText($"Current gamepad index = {PlayerIndexController.Index?.ToString().ToUpper() ?? "NONE"}");

            Vector2 MousePosition = new Vector2((float)Terraria.Main.mouseX, (float)Terraria.Main.mouseY);

            if (backPanel.ContainsPoint(MousePosition))
            {
                Terraria.Main.LocalPlayer.mouseInterface = true;
            }

            base.DrawSelf(spriteBatch);
        }
Ejemplo n.º 14
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     if (customizerPanel.ContainsPoint(Main.MouseScreen))
     {
         Main.LocalPlayer.mouseInterface = true;
     }
     if (dragging)
     {
         customizerPanel.Left.Set(Main.MouseScreen.X - offset.X, 0f);
         customizerPanel.Top.Set(Main.MouseScreen.Y - offset.Y, 0f);
         Recalculate();
     }
 }
Ejemplo n.º 15
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            hoverText = "";
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (checklistPanel.ContainsPoint(MousePosition))
            {
                Main.player[Main.myPlayer].mouseInterface = true;

                // Doesn't fully fix problem. Clicks still happen in back to front manner.
                //Main.HoverItem = new Item();
                //Main.hoverItemName = "";
            }
        }
Ejemplo n.º 16
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 mousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (shopPanel.ContainsPoint(mousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }

            if (dragging)
            {
                _Recalculate(mousePosition);
            }
        }
Ejemplo n.º 17
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (HealingUIPanel.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
            if (dragging)
            {
                HealingUIPanel.Left.Set(MousePosition.X - offset.X, 0f);
                HealingUIPanel.Top.Set(MousePosition.Y - offset.Y, 0f);
                Recalculate();
            }
        }
Ejemplo n.º 18
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            if (extractorPanel.ContainsPoint(Main.MouseScreen))
            {
                Main.LocalPlayer.mouseInterface = true;
            }

            float progress = (float)ExtractorTE.Power / ChlorophyteExtractorTE.MaxResources;

            powerBar.SetPercentage(progress, oldExtractorID == ExtractorTE.ID);
            oldExtractorID       = ExtractorTE.ID;
            powerBar.HoverText   = (int)(progress * 100) + "% Power";
            mudSlot.HoverText    = (ExtractorTE.Mud > 0 ? ExtractorTE.Mud + "" : "Needs") + " Mud";
            chloroSlot.HoverText = (ExtractorTE.Chlorophyte < ChlorophyteExtractorTE.MaxResources ? ExtractorTE.Chlorophyte > 0 ? ExtractorTE.Chlorophyte + "" : "No" : "Full of") + " Chlorophyte";
        }
Ejemplo n.º 19
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (coinCounterPanel.ContainsPoint(MousePosition))
            {
                // Checking ContainsPoint and then setting mouseInterface to true is very common. This causes clicks to not cause the player to use current items.
                Main.LocalPlayer.mouseInterface = true;
            }
            if (dragging)
            {
                coinCounterPanel.Left.Set(MousePosition.X - offset.X, 0f);
                coinCounterPanel.Top.Set(MousePosition.Y - offset.Y, 0f);
                Recalculate();
            }
        }
Ejemplo n.º 20
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (backGround.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
            if (dragging)
            {
                offSet.X += (MousePosition.X - regOffSet.X);
                offSet.Y += (MousePosition.Y - regOffSet.Y);
                regOffSet = new Vector2(MousePosition.X, MousePosition.Y);
                Recalculate();
            }
        }
Ejemplo n.º 21
0
        protected sealed override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = Main.MouseScreen;

            if (WindowPanel.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
                Main.LocalPlayer.showItemIcon   = false;
            }
            if (_dragging)
            {
                WindowPanel.Left.Set(MousePosition.X - _offset.X, 0f);
                WindowPanel.Top.Set(MousePosition.Y - _offset.Y, 0f);
                Recalculate();
            }
            OnDraw(spriteBatch);
        }
Ejemplo n.º 22
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 mousePosition = new Vector2(Main.mouseX, Main.mouseY);

            if (_checklistPanel.ContainsPoint(mousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }

            if (!_dragging)
            {
                return;
            }
            _checklistPanel.Left.Set(mousePosition.X - _offset.X, 0f);
            _checklistPanel.Top.Set(mousePosition.Y - _offset.Y, 0f);
            Recalculate();
        }
Ejemplo n.º 23
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            base.DrawSelf(spriteBatch);
            Vector2 mousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (backPanel.ContainsPoint(mousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }

            if (dragging)
            {
                backPanel.Left.Set(mousePosition.X - _offset.X, 0f);
                backPanel.Top.Set(mousePosition.Y - _offset.Y, 0f);
                Recalculate();
            }
        }
Ejemplo n.º 24
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            CalculatedStyle dimensions = panelMain.GetDimensions();

            if (panelMain.ContainsPoint(Main.MouseScreen))
            {
                Main.LocalPlayer.mouseInterface = true;
                Main.LocalPlayer.showItemIcon   = false;
                Main.ItemIconCacheUpdate(0);
            }

            if (dragging)
            {
                panelMain.Left.Set(MathHelper.Clamp(Main.MouseScreen.X - offset.X, 0, Main.screenWidth - dimensions.Width), 0f);
                panelMain.Top.Set(MathHelper.Clamp(Main.MouseScreen.Y - offset.Y, 0, Main.screenHeight - dimensions.Height), 0f);
                panelMain.Recalculate();
            }
        }
Ejemplo n.º 25
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (QuestTrackerPanel.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
            if (dragging)
            {
                QuestTrackerPanel.Left.Set(MousePosition.X - offset.X, 0f);
                QuestTrackerPanel.Top.Set(MousePosition.Y - offset.Y, 0f);
                Recalculate();
            }
            if (Antiaris.trackerTexture != null)
            {
                spriteBatch.Draw(Antiaris.trackerTexture, new Vector2(QuestTrackerPanel.Left.Pixels, QuestTrackerPanel.Top.Pixels), Color.White);
            }
        }
Ejemplo n.º 26
0
 protected override void DrawSelf(SpriteBatch spriteBatch)
 {
     if (pendingAdd.Count > 0)
     {
         replOutput.AddRange(pendingAdd);
         pendingAdd.Clear();
     }
     if (pendingClear)
     {
         replOutput.Clear();
         replOutput.Add(codeTextBox);
         pendingClear = false;
     }
     UpdateCheckboxes();
     if (keyboardPanel.ContainsPoint(Main.MouseScreen))
     {
         Main.player[Main.myPlayer].mouseInterface = true;
     }
 }
Ejemplo n.º 27
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            if (!AllowDraw())
            {
                return;
            }

            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            if (panel.ContainsPoint(MousePosition))
            {
                Main.LocalPlayer.mouseInterface = true;
            }
            if (dragging)
            {
                panel.Left.Set(MousePosition.X - offset.X, 0f);
                panel.Top.Set(MousePosition.Y - offset.Y, 0f);
            }
            Update(spriteBatch);
            Recalculate();
        }
Ejemplo n.º 28
0
        protected override void DrawSelf(SpriteBatch spriteBatch)
        {
            if (player == null)
            {
                player = Main.LocalPlayer.GetModPlayer <TervaniaPlayer>();
            }
            Vector2 MousePosition = new Vector2((float)Main.mouseX, (float)Main.mouseY);

            {
                if (ePanel.ContainsPoint(MousePosition))
                {
                    Main.LocalPlayer.mouseInterface = true;
                    Main.HoverItem     = player.enchantedSoul;
                    Main.hoverItemName = player.enchantedSoul.Name;
                }

                int type = player.enchantedSoul.type;

                if (!ePanel.HasChild(eIcon) && player.enchantedSoul.modItem != null)
                {
                    eIcon = new UIImageFramed(Main.itemTexture[type], new Rectangle(0, 0, 36, 36));
                    eIcon.Left.Set(4, 0f);
                    eIcon.Top.Set(4, 0f);
                    eIcon.Width.Set(38, 0f);
                    eIcon.Height.Set(38, 0f);
                    ePanel.Append(eIcon);
                }
                if (Main.itemAnimations[type] != null)
                {
                    eIcon.SetFrame(Main.itemAnimations[type].GetFrame(Main.itemTexture[type]));
                }

                ePanel.Left.Set(496, 0f);
                ePanel.Top.Set(20, 0f);
            }

            {
                if (bPanel.ContainsPoint(MousePosition))
                {
                    Main.LocalPlayer.mouseInterface = true;
                    Main.HoverItem     = player.bulletSoul;
                    Main.hoverItemName = player.bulletSoul.Name;
                }

                int type = player.bulletSoul.type;

                if (!bPanel.HasChild(bIcon) && player.bulletSoul.modItem != null)
                {
                    bIcon = new UIImageFramed(Main.itemTexture[player.bulletSoul.type], new Rectangle(0, 0, 36, 36));
                    bIcon.Left.Set(4, 0f);
                    bIcon.Top.Set(4, 0f);
                    bIcon.Width.Set(38, 0f);
                    bIcon.Height.Set(38, 0f);
                    bPanel.Append(bIcon);
                }
                if (Main.itemAnimations[type] != null)
                {
                    bIcon.SetFrame(Main.itemAnimations[type].GetFrame(Main.itemTexture[type]));
                }

                bPanel.Left.Set(542, 0f);
                bPanel.Top.Set(20, 0f);
            }

            {
                if (gPanel.ContainsPoint(MousePosition))
                {
                    Main.LocalPlayer.mouseInterface = true;
                    Main.HoverItem     = player.guardianSoul;
                    Main.hoverItemName = player.guardianSoul.Name;
                }

                int type = player.guardianSoul.type;

                if (!gPanel.HasChild(gIcon) && player.guardianSoul.modItem != null)
                {
                    gIcon = new UIImageFramed(Main.itemTexture[player.guardianSoul.type], new Rectangle(0, 0, 36, 36));
                    gIcon.Left.Set(4, 0f);
                    gIcon.Top.Set(4, 0f);
                    gIcon.Width.Set(38, 0f);
                    gIcon.Height.Set(38, 0f);
                    gPanel.Append(gIcon);
                }
                if (Main.itemAnimations[type] != null)
                {
                    gIcon.SetFrame(Main.itemAnimations[type].GetFrame(Main.itemTexture[type]));
                }

                gPanel.Left.Set(588, 0f);
                gPanel.Top.Set(20, 0f);
            }

            Recalculate();
        }