예제 #1
0
        public override void Load()
        {
            LoadShaders();

            blankTexture = ("ProjectPhoenix/UI/blank");
            Instance     = ModContent.GetInstance <ProjectPhoenix>();



            //playboy = Main.LocalPlayer.GetModPlayer<PlayerMod>();

            Text.SmokeyDialogue1.LoadText();
            TextBoxTest = RegisterHotKey("Dialogue Key", "P"); // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v=xnagamestudio.41) for special keys
                                                               //TextBoxTest2 = RegisterHotKey("I am ses)", "L"); // See https://docs.microsoft.com/en-us/previous-versions/windows/xna/bb197781(v=xnagamestudio.41) for special keys

            ModContent.GetInstance <ProjectPhoenix>().Logger.Debug("ProjectPhoenix loaded.");
            if (!Main.dedServ)
            {
                if (FontExists("Fonts/Smokey"))
                {
                    Smokey = GetFont("Fonts/Smokey");
                }
                MyInterface = new UserInterface();

                Texting = new Textbox();
                //TextboxI = new TextboxInternal();
                Texting.Activate(); // Activate calls Initialize() on the UIState if not initialized, then calls OnActivate and then calls Activate on every child element
                                    //	TextboxI.Activate();
            }

            base.Load();
        }
예제 #2
0
        protected override void LoadContent()
        {
            string[] args = Environment.GetCommandLineArgs();
            spriteBatch     = new SpriteBatch(GraphicsDevice);
            ImageFluttershy = Content.Load <Texture2D>("FluttershyHappy");
            Root.EXECUTE_DoNotLoadXXLTextures = true;
            Resolution resolution = new Resolution(1024, 768);

            if (args.Length >= 2)
            {
                try
                {
                    string[] wh = args[1].Split('x');
                    int      w  = Int32.Parse(wh[0]);
                    int      h  = Int32.Parse(wh[1]);
                    resolution = new Resolution(w, h);
                }
                catch
                {
                }
            }
            if (args.Length >= 4)
            {
                if (args[3] == "donottrack")
                {
                    TrackingPermitted = false;
                }
            }
            Root.Init(this, spriteBatch, graphics, resolution);

            /*     public static Rectangle rectConsoleTop = new Rectangle(3, 3, 1024 - 6, 500);
             * public static Rectangle rectConsoleTopInner = new Rectangle(3+2, 3+2, 1024 - 6-4, 500-4);
             * Rectangle rectInputLine = new Rectangle(3, 506, 1024 - 6, 30);
             * Rectangle rectSuggestions = new Rectangle(3, 539, 1024 - 6 - 203, 226);
             * Rectangle rectRecommendedCommands = new Rectangle(1024-203, 539, 200, 226);*/
            rectConsoleTop      = new Rectangle(2, 2, resolution.Width - 4, 500);
            rectConsoleTopInner = new Rectangle(7, 7, resolution.Width - 10 - 4, 496 - 4);
            rectInputLine       = new Rectangle(2, 503, resolution.Width - 4, 30);
            int suggestionBoxHeight = resolution.Height - 2 - 535;

            rectSuggestions         = new Rectangle(2, 535, resolution.Width * 3 / 4, suggestionBoxHeight);
            rectRecommendedCommands = new Rectangle(resolution.Width * 3 / 4 + 4, 535, resolution.Width * 1 / 4 - 6, suggestionBoxHeight);

            if (args.Length >= 3)
            {
                if (args[2] == "fullscreen")
                {
                    Root.IsFullscreen = true;
                }
            }

            InputTextBox = new Textbox("", rectInputLine, false);
            InputTextBox.Activate();
            InputTextBox.EnterPress += new Action <Textbox>(InputTextBox_EnterPress);
            Session = new Session();
            Session.EnterLocation(Session.Locations[LocationID.Splash]);
            Session.GetAvailableCommands(out AvailableCommands, out RecommendedCommands);
            // Add your first game phase here
        }