예제 #1
0
파일: OpenRom.cs 프로젝트: joncloud/ztwedit
        /// <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);
            }
        }
예제 #2
0
파일: SaveRom.cs 프로젝트: joncloud/ztwedit
        /// <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);
        }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <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();
     }
 }
예제 #5
0
파일: SaveAll.cs 프로젝트: joncloud/ztwedit
 /// <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();
     }
 }
예제 #6
0
 /// <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());
 }
예제 #7
0
        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;
        }
예제 #8
0
 /// <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);
 }
예제 #9
0
        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();
        }
예제 #10
0
        /// <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);
        }
예제 #11
0
        /// <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;
        }
예제 #12
0
 public MantaStyleUsable(Ability9 ability, IMainMenu menu)
     : base(ability, menu)
 {
 }
예제 #13
0
 /// <summary>
 /// Do work with the main menu.
 /// </summary>
 public void DoWork(IMainMenu mainMenu)
 {
     // Close the main menu's form.
     mainMenu.Form.Close();
 }
예제 #14
0
 public AvalancheEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #15
0
 public WarStompEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #16
0
 public RotEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.ModifierCounters.UnionWith(Abilities.MagicShield);
 }
예제 #17
0
 public HealingSalveEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.ModifierCounters.UnionWith(Abilities.FlaskNukes);
 }
예제 #18
0
 public TreeGrabUsable(Ability9 ability, IMainMenu menu)
     : base(ability, menu)
 {
     this.CanBeCastedOnAlly = true;
 }
예제 #19
0
 public DesecrateEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #20
0
 protected LinearProjectileEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.RangedAbility = (RangedAbility)ability;
 }
예제 #21
0
 public BlackKingBarEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.ModifierDisables.UnionWith(Abilities.Root);
 }
예제 #22
0
 public Mouse(IMainMenu mainMenu, ILog log)
 {
     this.mainMenu = mainMenu;
     this.log      = log;
 }
예제 #23
0
 public BladeMailUsable(Ability9 ability, IMainMenu menu)
     : base(ability, menu)
 {
 }
예제 #24
0
 public RollingBoulderEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     //todo fix stone speed ?
     this.Counters.Add(Abilities.PhaseShift);
 }
예제 #25
0
        public FortunesEndUsableCounter(Ability9 ability, IActionManager actionManager, IMainMenu menu)
            : base(ability, menu)
        {
            this.actionManager = actionManager;

            this.CanBeCastedOnAlly = true;
            this.CanBeCastedOnSelf = true;
        }
예제 #26
0
 protected GlobalEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #27
0
 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);
        }
예제 #29
0
 public SpiritVesselEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.ModifierCounters.UnionWith(Abilities.AllyPurge);
     this.ModifierCounters.Add(Abilities.PressTheAttack);
 }
예제 #30
0
        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");
        }
예제 #31
0
 public MischiefUsable(Ability9 ability, IMainMenu menu)
     : base(ability, menu)
 {
 }
예제 #32
0
 public WhirlingDeathEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.ModifierCounters.UnionWith(Abilities.AllyPurge);
 }
예제 #33
0
 public GeomagneticGripEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #34
0
 protected ProjectileEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #35
0
 public EnrageUsable(Ability9 ability, IMainMenu menu)
     : base(ability, menu)
 {
 }
예제 #36
0
 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);
 }
예제 #38
0
 public AeonDiskEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.ModifierDisables.UnionWith(Abilities.EnemyPurge);
 }
예제 #39
0
 public void Initialize(IMainMenu mainMenu, IGameOverMenu gameOverMenu)
 {
     this.mainMenu = mainMenu;
     this.gameOverMenu = gameOverMenu;
 }
예제 #40
0
 public PlasmaFieldEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
 }
예제 #41
0
 public PrimalSplitEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.Disables.UnionWith(Abilities.Disable);
 }
예제 #42
0
 public KineticFieldEvadable(Ability9 ability, IPathfinder pathfinder, IMainMenu menu)
     : base(ability, pathfinder, menu)
 {
     this.Counters.Add(Abilities.IronBranch);
 }
예제 #43
0
파일: DodgeMode.cs 프로젝트: vana41203/O9K
        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;
        }
예제 #44
0
 /// <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); }
 }