Example #1
0
        public static void Save(string param, ActionContext context, AptWindow window, Game game)
        {
            // TODO: save
            var aptWindow = game.LoadAptWindow("MainMenu.apt");

            game.Scene2D.AptWindowManager.QueryTransition(aptWindow);
        }
Example #2
0
        protected override void DrawOverride(ref bool isGameViewFocused)
        {
            if (Context.SelectedAptWindow == null)
            {
                ImGui.Text("APT geometry is only available when an APT window has been selected in the APT Windows window.");
                return;
            }

            var geometryChanged = false;

            if (Context.SelectedAptWindow != _currentWindow)
            {
                _geometryNames = Context.SelectedAptWindow.AptFile.GeometryMap.Keys
                                 .Select(x => x.ToString())
                                 .ToArray();
                _currentWindow   = Context.SelectedAptWindow;
                _currentGeometry = 0;
                geometryChanged  = true;
            }

            if (ImGui.Combo("Geometry", ref _currentGeometry, _geometryNames, _geometryNames.Length))
            {
                geometryChanged = true;
            }

            var geometry = Context.SelectedAptWindow.AptFile.GeometryMap[Convert.ToUInt32(_geometryNames[_currentGeometry])];

            ImGui.BeginChild("geometry sidebar", new Vector2(150, 0), true, 0);
            ImGui.TextWrapped(geometry.RawText);
            ImGui.EndChild();

            ImGui.SameLine();

            if (geometryChanged)
            {
                _shapeRenderer = new ShapeRenderer(
                    geometry,
                    Context.Game.ContentManager,
                    Context.Game.GraphicsLoadContext,
                    Context.Game.AssetStore,
                    Context.SelectedAptWindow.AptFile.ImageMap,
                    Context.SelectedAptWindow.AptFile.MovieName);
            }

            var currentSize = ImGui.GetContentRegionAvail();

            if (geometryChanged || _cachedSize != currentSize)
            {
                var newSize = new Size((int)currentSize.X, (int)currentSize.Y);

                _shapeRenderer.Update(
                    Context.Game.GraphicsDevice,
                    newSize);

                _cachedSize = currentSize;
            }

            _renderedView.Draw();
        }
Example #3
0
        // Called after the initialization has been performed
        public static void OnInitialized(string param, ActionContext context, AptWindow window, Game game)
        {
            // Set the logo texture
            var imageSprite = window.Root.ScriptObject.Variables["Image"].ToObject().Item as SpriteItem;
            var shape       = imageSprite.Content.Items[1] as RenderItem;

            shape.Texture = game.GetMappedImage("LogoWithShadow").Texture.Value;
        }
Example #4
0
        public void AddToScene(Scene2D scene2D)
        {
            AptPalantir.Reset();

            _window = _game.LoadAptWindow("Palantir.apt");
            _root   = _window.Root;

            _game.Scene2D.AptWindowManager.PushWindow(_window);
        }
Example #5
0
        // Called after the initialization has been performed
        public static void OnInitialized(string param, ActionContext context, AptWindow window, Game game)
        {
            // Set a custom render callback
            var logoTexture = game.GetMappedImage("LogoWithShadow").Texture.Value;
            var imageSprite = window.Root.ScriptObject.Variables["Image"].ToObject().Item as SpriteItem;
            var shape       = imageSprite.Content.Items[1] as RenderItem;

            shape.RenderCallback = (AptRenderingContext renderContext, Geometry geom) =>
            {
                renderContext.RenderGeometry(geom, logoTexture);
            };
        }
Example #6
0
 public static void OnToggleFlashLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #7
0
 public static void OnButtonFrameLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #8
0
 public static void OnTutorial(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #9
0
 // Called after the initialization has been performed
 public static void OnReadyPress(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #10
0
 public static void ResetResolution(string param, ActionContext context, AptWindow window, Game game)
 {
     // Probably used for debug purposes
 }
Example #11
0
 public static void OnPlanningModeUILoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #12
0
 public static void OnBttnOptions(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #13
0
 public static void OnAptInGameSideCommandBarFadeInComplete(string param, ActionContext context, AptWindow window, Game game)
 {
     logger.Info("InGame commandbar fadein complete!");
 }
Example #14
0
 public static void OnAptInGameSideCommandBarButtonFrameLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
     AptPalantir.SideButtonsInitialized++;
 }
Example #15
0
 public static void OnAptInGameSideCommandBarLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
     logger.Info("InGame commandbar loaded!");
 }
Example #16
0
 public static void OnAptInGameSpellBookLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
     logger.Info("InGame spellbook loaded!");
 }
Example #17
0
 public static void DisableComponents(string param, ActionContext context, AptWindow window, Game game)
 {
     //TODO: no idea
 }
Example #18
0
        public static void Credits(string param, ActionContext context, AptWindow window, Game game)
        {
            var aptWindow = game.LoadAptWindow("LanOpenPlay.apt");

            game.Scene2D.AptWindowManager.QueryTransition(aptWindow);
        }
Example #19
0
        public static void MultiplayerButtonPressed(string param, ActionContext context, AptWindow window, Game game)
        {
            var aptWindow = game.LoadAptWindow("MPGameSetup.apt");

            game.Scene2D.AptWindowManager.QueryTransition(aptWindow);
        }
Example #20
0
 public static void OnSpellBookUIShown(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #21
0
 public static void OnHelpBoxLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #22
0
 public static void Reset(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #23
0
 // Close the game
 public static void ExitGame(string param, ActionContext context, AptWindow window, Game game)
 {
     game.Window.Close();
 }
Example #24
0
 // Called after the initialization has been performed
 public static void OnInitialized(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #25
0
        public static void CreateAHero(string param, ActionContext context, AptWindow window, Game game)
        {
            var aptWindow = game.LoadAptWindow("Skirmish.apt");

            game.Scene2D.AptWindowManager.QueryTransition(aptWindow);
        }
Example #26
0
 public static void BattleSchool(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Example #27
0
 public static void PlaySound(string param, ActionContext context, AptWindow window, Game game)
 {
     game.Audio.PlayAudioEvent(param);
 }
Example #28
0
 public static void DisableComponents(string param, ActionContext context, AptWindow window, Game game)
 {
     // do we need to hide the buttons from MainMenu here?
 }
Example #29
0
 // Not sure what to do here
 public static void SetBackground(ActionContext context, AptWindow window, Game game)
 {
 }
Example #30
0
 public static void StopGameMovie(string param, ActionContext context, AptWindow window, Game game)
 {
 }