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); }
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(); }
// 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; }
public void AddToScene(Scene2D scene2D) { AptPalantir.Reset(); _window = _game.LoadAptWindow("Palantir.apt"); _root = _window.Root; _game.Scene2D.AptWindowManager.PushWindow(_window); }
// 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); }; }
public static void OnToggleFlashLoaded(string param, ActionContext context, AptWindow window, Game game) { }
public static void OnButtonFrameLoaded(string param, ActionContext context, AptWindow window, Game game) { }
public static void OnTutorial(string param, ActionContext context, AptWindow window, Game game) { }
// Called after the initialization has been performed public static void OnReadyPress(string param, ActionContext context, AptWindow window, Game game) { }
public static void ResetResolution(string param, ActionContext context, AptWindow window, Game game) { // Probably used for debug purposes }
public static void OnPlanningModeUILoaded(string param, ActionContext context, AptWindow window, Game game) { }
public static void OnBttnOptions(string param, ActionContext context, AptWindow window, Game game) { }
public static void OnAptInGameSideCommandBarFadeInComplete(string param, ActionContext context, AptWindow window, Game game) { logger.Info("InGame commandbar fadein complete!"); }
public static void OnAptInGameSideCommandBarButtonFrameLoaded(string param, ActionContext context, AptWindow window, Game game) { AptPalantir.SideButtonsInitialized++; }
public static void OnAptInGameSideCommandBarLoaded(string param, ActionContext context, AptWindow window, Game game) { logger.Info("InGame commandbar loaded!"); }
public static void OnAptInGameSpellBookLoaded(string param, ActionContext context, AptWindow window, Game game) { logger.Info("InGame spellbook loaded!"); }
public static void DisableComponents(string param, ActionContext context, AptWindow window, Game game) { //TODO: no idea }
public static void Credits(string param, ActionContext context, AptWindow window, Game game) { var aptWindow = game.LoadAptWindow("LanOpenPlay.apt"); game.Scene2D.AptWindowManager.QueryTransition(aptWindow); }
public static void MultiplayerButtonPressed(string param, ActionContext context, AptWindow window, Game game) { var aptWindow = game.LoadAptWindow("MPGameSetup.apt"); game.Scene2D.AptWindowManager.QueryTransition(aptWindow); }
public static void OnSpellBookUIShown(string param, ActionContext context, AptWindow window, Game game) { }
public static void OnHelpBoxLoaded(string param, ActionContext context, AptWindow window, Game game) { }
public static void Reset(string param, ActionContext context, AptWindow window, Game game) { }
// Close the game public static void ExitGame(string param, ActionContext context, AptWindow window, Game game) { game.Window.Close(); }
// Called after the initialization has been performed public static void OnInitialized(string param, ActionContext context, AptWindow window, Game game) { }
public static void CreateAHero(string param, ActionContext context, AptWindow window, Game game) { var aptWindow = game.LoadAptWindow("Skirmish.apt"); game.Scene2D.AptWindowManager.QueryTransition(aptWindow); }
public static void BattleSchool(string param, ActionContext context, AptWindow window, Game game) { }
public static void PlaySound(string param, ActionContext context, AptWindow window, Game game) { game.Audio.PlayAudioEvent(param); }
public static void DisableComponents(string param, ActionContext context, AptWindow window, Game game) { // do we need to hide the buttons from MainMenu here? }
// Not sure what to do here public static void SetBackground(ActionContext context, AptWindow window, Game game) { }
public static void StopGameMovie(string param, ActionContext context, AptWindow window, Game game) { }