/// <summary>
        /// Initializes a new instance of the <see cref="GameScreenBase"/> class.
        /// </summary>
        /// <param name="rootDirectory">The root directory of the panel's local content manager.</param>
        /// <param name="definitionAsset">The asset path of the screen's definition file.</param>
        /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
        /// <param name="uiScreenService">The screen service which created this screen.</param>
        public GameScreenBase(String rootDirectory, String definitionAsset, ContentManager globalContent, UIScreenService uiScreenService)
            : base(rootDirectory, definitionAsset, globalContent)
        {
            Contract.Require(uiScreenService, "uiScreenService");

            this.uiScreenService = uiScreenService;
        }
Example #2
0
        public ExampleScreen(ContentManager globalContent, UIScreenService uiScreenService)
            : base("Content/UI/Screens/ExampleScreen", "ExampleScreen", globalContent)
        {
            Contract.Require(uiScreenService, "uiScreenService");

            View.SetViewModel(new ExampleViewModel(Ultraviolet));
        }
        public GameplayScreen(ContentManager globalContent, UIScreenService uiScreenService)
            : base("Content/UI/Screens/GameplayScreen", "GameplayScreen", globalContent)
        {
            Contract.Require(uiScreenService, "uiScreenService");

            this.textRenderer    = new TextRenderer();
            this.blankTexture    = GlobalContent.Load<Texture2D>(GlobalTextureID.Blank);
            this.photograph      = GlobalContent.Load<Texture2D>(GlobalTextureID.Photograph);
            this.font            = GlobalContent.Load<SpriteFont>(GlobalFontID.SegoeUI);
        }
Example #4
0
        public SampleScreen2(ContentManager globalContent, UIScreenService uiScreenService)
            : base("Content/UI/Screens/SampleScreen2", "SampleScreen2", globalContent)
        {
            Contract.Require(uiScreenService, "uiScreenService");

            IsOpaque = true;

            this.font         = LocalContent.Load<SpriteFont>("Garamond");
            this.blankTexture = GlobalContent.Load<Texture2D>(GlobalTextureID.Blank);
            this.textRenderer = new TextRenderer();
        }
Example #5
0
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");
            LoadContentManifests(content);
            LoadLocalizationDatabases(content);

            var screenService = new UIScreenService(content);
            var screen = screenService.Get<SampleScreen1>();
            Ultraviolet.GetUI().GetScreens().Open(screen, TimeSpan.Zero);

            base.OnLoadingContent();
        }
Example #6
0
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");
            LoadContentManifests(content);
            LoadLocalizationDatabases(content);

            var screenService = new UIScreenService(content);
            var screen        = screenService.Get <SampleScreen1>();

            Ultraviolet.GetUI().GetScreens().Open(screen, TimeSpan.Zero);

            base.OnLoadingContent();
        }
        public LoadingScreen(ContentManager globalContent, UIScreenService uiScreenService)
            : base("Content/UI/Screens/LoadingScreen", "LoadingScreen", globalContent)
        {
            Contract.Require(uiScreenService, "uiScreenService");

            this.uiScreenService = uiScreenService;
            this.textRenderer    = new TextRenderer();
            this.blankTexture    = GlobalContent.Load <Texture2D>(GlobalTextureID.Blank);
            this.font            = GlobalContent.Load <SpriteFont>(GlobalFontID.SegoeUI);
            this.spinnerSprite   = LocalContent.Load <Sprite>("Spinner");
            this.loader          = new AsynchronousContentLoader();

            this.textRenderer.LayoutEngine.RegisterIcon("spinner", spinnerSprite[0]);

            UpdateMessage(String.Empty);
        }
Example #8
0
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");
            LoadContentManifests(this.content);
            LoadLocalizationDatabases(this.content);
            LoadPresentation();

            GC.Collect(2);

            var screenService = new UIScreenService(content);
            var screen = screenService.Get<ExampleScreen>();

            Ultraviolet.GetUI().GetScreens().Open(screen);

            base.OnLoadingContent();
        }
Example #9
0
        public LoadingScreen(ContentManager globalContent, UIScreenService uiScreenService)
            : base("Content/UI/Screens/LoadingScreen", "LoadingScreen", globalContent)
        {
            Contract.Require(uiScreenService, "uiScreenService");

            this.uiScreenService = uiScreenService;
            this.textRenderer    = new TextRenderer();
            this.blankTexture    = GlobalContent.Load<Texture2D>(GlobalTextureID.Blank);
            this.font            = GlobalContent.Load<SpriteFont>(GlobalFontID.SegoeUI);
            this.spinnerSprite   = LocalContent.Load<Sprite>("Spinner");
            this.loader          = new AsynchronousContentLoader();

            this.textRenderer.RegisterIcon("spinner", spinnerSprite[0]);

            UpdateMessage(String.Empty);
        }
Example #10
0
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");
            LoadContentManifests(this.content);
            LoadLocalizationDatabases(this.content);
            LoadPresentation();

            GC.Collect(2);

            var screenService = new UIScreenService(content);
            var screen        = screenService.Get <ExampleScreen>();

            Ultraviolet.GetUI().GetScreens().Open(screen);

            base.OnLoadingContent();
        }
