예제 #1
0
        public void Update()
        {
            if (((StarSailorMod)mod).inLaunchGui)
            {
                Rectangle mouseRect = new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, 1, 1);
                Vector2   dims      = Main.fontDeathText.MeasureString(text);
                Rectangle textRect  = new Rectangle((int)location.X - (int)(dims.X / 2f), (int)location.Y - (int)(dims.Y / 2f), (int)dims.X, (int)dims.Y);
                if (mouseRect.Intersects(textRect))
                {
                    HoverUpdate(true);
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        int r = DoPress();
                        switch (r)
                        {
                        case -1:
                            ((StarSailorMod)mod).ExitRocketGui();
                            break;

                        case -2:
                            ((StarSailorMod)mod).inLaunchGui = false;
                            //ModContent.GetInstance<Rocket>().takeOffAnimate = true;
                            LaunchPoint   destination = ModContent.GetInstance <LaunchPointManager>().SetDestination();
                            SequenceQueue sq          = SequenceBuilder.ConstructSpaceSequence(ModContent.GetInstance <DimensionManager>().currentDimension, destination.dimension, Main.LocalPlayer, 16 * (destination.position + new Vector2(0, -3)), destination.needPlatform);
                            sq.Execute();
                            break;

                        case -3:
                            ((StarSailorMod)mod).nameButton.active = !((StarSailorMod)mod).nameButton.active;
                            break;

                        default:
                            bool temp = active;
                            ModContent.GetInstance <LaunchPointManager>().DeactivateLocations();
                            active = !temp;
                            break;
                        }
                    }
                }
                else
                {
                    HoverUpdate(false);
                }
                if (active && fn == Function.Name)
                {
                    text = Main.GetInputText(text);
                    //text = ((StarSailorMod)mod).InputText(text);
                }
            }
        }