Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
0
        public void AddToScene(Scene2D scene2D)
        {
            AptPalantir.Reset();

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

            _game.Scene2D.AptWindowManager.PushWindow(_window);
        }
Ejemplo n.º 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);
            };
        }
Ejemplo n.º 6
0
 public static void OnToggleFlashLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 7
0
 public static void OnButtonFrameLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 8
0
 public static void OnTutorial(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 9
0
 // Called after the initialization has been performed
 public static void OnReadyPress(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 10
0
 public static void ResetResolution(string param, ActionContext context, AptWindow window, Game game)
 {
     // Probably used for debug purposes
 }
Ejemplo n.º 11
0
 public static void OnPlanningModeUILoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 12
0
 public static void OnBttnOptions(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 13
0
 public static void OnAptInGameSideCommandBarFadeInComplete(string param, ActionContext context, AptWindow window, Game game)
 {
     logger.Info("InGame commandbar fadein complete!");
 }
Ejemplo n.º 14
0
 public static void OnAptInGameSideCommandBarButtonFrameLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
     AptPalantir.SideButtonsInitialized++;
 }
Ejemplo n.º 15
0
 public static void OnAptInGameSideCommandBarLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
     logger.Info("InGame commandbar loaded!");
 }
Ejemplo n.º 16
0
 public static void OnAptInGameSpellBookLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
     logger.Info("InGame spellbook loaded!");
 }
Ejemplo n.º 17
0
 public static void DisableComponents(string param, ActionContext context, AptWindow window, Game game)
 {
     //TODO: no idea
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 20
0
 public static void OnSpellBookUIShown(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 21
0
 public static void OnHelpBoxLoaded(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 22
0
 public static void Reset(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 23
0
 // Close the game
 public static void ExitGame(string param, ActionContext context, AptWindow window, Game game)
 {
     game.Window.Close();
 }
Ejemplo n.º 24
0
 // Called after the initialization has been performed
 public static void OnInitialized(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 26
0
 public static void BattleSchool(string param, ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 27
0
 public static void PlaySound(string param, ActionContext context, AptWindow window, Game game)
 {
     game.Audio.PlayAudioEvent(param);
 }
Ejemplo n.º 28
0
 public static void DisableComponents(string param, ActionContext context, AptWindow window, Game game)
 {
     // do we need to hide the buttons from MainMenu here?
 }
Ejemplo n.º 29
0
 // Not sure what to do here
 public static void SetBackground(ActionContext context, AptWindow window, Game game)
 {
 }
Ejemplo n.º 30
0
 public static void StopGameMovie(string param, ActionContext context, AptWindow window, Game game)
 {
 }