Example #11
0
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");
            LoadContentManifests();

            var screenService = new UIScreenService(content);
            var screen        = screenService.Get <LoadingScreen>();

            screen.SetContentManager(this.content);
            screen.AddLoadingStep("Loading, please wait...");
            screen.AddLoadingStep(Ultraviolet.GetContent().Manifests["Global"]);
            screen.AddLoadingDelay(2500);
            screen.AddLoadingStep("Loading interface...");
            screen.AddLoadingStep(screenService.Load);
            screen.AddLoadingDelay(2500);
            screen.AddLoadingStep("Reticulating splines...");
            screen.AddLoadingDelay(2500);

            Ultraviolet.GetUI().GetScreens().Open(screen, TimeSpan.Zero);

            base.OnLoadingContent();
        }
Example #12
0
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");
            LoadContentManifests(content);
            LoadLocalizationDatabases(content);

            var screenService = new UIScreenService(content);
            var screen = screenService.Get<LoadingScreen>();

            screen.SetContentManager(this.content);
            screen.AddLoadingStep("Loading, please wait...");
            screen.AddLoadingStep(Ultraviolet.GetContent().Manifests["Global"]);
            screen.AddLoadingDelay(2500);
            screen.AddLoadingStep("Loading interface...");
            screen.AddLoadingStep(screenService.Load);
            screen.AddLoadingDelay(2500);
            screen.AddLoadingStep("Reticulating splines...");
            screen.AddLoadingDelay(2500);

            Ultraviolet.GetUI().GetScreens().Open(screen, TimeSpan.Zero);

            base.OnLoadingContent();
        }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameMenuScreen"/> class.
        /// </summary>
        /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
        /// <param name="uiScreenService">The screen service which created this screen.</param>
        public GameMenuScreen(ContentManager globalContent, UIScreenService uiScreenService)
            : base("Content/UI/Screens/GameMenuScreen", "GameMenuScreen", globalContent, uiScreenService)
        {

        }
Example #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameScreenBase"/> class.
        /// </summary>
        /// <param name="rootDirectory">The root directory of the panel's local content manager.</param>
        /// <param name="definitionAsset">The asset path of the screen's definition file.</param>
        /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
        /// <param name="uiScreenService">The screen service which created this screen.</param>
        public GameScreenBase(String rootDirectory, String definitionAsset, ContentManager globalContent, UIScreenService uiScreenService)
            : base(rootDirectory, definitionAsset, globalContent)
        {
            Contract.Require(uiScreenService, nameof(uiScreenService));

            this.uiScreenService = uiScreenService;
        }
Example #15
0
        /// <summary>
        /// Called when the application is loading content.
        /// </summary>
        protected override void OnLoadingContent()
        {
            this.content = ContentManager.Create("Content");

            if (Ultraviolet.IsRunningInServiceMode)
            {
                LoadPresentation();
                CompileContent();
                CompileBindingExpressions();
                Environment.Exit(0);
            }
            else
            {
                LoadLocalizationDatabases();
                LoadInputBindings();
                LoadContentManifests();
                LoadPresentation();
                
                GC.Collect(2);

                var screenService = new UIScreenService(content);
                var screen = screenService.Get<GameMenuScreen>();

                Ultraviolet.GetUI().GetScreens().Open(screen);
            }

            base.OnLoadingContent();
        }
Example #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GamePlayScreen"/> class.
 /// </summary>
 /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
 /// <param name="uiScreenService">The screen service which created this screen.</param>
 public GamePlayScreen(ContentManager globalContent, UIScreenService uiScreenService)
     : base("Content/UI/Screens/GamePlayScreen", "GamePlayScreen", globalContent, uiScreenService)
 {
     this.escMenuDialog = new EscMenuDialog(this);
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GamePlayScreen"/> class.
 /// </summary>
 /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
 /// <param name="uiScreenService">The screen service which created this screen.</param>
 public GamePlayScreen(ContentManager globalContent, UIScreenService uiScreenService)
     : base("Content/UI/Screens/GamePlayScreen", "GamePlayScreen", globalContent, uiScreenService)
 {
     this.escMenuDialog = new EscMenuDialog(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImGuiScreen"/> class.
 /// </summary>
 /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
 /// <param name="uiScreenService">The screen service which created this screen.</param>
 public ImGuiScreen(ContentManager globalContent, UIScreenService uiScreenService)
     : base("Content/UI/Screens/ImGuiScreen", "ImGuiScreen", globalContent, uiScreenService)
 {
 }
Example #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameMenuScreen"/> class.
 /// </summary>
 /// <param name="globalContent">The content manager with which to load globally-available assets.</param>
 /// <param name="uiScreenService">The screen service which created this screen.</param>
 public GameMenuScreen(ContentManager globalContent, UIScreenService uiScreenService)
     : base("Content/UI/Screens/GameMenuScreen", "GameMenuScreen", globalContent, uiScreenService)
 {
 }
Example #20
0
 public ExampleScreen(ContentManager globalContent, UIScreenService uiScreenService)
     : base("Content/UI/Screens/ExampleScreen", "ExampleScreen", globalContent)
 {
 }
Example #21
0
 public ExampleScreen(ContentManager globalContent, UIScreenService uiScreenService)
     : base("Content/UI/Screens/ExampleScreen", "ExampleScreen", globalContent)
 {
 }