public FlowerTargetWindow(FlowerQueueItem item, bool isEditMode = true)
            : this()
        {
            if (isEditMode)
              {
            this.Title = "Edit Target";
            okButton.Content = "_Save Changes";
              }

              this.FlowerQueueItem.Id = item.Id;
              SetTargetForMode(item.Target);

              if (item.Interval.HasValue)
            intervalTextBox.Text = item.Interval.Value.ToShortEnglish();
              else
            intervalTextBox.Text = string.Empty;

              intervalCheckBox.IsChecked = item.Interval.HasValue;

              if (item.ManaThreshold.HasValue)
            manaThresholdUpDown.Value = item.ManaThreshold.Value;
              else
            manaThresholdUpDown.Value = 1000;

              manaThresholdCheckBox.IsChecked = item.ManaThreshold.HasValue;

              this.IsEditMode = isEditMode;
        }
 public FlowerQueueItemEventArgs(FlowerQueueItem flower)
 {
     this.flower = flower;
 }
Ejemplo n.º 3
0
        public void ImportMacroState(Player player, SavedMacroState state)
        {
            if (player == null)
            throw new ArgumentNullException("player");

              if (state == null)
            throw new ArgumentNullException("state");

              var macro = GetMacroState(player);
              if (macro == null)
            return;

              macro.Stop();

              var process = Process.GetCurrentProcess();

              if (player.HasHotkey)
              {
            HotkeyManager.Instance.UnregisterHotkey(process.MainWindowHandle, player.Hotkey);
            player.Hotkey = null;
              }

              player.Skillbook.ClearActiveSkills();
              macro.ClearSpellQueue();
              macro.ClearFlowerQueue();

              player.Update(PlayerFieldFlags.Spellbook);
              macro.UseLyliacVineyard = player.HasLyliacVineyard && state.UseLyliacVineyard;
              macro.FlowerAlternateCharacters = player.HasLyliacPlant && state.FlowerAlternateCharacters;

              player.Update(PlayerFieldFlags.Skillbook);
              foreach (var skill in state.Skills)
              {
            if (!player.Skillbook.ContainSkill(skill.SkillName))
              continue;

            player.Skillbook.ToggleActive(skill.SkillName, true);
              }

              foreach (var spell in state.Spells)
              {
            if (!player.Spellbook.ContainSpell(spell.SpellName))
              continue;

            var spellInfo = player.Spellbook.GetSpell(spell.SpellName);
            if (spellInfo == null)
              continue;

            var queueItem = new SpellQueueItem(spellInfo, spell);
            macro.AddToSpellQueue(queueItem);
              }

              if (player.HasLyliacPlant)
            foreach (var flower in state.Flowers)
            {
              if (flower.TargetMode == TargetCoordinateUnits.None)
            continue;

              var queueItem = new FlowerQueueItem(flower);
              macro.AddToFlowerQueue(queueItem);
            }

              var windowHandle = Process.GetCurrentProcess().MainWindowHandle;

              if (state.HotkeyKey != Key.None && (state.HotkeyModifiers != ModifierKeys.None || Hotkey.IsFunctionKey(state.HotkeyKey)))
              {
            var hotkey = new Hotkey(state.HotkeyModifiers, state.HotkeyKey);

            if (HotkeyManager.Instance.RegisterHotkey(windowHandle, hotkey))
              player.Hotkey = hotkey;
              }
        }
Ejemplo n.º 4
0
 public SavedFlowerState(FlowerQueueItem item)
     : this(item.Target, item.Interval, item.ManaThreshold)
 {
 }