Esempio n. 1
0
        private void OnPlayerDamageChange(object source, PartyMemberEventArgs args)
        {
            float  percentage;
            string DamageText;

            if (PartyContext.TotalDamage == 0)
            {
                percentage = 0;
            }
            else
            {
                percentage = args.Damage / (float)PartyContext.TotalDamage;
            }
            if (PartyContext.ShowDPS)
            {
                float TimeElapsed = (float)PartyContext.Epoch.TotalSeconds;
                TimeElapsed = TimeElapsed > 0 ? TimeElapsed : 1;
                DamageText  = $"{args.Damage / TimeElapsed:0.00}/s ({percentage * 100:0}%)";
            }
            else
            {
                DamageText = $"{args.Damage} ({percentage * 100:0}%)";
            }
            Dispatch(() => {
                DPSText.Content          = DamageText;
                PlayerDPSBar.Width       = percentage * PlayerDPSBar.MaxWidth;
                PlayerDPSBarEffect.Width = PlayerDPSBar.Width;
            });
        }
Esempio n. 2
0
 private void OnPlayerSpawn(object source, PartyMemberEventArgs args)
 {
     Dispatch(() => {
         PlayerName.Content     = args.Name;
         PlayerClassIcon.Source = args.Weapon == null ? null : (ImageSource)TryFindResource(args.Weapon);
         this.Visibility        = args.IsInParty ? Visibility.Visible : Visibility.Collapsed;
     });
 }
 private void OnPlayerSpawn(object source, PartyMemberEventArgs args)
 {
     Dispatch(() => {
         PlayerName.Text = args.Name;
         MasterRank.Text = Context.MR.ToString();
         HighRank.Text   = Context.HR.ToString();
         if (Context.IsPartyLeader)
         {
             this.PartyLeader.Visibility = Visibility.Visible;
         }
         PlayerClassIcon.Source = args.Weapon == null ? null : (ImageSource)TryFindResource(args.Weapon);
         this.Visibility        = args.IsInParty ? Visibility.Visible : Visibility.Collapsed;
     });
 }
Esempio n. 4
0
        private void OnPlayerDamageChange(object source, PartyMemberEventArgs args)
        {
            string DamageText;

            if (UserSettings.PlayerConfig.Overlay.DPSMeter.ShowDPSWheneverPossible)
            {
                float TimeElapsed = (float)PartyContext.Epoch.TotalSeconds;
                TimeElapsed = TimeElapsed > 0 ? TimeElapsed : 1;
                DamageText  = $"{args.Damage / TimeElapsed:0.00}/s ({Context.DamagePercentage * 100:0}%)";
            }
            else
            {
                DamageText = $"{args.Damage} ({Context.DamagePercentage * 100:0}%)";
            }
            Dispatch(() => {
                DPSText.Content          = DamageText;
                PlayerDPSBar.Width       = Context.DamagePercentage * PlayerDPSBar.MaxWidth;
                PlayerDPSBarEffect.Width = PlayerDPSBar.Width;
            });
        }
Esempio n. 5
0
        private void OnPlayerSpawn(object source, PartyMemberEventArgs args)
        {
            float TimeElapsed = (float)PartyContext.Epoch.TotalSeconds;

            Dispatch(() => {
                PlayerName.Text = args.Name;
                MasterRank.Text = Context.MR.ToString();
                HighRank.Text   = Context.HR.ToString();
                if (Context.IsPartyLeader)
                {
                    this.PartyLeader.Visibility = Visibility.Visible;
                }
                PlayerClassIcon.Source = args.Weapon == null ? null : (ImageSource)TryFindResource(args.Weapon);
                Visibility             = args.IsInParty ? Visibility.Visible : Visibility.Collapsed;
                DamagePerSecond.Text   = $"{Context.Damage / TimeElapsed:0.00}/s";
                TotalDamage.Text       = Context.Damage.ToString();
                Percentage.Text        = $"{Context.DamagePercentage * 100:0.0}%";
                PlayerDPSBar.Width     = Context.DamagePercentage * PlayerDPSBar.MaxWidth;
            });
        }
Esempio n. 6
0
        private void OnPlayerSpawn(object source, PartyMemberEventArgs args)
        {
            float TimeElapsed = (float)partyContext.Epoch.TotalSeconds;

            Dispatch(() =>
            {
                PlayerName = args.Name;
                MasterRank = Context.MR;
                HighRank   = Context.HR;
                if (Context.IsPartyLeader)
                {
                    PartyLeader.Visibility = Visibility.Visible;
                }
                ClassIcon          = args.Weapon == null ? null : (ImageSource)TryFindResource(args.Weapon);
                Visibility         = args.IsInParty ? Visibility.Visible : Visibility.Collapsed;
                DPS                = $"{Context.Damage / TimeElapsed:0.00}/s";
                Damage             = Context.Damage;
                DamagePercentage   = Context.DamagePercentage;
                PlayerDPSBar.Width = Context.DamagePercentage * PlayerDPSBar.MaxWidth;
            });
        }
    void OnPartyMemberNoteProcessed(object sender, PartyMemberEventArgs e)
    {
        Image image;

        Debug.Log("Hello");
        Debug.Log(e.role);

        MakeTransparent(noteRenderers);

        switch (e.role)
        {
        case Notes.Bard:
            image        = noteRenderers[0].GetComponent <Image>();
            image.color  = new Color(255, 255, 255, 1);
            image.sprite = symbols[0];
            break;

        case Notes.Cleric:
            image        = noteRenderers[1].GetComponent <Image>();
            image.color  = new Color(255, 255, 255, 1);
            image.sprite = symbols[1];
            break;

        case Notes.Rogue:
            image        = noteRenderers[2].GetComponent <Image>();
            image.color  = new Color(255, 255, 255, 1);
            image.sprite = symbols[2];
            break;

        case Notes.Fighter:
            image        = noteRenderers[3].GetComponent <Image>();
            image.color  = new Color(255, 255, 255, 1);
            image.sprite = symbols[3];
            break;
        }
    }
Esempio n. 8
0
 private void OnPlayerWeaponChange(object source, PartyMemberEventArgs args) => Dispatch(() =>
 {
     ClassIcon = args.Weapon == null ? null : (ImageSource)TryFindResource(args.Weapon);
 });
Esempio n. 9
0
 private void OnMemberSpawn(object source, PartyMemberEventArgs args) => UpdateSyncState($"{args.Name} spawn");