public override void Initialize() { this.modifiers = this.Unit.Modifiers as InvokerModifiers; base.Initialize(); }
public override void Initialize() { base.Initialize(); this.BotPanel.AddElement( new ItemPanel( this.Unit, PanelDirection.Bottom, new Vector2(this.HealthBar.Size.Y * 3, (float)(this.HealthBar.Size.Y * 2.2)))); this.skillbook = this.Unit.SkillBook as InvokerSkillBook; this.InvokerSkillPanel = new InvokerSkillPanel( this.Unit, PanelDirection.Bottom, new Vector2(this.HealthBar.Size.Y * 3), skill => !skill.IsItem && skill.Name != "invoker_empty1" && skill.Name != "invoker_empty2" && !(skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_1 || skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_2 || skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_3 || skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_6) && (!skill.SourceAbility.IsHidden || skill.SkillHandle.Equals(this.skillbook?.InvokableSkill?.SkillHandle))); // { // OrderFunction = // skill => // skill.SourceAbility.IsHidden ? 0 : 10 + (uint)skill.SourceAbility.AbilitySlot // }; // this.spellPanel1.PositionFromHealthBarFunc = () => new Vector2(-this.spellPanel1.Size.X, 0); this.LeftPanel.AddElement(this.InvokerSkillPanel); this.spellPanel2 = new SkillPanel( this.Unit, PanelDirection.Bottom, new Vector2(this.HealthBar.Size.Y * 2), skill => !skill.IsItem && !(skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_1 || skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_2 || skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_3 || skill.SourceAbility.AbilitySlot == AbilitySlot.Slot_6) && skill.Name != "invoker_empty1" && skill.Name != "invoker_empty2" && skill.SourceAbility.IsHidden && !skill.Equals(this.skillbook.InvokableSkill), o => o.Skill.Json.CastPriority); // this.spellPanel2.PositionFromHealthBarLeftFunc = // () => new Vector2(-this.spellPanel1.Size.X - this.spellPanel2.Size.X, 0); this.LeftPanel.AddElement(this.spellPanel2); this.skillAddObserver = new DataObserver <SkillAdd>(this.OnNext); this.modifiers = this.Unit.Modifiers as InvokerModifiers; this.invokableSkillChangeAction = () => { this.InvokerSkillPanel.UpdateSkills(); this.spellPanel2.UpdateSkills(); }; this.skillbook.InvokableSkillChange.Subscribe(this.invokableSkillChangeAction); this.becomeVisibleAction = () => { this.InvokerSkillPanel.UpdateSkills(); this.spellPanel2.UpdateSkills(); }; this.Unit.Visibility.BecomeVisibleNotifier.Subscribe(this.becomeVisibleAction); }