OpenAndGoto() public static method

public static OpenAndGoto ( Achievement achievement ) : void
achievement Achievement
return void
コード例 #1
0
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if ((double)alpha > 0.0)
            {
                string    text        = ach.Title;
                Vector2   center1     = center;
                Vector2   vector2     = Main.fontItemStack.MeasureString(text);
                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(Utils.ToPoint(mouseScreen));
                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 = Utils.Right(rectangle) - 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, text, position - Vector2.UnitX * 10f, color * alpha, num * 0.9f, 1f, 0.4f, -1);
                if (flag)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        AchievementsUI.OpenAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
コード例 #2
0
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, DrawCache ach)
        {
            float alpha = ach.Alpha;

            if (alpha > 0f)
            {
                string    title       = ach.Title;
                Vector2   center2     = center;
                Vector2   value       = Main.fontItemStack.MeasureString(title);
                float     num         = ach.Scale * 1.1f;
                Rectangle r           = Utils.CenteredRectangle(center2, (value + new Vector2(58f, 10f)) * num);
                Vector2   mouseScreen = Main.MouseScreen;
                bool      flag        = r.Contains(mouseScreen.ToPoint());
                Color     c           = flag ? (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(Main.mouseTextColor, Main.mouseTextColor, (int)Main.mouseTextColor / 5, Main.mouseTextColor);
                Vector2 vector = r.Right() - Vector2.UnitX * num * (12f + num2 * (float)ach.Frame.Width);
                sb.Draw(AchievementsTexture, vector, ach.Frame, Color.White * alpha, 0f, new Vector2(0f, ach.Frame.Height / 2), num2, SpriteEffects.None, 0f);
                sb.Draw(AchievementsTextureBorder, vector, null, Color.White * alpha, 0f, new Vector2(0f, ach.Frame.Height / 2), num2, SpriteEffects.None, 0f);
                Utils.DrawBorderString(sb, title, vector - Vector2.UnitX * 10f, value2 * alpha, num * 0.9f, 1f, 0.4f);
                if (flag)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        AchievementsUI.OpenAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }