コード例 #1
0
        // Token: 0x06000BB3 RID: 2995 RVA: 0x003CF710 File Offset: 0x003CD910
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if (alpha > 0f)
            {
                string    title       = ach.Title;
                Vector2   arg_53_0    = center;
                Vector2   value       = Main.fontItemStack.MeasureString(title);
                float     num         = ach.Scale * 1.1f;
                Rectangle r           = Utils.CenteredRectangle(arg_53_0, (value + new Vector2(58f, 10f)) * num);
                Vector2   mouseScreen = Main.MouseScreen;
                bool      expr_6F     = r.Contains(mouseScreen.ToPoint());
                Color     c           = expr_6F ? (new Color(64, 109, 164) * 0.75f) : (new Color(64, 109, 164) * 0.5f);
                Utils.DrawInvBG(sb, r, c);
                float   num2   = num * 0.3f;
                Color   value2 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)(Main.mouseTextColor / 5), (int)Main.mouseTextColor);
                Vector2 vector = r.Right() - Vector2.UnitX * num * (12f + num2 * (float)ach.Frame.Width);
                sb.Draw(AchievementCompleteUI.AchievementsTexture, vector, new Rectangle?(ach.Frame), Color.White * alpha, 0f, new Vector2(0f, (float)(ach.Frame.Height / 2)), num2, SpriteEffects.None, 0f);
                sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, vector, null, Color.White * alpha, 0f, new Vector2(0f, (float)(ach.Frame.Height / 2)), num2, SpriteEffects.None, 0f);
                Utils.DrawBorderString(sb, title, vector - Vector2.UnitX * 10f, value2 * alpha, num * 0.9f, 1f, 0.4f, -1);
                if (expr_6F && !PlayerInput.IgnoreMouseInterface)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
コード例 #2
0
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if ((double)alpha > 0.0)
            {
                string    title       = ach.Title;
                Vector2   center1     = center;
                Vector2   vector2     = Main.fontItemStack.MeasureString(title);
                float     num         = ach.Scale * 1.1f;
                Rectangle rectangle   = Utils.CenteredRectangle(center1, (vector2 + new Vector2(58f, 10f)) * num);
                Vector2   mouseScreen = Main.MouseScreen;
                bool      flag        = rectangle.Contains(mouseScreen.ToPoint());
                Color     c           = flag ? new Color(64, 109, 164) * 0.75f : new Color(64, 109, 164) * 0.5f;
                Utils.DrawInvBG(sb, rectangle, c);
                float   scale    = num * 0.3f;
                Color   color    = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor / 5, (int)Main.mouseTextColor);
                Vector2 position = rectangle.Right() - Vector2.UnitX * num * (float)(12.0 + (double)scale * (double)ach.Frame.Width);
                sb.Draw(AchievementCompleteUI.AchievementsTexture, position, new Rectangle?(ach.Frame), Color.White * alpha, 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), scale, SpriteEffects.None, 0.0f);
                sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, position, new Rectangle?(), Color.White * alpha, 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), scale, SpriteEffects.None, 0.0f);
                Utils.DrawBorderString(sb, title, position - Vector2.UnitX * 10f, color * alpha, num * 0.9f, 1f, 0.4f, -1);
                if (flag && !PlayerInput.IgnoreMouseInterface)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
コード例 #3
0
        public void DrawOneAchievement(SpriteBatch spriteBatch, Vector2 position, bool large)
        {
            List <AchievementAdvisorCard> bestCards = GetBestCards(1);

            if (bestCards.Count < 1)
            {
                return;
            }
            AchievementAdvisorCard hoveredCard = bestCards[0];
            float num = 0.35f;

            if (large)
            {
                num = 0.75f;
            }
            _hoveredCard = null;
            DrawCard(bestCards[0], spriteBatch, position + new Vector2(8f) * num, num, out var hovered);
            if (!hovered)
            {
                return;
            }
            _hoveredCard = hoveredCard;
            if (!PlayerInput.IgnoreMouseInterface)
            {
                Main.player[Main.myPlayer].mouseInterface = true;
                if (Main.mouseLeft && Main.mouseLeftRelease)
                {
                    Main.ingameOptionsWindow = false;
                    IngameFancyUI.OpenAchievementsAndGoto(_hoveredCard.achievement);
                }
            }
        }
