/// <summary> /// Do work with the main menu. /// </summary> public override void DoWork(IMainMenu mainMenu) { // Show the open file dialog and try and load the ROM. using (var dialog = new OpenFileDialog()) { // Only continue if the user chose a file. if (dialog.ShowDialog() != DialogResult.OK) { return; } // Try and load the rom. if (!mainMenu.Rom.Load(dialog.FileName)) { return; } // Enable the menu items. mainMenu.GetButtonItem("Save").Enabled = true; mainMenu.GetButtonItem("Save All").Enabled = true; mainMenu.GetButtonItem("Properties").Enabled = true; mainMenu.GetMenuItem(@"&File\&Close").Enabled = true; mainMenu.GetMenuItem(@"&File\&Save").Enabled = true; mainMenu.GetMenuItem(@"&File\Save &All").Enabled = true; mainMenu.GetMenuItem(@"&View\&New Game Values").Enabled = true; mainMenu.GetMenuItem(@"&View\&Properties").Enabled = true; mainMenu.GetMenuItem(@"&View\&Overworld\&East Hyrule").Enabled = true; mainMenu.GetMenuItem(@"&View\&Overworld\&West Hyrule").Enabled = true; mainMenu.GetMenuItem(@"&View\&Overworld\&Maze Island").Enabled = true; mainMenu.GetMenuItem(@"&View\&Overworld\&Death Mountain").Enabled = true; // Show the Properties view. base.DoWork(mainMenu); } }
/// <summary> /// Do work with the main menu. /// </summary> public override void DoWork(IMainMenu mainMenu) { // Save all open views. base.DoWork(mainMenu); // Save the rom. mainMenu.Rom.Save(mainMenu.Rom.FileInfo.FullName); }
/// <summary> /// Do work with the main menu. /// </summary> public void DoWork(IMainMenu mainMenu) { MessageBox.Show( "Zelda II: Adventure of Link ROM Editor\r\nhttp://jon-cloud.net/ztwedit/", "About", MessageBoxButtons.OK, MessageBoxIcon.Information); }
/// <summary> /// Do work with the main menu. /// </summary> public void DoWork(IMainMenu mainMenu) { // Shows the release notes view. using (var dialog = new ReleaseNotesView()) { dialog.ShowDialog(); } }
/// <summary> /// Do work with the main menu. /// </summary> public virtual void DoWork(IMainMenu mainMenu) { // Save any views that are open. foreach (var view in mainMenu.Views) { view.Save(); } }
/// <summary> /// Do work with the main menu. /// </summary> public virtual void DoWork(IMainMenu mainMenu) { // Only show the properties view once. var view = mainMenu.Views.OfType<PropertiesView>().FirstOrDefault(); if (view != null) { mainMenu.ActiveView = view; return; } mainMenu.Show(new PropertiesView()); }
public static IMainMenu GetMainMenu() { string repomode = ConfigurationManager.AppSettings["repomode"]; if (_wF == null) { if (repomode == "T") _mM = new MainMenu("TEST mode ..."); Console.ResetColor(); if (repomode == "P") _mM = new MainMenu("PRODUCTION mode ..."); Console.ResetColor(); } return _mM; }
/// <summary> /// Do work with the main menu. /// </summary> public virtual void DoWork(IMainMenu mainMenu) { // Only show the new game values view once. var existing = mainMenu.Views.OfType<NewGameValuesView>().FirstOrDefault(); if (existing != null) { mainMenu.ActiveView = existing; return; } var view = new NewGameValuesView(); var data = new byte[RomMap.NewGameValuesLength]; Array.Copy(mainMenu.Rom.Data, RomMap.NewGameValuesOffset, data, 0, data.Length); view.Parameters.Add("Data", data); mainMenu.Show(view); }
public void Start() { try { gameOver = new GameOverMenu(); game = new GameScene(); menu = new MainMenu(); Log.Instance.Write("Game scene init started"); game.SetController(this); game.SetRenderSurface(surface); game.SetSound(sound); game.Initialize(menu, gameOver); game.LoadResources(); game.Reset(); Log.Instance.Write("Game scene init completed"); Log.Instance.Write("Menu scene init started"); menu.SetController(this); menu.SetRenderSurface(surface); menu.SetSound(sound); menu.Initialize(game); menu.LoadResources(); Log.Instance.Write("Menu scene init completed"); Log.Instance.Write("GameOver scene init started"); gameOver.SetController(this); gameOver.SetRenderSurface(surface); gameOver.SetSound(sound); gameOver.Initialize(game); gameOver.LoadResources(); Log.Instance.Write("GameOver scene init completed"); } catch (Exception ex) { Log.Instance.Write("ERROR: Controller.Start() : " + Environment.NewLine + "\t\t" + ex.ToString()); } currentScene = menu; Render(); }
/// <summary> /// Do work with the main menu. /// </summary> public void DoWork(IMainMenu mainMenu) { // Only allow one view per overworld. var existing = mainMenu.Views.OfType<OverworldMapView>().Where(v => v.Parameters["Offset"].Equals(this.Offset)).FirstOrDefault(); if (existing != null) { mainMenu.ActiveView = existing; return; } // Create a new array to store a copy of the map in. var data = new byte[this.Length]; Array.Copy(mainMenu.Rom.Data, this.Offset, data, 0, this.Length); // Load the overworld view. var view = new OverworldMapView(); view.Parameters.Add("Data", data); view.Parameters.Add("Title", this.Title); view.Parameters.Add("Offset", this.Offset); mainMenu.Show(view); }
/// <summary> /// Do work with the main menu. /// </summary> public void DoWork(IMainMenu mainMenu) { // If any view cannot be closed then return. foreach (var view in mainMenu.Views.ToArray()) { if (!mainMenu.Close(view)) { return; } } // Close the rom. mainMenu.Rom.Close(); // Disable any button that is related to the ROM being open. mainMenu.GetButtonItem("Save").Enabled = false; mainMenu.GetButtonItem("Save All").Enabled = false; mainMenu.GetButtonItem("Properties").Enabled = false; mainMenu.GetMenuItem(@"&File\&Close").Enabled = false; mainMenu.GetMenuItem(@"&File\&Save").Enabled = false; mainMenu.GetMenuItem(@"&File\Save &All").Enabled = false; mainMenu.GetMenuItem(@"&View\&Properties").Enabled = false; mainMenu.GetMenuItem(@"&View\&Overworld\&East Hyrule").Enabled = false; mainMenu.GetMenuItem(@"&View\&Overworld\&West Hyrule").Enabled = false; mainMenu.GetMenuItem(@"&View\&Overworld\&Maze Island").Enabled = false; mainMenu.GetMenuItem(@"&View\&Overworld\&Death Mountain").Enabled = false; }
public MantaStyleUsable(Ability9 ability, IMainMenu menu) : base(ability, menu) { }
/// <summary> /// Do work with the main menu. /// </summary> public void DoWork(IMainMenu mainMenu) { // Close the main menu's form. mainMenu.Form.Close(); }
public AvalancheEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
public WarStompEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
public RotEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierCounters.UnionWith(Abilities.MagicShield); }
public HealingSalveEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierCounters.UnionWith(Abilities.FlaskNukes); }
public TreeGrabUsable(Ability9 ability, IMainMenu menu) : base(ability, menu) { this.CanBeCastedOnAlly = true; }
public DesecrateEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
protected LinearProjectileEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.RangedAbility = (RangedAbility)ability; }
public BlackKingBarEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierDisables.UnionWith(Abilities.Root); }
public Mouse(IMainMenu mainMenu, ILog log) { this.mainMenu = mainMenu; this.log = log; }
public BladeMailUsable(Ability9 ability, IMainMenu menu) : base(ability, menu) { }
public RollingBoulderEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { //todo fix stone speed ? this.Counters.Add(Abilities.PhaseShift); }
public FortunesEndUsableCounter(Ability9 ability, IActionManager actionManager, IMainMenu menu) : base(ability, menu) { this.actionManager = actionManager; this.CanBeCastedOnAlly = true; this.CanBeCastedOnSelf = true; }
protected GlobalEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
public Spells(IMainMenu mainMenu, ILog log) { this.mainMenu = mainMenu; this.log = log; this.player = EntityManager.LocalPlayer; }
public UnstableConcoctionThrowEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.Blinks.UnionWith(Abilities.Blink); this.Disables.UnionWith(Abilities.Disable); this.Disables.UnionWith(Abilities.PhysDisable); this.Counters.UnionWith(Abilities.VsDisableProjectile); this.Counters.UnionWith(Abilities.StrongShield); this.Counters.UnionWith(Abilities.Invulnerability); this.Counters.Add(Abilities.AttributeShift); this.Counters.Add(Abilities.LotusOrb); this.Counters.UnionWith(Abilities.StrongPhysShield); this.Counters.Add(Abilities.Bulwark); this.Counters.UnionWith(Abilities.Heal); this.Counters.Add(Abilities.Armlet); this.Counters.UnionWith(Abilities.Suicide); this.Counters.UnionWith(Abilities.Invisibility); this.Counters.Add(Abilities.BladeMail); this.Counters.Add(Abilities.HurricanePike); this.Counters.UnionWith(Abilities.SlowHeal); this.ModifierCounters.UnionWith(Abilities.AllyStrongPurge); this.ModifierCounters.UnionWith(Abilities.Invulnerability); this.ModifierCounters.UnionWith(Abilities.StrongPhysShield); }
public SpiritVesselEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierCounters.UnionWith(Abilities.AllyPurge); this.ModifierCounters.Add(Abilities.PressTheAttack); }
public Snatcher(IContext9 context, IMainMenu mainMenu) { this.context = context; this.enabled = mainMenu.SnatcherMenu.Add(new MenuSwitcher("Enabled")); this.enabled.AddTranslation(Lang.Ru, "Включено"); this.enabled.AddTranslation(Lang.Cn, "启用"); var hold = mainMenu.SnatcherMenu.Add(new Menu("Hold")); hold.AddTranslation(Lang.Ru, "Удерживание"); hold.AddTranslation(Lang.Cn, "按住"); this.holdKey = hold.Add(new MenuHoldKey("Key")); this.holdKey.AddTranslation(Lang.Ru, "Клавиша"); this.holdKey.AddTranslation(Lang.Cn, "键"); this.holdToggler = hold.Add(new MenuAbilityToggler("Take")); this.holdToggler.AddTranslation(Lang.Ru, "Забирать"); this.holdToggler.AddTranslation(Lang.Cn, "拿起"); this.aegisKey = hold.Add(new MenuHoldKey("Aegis key").SetTooltip("Steal aegis with abilities")); this.aegisKey.AddTranslation(Lang.Ru, "Клавиша аегиса"); this.aegisKey.AddTooltipTranslation(Lang.Ru, "Украсть аегис используя способности"); this.aegisKey.AddTranslation(Lang.Cn, "不朽盾键位"); this.aegisKey.AddTooltipTranslation(Lang.Cn, "用技能偷盾"); this.aegisAbilityToggler = hold.Add(new MenuAbilityToggler("Abilities", this.menuAbilities)); this.aegisAbilityToggler.AddTranslation(Lang.Ru, "Способности"); this.aegisAbilityToggler.AddTranslation(Lang.Cn, "技能"); var toggle = mainMenu.SnatcherMenu.Add(new Menu("Toggle")); toggle.AddTranslation(Lang.Ru, "Переключение"); toggle.AddTranslation(Lang.Cn, "切换"); this.toggleKey = toggle.Add(new MenuToggleKey("Key", Key.None, false)); this.toggleKey.AddTranslation(Lang.Ru, "Клавиша"); this.toggleKey.AddTranslation(Lang.Cn, "键"); this.toggleToggler = toggle.Add(new MenuAbilityToggler("Take")); this.toggleToggler.AddTranslation(Lang.Ru, "Забирать"); this.toggleToggler.AddTranslation(Lang.Cn, "拿起"); var status = mainMenu.SnatcherMenu.Add(new Menu("Status")); status.AddTranslation(Lang.Ru, "Статус"); status.AddTranslation(Lang.Cn, "状态"); this.statusEnabled = status.Add(new MenuSwitcher("Enabled", false).SetTooltip("Show when snatcher is active")); this.statusEnabled.AddTranslation(Lang.Ru, "Включено"); this.statusEnabled.AddTooltipTranslation(Lang.Ru, "Показывать когда снатчер включен"); this.statusEnabled.AddTranslation(Lang.Cn, "启用"); this.statusEnabled.AddTooltipTranslation(Lang.Cn, "显示神符抢夺者状态"); this.statusX = status.Add(new MenuSlider("Position X", (int)(Hud.Info.ScreenSize.X * 0.01f), 0, (int)Hud.Info.ScreenSize.X)); this.statusX.AddTranslation(Lang.Ru, "X позиция"); this.statusX.AddTranslation(Lang.Cn, "X位置"); this.statusY = status.Add(new MenuSlider("Position Y", (int)(Hud.Info.ScreenSize.Y * 0.1f), 0, (int)Hud.Info.ScreenSize.Y)); this.statusY.AddTranslation(Lang.Ru, "Y позиция"); this.statusY.AddTranslation(Lang.Cn, "Y位置"); // dummy this.aegisDummyToggler = new MenuAbilityToggler("dummy"); }
public MischiefUsable(Ability9 ability, IMainMenu menu) : base(ability, menu) { }
public WhirlingDeathEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierCounters.UnionWith(Abilities.AllyPurge); }
public GeomagneticGripEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
protected ProjectileEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
public EnrageUsable(Ability9 ability, IMainMenu menu) : base(ability, menu) { }
public MagneticFieldUsable(Ability9 ability, IMainMenu menu) : base(ability, menu) { }
public UnstableConcoctionAllyEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierCounters.Add(Abilities.MantaStyle); }
public AeonDiskEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.ModifierDisables.UnionWith(Abilities.EnemyPurge); }
public void Initialize(IMainMenu mainMenu, IGameOverMenu gameOverMenu) { this.mainMenu = mainMenu; this.gameOverMenu = gameOverMenu; }
public PlasmaFieldEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { }
public PrimalSplitEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.Disables.UnionWith(Abilities.Disable); }
public KineticFieldEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu) : base(ability, pathfinder, menu) { this.Counters.Add(Abilities.IronBranch); }
public DodgeMode(IActionManager actionManager, List <DodgeAbility> dodgeAbilities, IPathfinder pathfinder, IMainMenu menu) : base(actionManager) { this.dodgeAbilities = dodgeAbilities; this.pathfinder = pathfinder; menu.Hotkeys.PathfinderMode.ValueChange += this.PathfinderModeOnValueChanged; }
/// <summary> /// Do work with the main menu. /// </summary> public void DoWork(IMainMenu mainMenu) { // If there is an active view then cloes it. var view = mainMenu.ActiveView; if (view != null) { mainMenu.Close(view); } }