/// <summary> /// コンストラクタ /// </summary> public SpellPanelWindow( SpellPanel panel) { this.Panel = panel; this.Panel.PanelWindow = this; _originalPoint = new Point(panel.Left, panel.Top); this.InitializeComponent(); this.MouseLeftButtonDown += (x, y) => { if (!Panel.Locked) { this.DragMove(); } }; this.Closed += (x, y) => { this.activeSpells.Clear(); if (this.Panel != null) { this.Panel.PanelWindow = null; this.Panel = null; } }; this.LocationChanged += (sender, args) => { if (_isRestorePosition) { return; } if (Panel.Locked) { _isRestorePosition = true; Top = _originalPoint.Y; Left = _originalPoint.X; } _isRestorePosition = false; }; this.ActiveSpellViewSource = new CollectionViewSource() { Source = this.activeSpells, IsLiveSortingRequested = true, }; this.ActiveSpellViewSource.SortDescriptions.AddRange(new[] { new SortDescription( nameof(Spell.ActualSortOrder), ListSortDirection.Ascending) }); this.RaisePropertyChanged(nameof(this.ActiveSpellView)); }
/// <summary> /// PanelSettingsRowを取得する /// </summary> /// <param name="panelName">パネルの名前</param> public SpellPanel FindPanelSettingByName(string panelName) { var settings = new SpellPanel() { PanelName = panelName, Top = 10, Left = 10, Margin = 5, Horizontal = false, FixedPositionSpell = false, }; lock (this.spellTimerPanels) { var s = SpellPanelTable.Instance.Table .Where(x => x.PanelName == panelName) .FirstOrDefault(); if (s != null) { settings = s; } else { SpellPanelTable.Instance.Table.Add(settings); } } return(settings); }
void Awake() { inv = GameObject.Find("Inventory").GetComponent <Inventory>(); spellPanel = GameObject.Find("Inventory").GetComponent <SpellPanel>(); amount = 1; tooltip = inv.GetComponent <Tooltip>(); }
public void Initialize(string spell, SpellPanel spellPanel) { this.user = spellPanel.user; GetComponentInChildren <Text>().text = spell; strSpell = spell; btn = GetComponent <Button>(); btn.onClick.AddListener(() => { Click(); }); this.spellPanel = spellPanel; }
public static ISpellPanelWindow GetWindow( SpellPanel panel) { if (panel.EnabledAdvancedLayout) { return(new AdvancedSpellPanelWindow(panel)); } else { return(new SpellPanelWindow(panel)); } }
public AdvancedSpellPanelWindow( SpellPanel panel) { this.Panel = panel; this.Panel.PanelWindow = this; this.InitializeComponent(); this.ToNonActive(); this.Opacity = 0; this.Loaded += (x, y) => this.SubscribeZOrderCorrector(); this.MouseLeftButtonDown += (x, y) => this.DragMove(); for (int r = 0; r < this.GuidRulerGrid.RowDefinitions.Count; r++) { for (int c = 0; c < this.GuidRulerGrid.ColumnDefinitions.Count; c++) { var rect = new Rectangle() { Stroke = Brushes.LemonChiffon, StrokeThickness = 0.2, }; Grid.SetRow(rect, r); Grid.SetColumn(rect, c); this.GuidRulerGrid.Children.Insert(0, rect); } } this.Closed += (x, y) => { this.activeSpells.Clear(); if (this.Panel != null) { this.Panel.PanelWindow = null; this.Panel = null; } }; this.ActiveSpellViewSource = new CollectionViewSource() { Source = this.activeSpells, IsLiveSortingRequested = true, }; this.RaisePropertyChanged(nameof(this.ActiveSpellView)); }
public void Initialize(bool isShowingHeroLevelOnly, Processor processor, Hero owner) { this.isShowingHeroLevelOnly = isShowingHeroLevelOnly; heroName = owner.heroName; GenerateSpellButtons(isShowingHeroLevelOnly);//Generate buttons on the attached panel SetRuneInfo(LoadRuneInfo(heroName)); Button btn = GameObjectUtility.CustomInstantiate(openRunePageBtnPrefab, transform).GetComponent <Button>(); btn.onClick.RemoveAllListeners(); btn.onClick.AddListener(() => { OpenRunePage(); }); inventory = GameObjectUtility.CustomInstantiate(inventoryPrefab, this.transform).GetComponent <Inventory>(); inventory.Initialize(processor, owner); spellPanel = GameObjectUtility.CustomInstantiate(spellPanelPrefab, this.transform).GetComponent <SpellPanel>(); runePage = GameObjectUtility.CustomInstantiate(runePagePrefab, GameObject.Find("HomeScreen").transform).GetComponent <RunePage>(); runePage.userName = heroName; heroNameLabel.text = heroName; }
public AdvancedSpellPanelWindow( SpellPanel panel) { this.Panel = panel; this.Panel.PanelWindow = this; this.InitializeComponent(); this.ToNonActive(); this.MouseLeftButtonDown += (x, y) => this.DragMove(); for (int r = 0; r < this.GuidRulerGrid.RowDefinitions.Count; r++) { for (int c = 0; c < this.GuidRulerGrid.ColumnDefinitions.Count; c++) { var rect = new Rectangle() { Stroke = Brushes.LemonChiffon, StrokeThickness = 0.2, }; Grid.SetRow(rect, r); Grid.SetColumn(rect, c); this.GuidRulerGrid.Children.Insert(0, rect); } } this.Closed += (x, y) => { this.ActiveSpells.Clear(); if (this.Panel != null) { this.Panel.PanelWindow = null; this.Panel = null; } }; this.ActiveSpells.CollectionChanged += this.ActiveSpells_CollectionChanged; this.Opacity = 0; this.Topmost = false; }
public SpellPanelConfigViewModel( SpellPanel model) { this.Model = model; }
public ConfigInit() { Menu = MenuFactory.Create("StormSpirit by Vick", "item_orchid"); SpellPanel = Menu.Menu("Spells"); ItemPanel = Menu.Menu("Items"); AutoEscapeMode = Menu.Menu("Auto Escape Mode"); DrawingTargetMaker = Menu.Menu("Drawing Enemy Marker"); DrawingDamagePanel = Menu.Menu("Drawing Damage Panel"); DrawingRangeDisplay = Menu.Menu("Drawing Range Display"); AntiLinkensSphere = Menu.Menu("Auto Anti Linkens Sphere"); var items = new Dictionary <string, bool> { { "item_dagon_5", true }, { "item_bloodthorn", true }, { "item_mjollnir", true }, { "item_ethereal_blade", true }, { "item_veil_of_discord", true }, { "item_rod_of_atos", true }, { "item_sheepstick", true }, { "item_arcane_boots", true }, { "item_shivas_guard", true }, { "item_lotus_orb", true }, { "item_urn_of_shadows", true }, { "item_soul_ring", true }, { "item_cheese", true }, { "item_black_king_bar", true } }; var link = new Dictionary <string, bool> { { "item_sheepstick", true }, { "item_force_staff", true }, { "item_cyclone", true }, { "item_rod_of_atos", true }, { "item_dagon_5", true }, { "storm_spirit_electric_vortex", true } }; debuff = ItemPanel.Item("Wait ethereal debuff", true); var skills = new Dictionary <string, bool> { { "storm_spirit_static_remnant", true }, { "storm_spirit_electric_vortex", true }, { "storm_spirit_overload", true }, { "storm_spirit_ball_lightning", true } }; var escape = new Dictionary <string, bool> { { "item_travel_boots_2", true }, { "storm_spirit_ball_lightning", true } }; DrawingDamageEnabled = DrawingDamagePanel.Item("Show drawing damage to kill", true); DrawingTargetEnabled = DrawingTargetMaker.Item("Show target", true); DrawingRangeEnabled = DrawingRangeDisplay.Item("Show Spell Range", true); RangeElectricVortex = DrawingRangeDisplay.Item("Draw range for Electric Vortex", true); RangeStaticRemnant = DrawingRangeDisplay.Item("Draw range for Static Remnant", true); AutoAbilityEnabled = AutoEscapeMode.Item("Use abilities if i not have enough health.", true); AutoOverload = SpellPanel.Item("Use Overload if target disable?", false); savemanamode = SpellPanel.Item("The extended logic of using the ultimate on the Storm position.", true); savemanamode.Item.Tooltip = "Compares the rate of storm attack and the rate of use of the ability,logic chooses a more advantageous option."; fastVortex = SpellPanel.Item("Use instant Vortex", true); fastVortex.Item.Tooltip = "Ignoring the passive ability of Overload."; Heel = ItemPanel.Item("Min targets to BKB|Lotus", new Slider(2, 1, 5)); AbilityToggler = SpellPanel.Item("Spells", new AbilityToggler(skills)); ItemToggler = ItemPanel.Item("Items", new AbilityToggler(items)); Link = AntiLinkensSphere.Item("Auto triggre Linken", new AbilityToggler(link)); RHealh = AutoEscapeMode.Item("Minimum health in percent to escape.", new Slider(15, 02, 50)); Escape = AutoEscapeMode.Item("Use abilities if I not have enough health.", new AbilityToggler(escape)); Key = Menu.Item("Combo Key", new KeyBind(68)); Success("Zip! Zap! Ha ha ha ha! Whoa-ho-ho! Ooh, who's that handsome devil?"); }
void Start() { inv = GameObject.Find("Inventory").GetComponent <Inventory>(); hotbar = GameObject.Find("Inventory").GetComponent <Hotbar>(); spellPanel = GameObject.Find("Inventory").GetComponent <SpellPanel>(); }
public SpellPanelConfigViewModel( SpellPanel model) { this.Model = model; this.SetupTagsSource(); }
public SpellPanel GetPanelSettings( string panelName) { double normalize(double value) { var result = value; if (double.IsNaN(result)) { result = 0; } if (value > 65535) { result = 65535; } if (value < -65535) { result = -65535; } return(result); } var settings = new SpellPanel() { PanelName = panelName, Top = 10, Left = 10, Margin = 5, Horizontal = false, FixedPositionSpell = false, }; lock (this.spellTimerPanels) { var panel = this.FindPanelByName(panelName); if (panel != null) { settings.Top = panel.Top; settings.Left = panel.Left; settings.Margin = panel.SpellMargin; settings.Horizontal = panel.IsHorizontal; settings.FixedPositionSpell = panel.SpellPositionFixed; } else { var s = this.FindPanelSettingByName(panelName); if (s != null) { settings = s; } } } // 変な値が入っていたら補正する settings.Top = normalize(settings.Top); settings.Left = normalize(settings.Left); settings.Margin = normalize(settings.Margin); return(settings); }