コード例 #4
0
        public void DrawOptionsPanel(
            SpriteBatch spriteBatch,
            Vector2 leftPosition,
            Vector2 rightPosition)
        {
            List <AchievementAdvisorCard> bestCards = this.GetBestCards(10);

            this._hoveredCard = (AchievementAdvisorCard)null;
            int num = bestCards.Count;

            if (num > 5)
            {
                num = 5;
            }
            bool hovered;

            for (int index = 0; index < num; ++index)
            {
                this.DrawCard(bestCards[index], spriteBatch, leftPosition + new Vector2((float)(42 * index), 0.0f), 0.5f, out hovered);
                if (hovered)
                {
                    this._hoveredCard = bestCards[index];
                }
            }
            for (int index = 5; index < bestCards.Count; ++index)
            {
                this.DrawCard(bestCards[index], spriteBatch, rightPosition + new Vector2((float)(42 * index), 0.0f), 0.5f, out hovered);
                if (hovered)
                {
                    this._hoveredCard = bestCards[index];
                }
            }
            if (this._hoveredCard == null)
            {
                return;
            }
            if (this._hoveredCard.achievement.IsCompleted)
            {
                this._hoveredCard = (AchievementAdvisorCard)null;
            }
            else
            {
                if (PlayerInput.IgnoreMouseInterface)
                {
                    return;
                }
                Main.player[Main.myPlayer].mouseInterface = true;
                if (!Main.mouseLeft || !Main.mouseLeftRelease)
                {
                    return;
                }
                Main.ingameOptionsWindow = false;
                IngameFancyUI.OpenAchievementsAndGoto(this._hoveredCard.achievement);
            }
        }
コード例 #5
0
 private void OnMouseOver()
 {
     if (!PlayerInput.IgnoreMouseInterface)
     {
         Main.player[Main.myPlayer].mouseInterface = true;
         if (Main.mouseLeft && Main.mouseLeftRelease)
         {
             Main.mouseLeftRelease = false;
             IngameFancyUI.OpenAchievementsAndGoto(_theAchievement);
             _ingameDisplayTimeLeft = 0;
             ShouldBeRemoved        = true;
         }
     }
 }
コード例 #6
0
 private void OnMouseOver()
 {
     if (PlayerInput.IgnoreMouseInterface)
     {
         return;
     }
     Main.player[Main.myPlayer].mouseInterface = true;
     if (!Main.mouseLeft || !Main.mouseLeftRelease)
     {
         return;
     }
     Main.mouseLeftRelease = false;
     IngameFancyUI.OpenAchievementsAndGoto(this._theAchievement);
     this._ingameDisplayTimeLeft = 0;
     this.ShouldBeRemoved        = true;
 }
コード例 #7
0
        public void DrawOptionsPanel(SpriteBatch spriteBatch, Vector2 leftPosition, Vector2 rightPosition)
        {
            List <AchievementAdvisorCard> bestCards = GetBestCards();

            _hoveredCard = null;
            int num = bestCards.Count;

            if (num > 5)
            {
                num = 5;
            }
            bool hovered;

            for (int i = 0; i < num; i++)
            {
                DrawCard(bestCards[i], spriteBatch, leftPosition + new Vector2(42 * i, 0f), 0.5f, out hovered);
                if (hovered)
                {
                    _hoveredCard = bestCards[i];
                }
            }
            for (int j = 5; j < bestCards.Count; j++)
            {
                DrawCard(bestCards[j], spriteBatch, rightPosition + new Vector2(42 * j, 0f), 0.5f, out hovered);
                if (hovered)
                {
                    _hoveredCard = bestCards[j];
                }
            }
            if (_hoveredCard == null)
            {
                return;
            }
            if (_hoveredCard.achievement.IsCompleted)
            {
                _hoveredCard = null;
            }
            else if (!PlayerInput.IgnoreMouseInterface)
            {
                Main.player[Main.myPlayer].mouseInterface = true;
                if (Main.mouseLeft && Main.mouseLeftRelease)
                {
                    Main.ingameOptionsWindow = false;
                    IngameFancyUI.OpenAchievementsAndGoto(_hoveredCard.achievement);
                }
            }
        }
コード例 #8
0
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if ((double)alpha > 0.0)
            {
                string    title       = ach.Title;
                Vector2   center1     = center;
                Vector2   vector2_1   = Main.fontItemStack.MeasureString(title);
                float     num1        = ach.Scale * 1.1f;
                Vector2   size        = Vector2.op_Multiply(Vector2.op_Addition(vector2_1, new Vector2(58f, 10f)), num1);
                Rectangle rectangle   = Utils.CenteredRectangle(center1, size);
                Vector2   mouseScreen = Main.MouseScreen;
                // ISSUE: explicit reference operation
                int   num2 = ((Rectangle)@rectangle).Contains(mouseScreen.ToPoint()) ? 1 : 0;
                Color c    = num2 != 0 ? Color.op_Multiply(new Color(64, 109, 164), 0.75f) : Color.op_Multiply(new Color(64, 109, 164), 0.5f);
                Utils.DrawInvBG(sb, rectangle, c);
                float num3 = num1 * 0.3f;
                Color color;
                // ISSUE: explicit reference operation
                ((Color)@color).\u002Ector((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor / 5, (int)Main.mouseTextColor);
                Vector2 vector2_2 = Vector2.op_Subtraction(rectangle.Right(), Vector2.op_Multiply(Vector2.op_Multiply(Vector2.get_UnitX(), num1), (float)(12.0 + (double)num3 * (double)(float)ach.Frame.Width)));
                sb.Draw(AchievementCompleteUI.AchievementsTexture, vector2_2, new Rectangle?(ach.Frame), Color.op_Multiply(Color.get_White(), alpha), 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), num3, (SpriteEffects)0, 0.0f);
                sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, vector2_2, new Rectangle?(), Color.op_Multiply(Color.get_White(), alpha), 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), num3, (SpriteEffects)0, 0.0f);
                Utils.DrawBorderString(sb, title, Vector2.op_Subtraction(vector2_2, Vector2.op_Multiply(Vector2.get_UnitX(), 10f)), Color.op_Multiply(color, alpha), num1 * 0.9f, 1f, 0.4f, -1);
                if (num2 != 0 && !PlayerInput.IgnoreMouseInterface)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
コード例 #9
0
        public void DrawOneAchievement(SpriteBatch spriteBatch, Vector2 position, bool large)
        {
            List <AchievementAdvisorCard> bestCards = this.GetBestCards(1);

            if (bestCards.Count < 1)
            {
                return;
            }
            AchievementAdvisorCard achievementAdvisorCard = bestCards[0];
            float scale = 0.35f;

            if (large)
            {
                scale = 0.75f;
            }
            this._hoveredCard = (AchievementAdvisorCard)null;
            bool hovered;

            this.DrawCard(bestCards[0], spriteBatch, position + new Vector2(8f) * scale, scale, out hovered);
            if (!hovered)
            {
                return;
            }
            this._hoveredCard = achievementAdvisorCard;
            if (PlayerInput.IgnoreMouseInterface)
            {
                return;
            }
            Main.player[Main.myPlayer].mouseInterface = true;
            if (!Main.mouseLeft || !Main.mouseLeftRelease)
            {
                return;
            }
            Main.ingameOptionsWindow = false;
            IngameFancyUI.OpenAchievementsAndGoto(this._hoveredCard.achievement);
        }