private void OnGroundAmmoCountChange(object source, LightBowgunEventArgs args) { Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { GroundAmmoCounter = args.GroundAmmo; })); }
private void OnSpecialAmmoRegenUpdate(object source, LightBowgunEventArgs args) { Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { SpecialAmmoTimer = TimeSpan.FromSeconds(LightBowgun.GroundAmmoMaxTimer - args.SpecialAmmoRegen).ToString("mm\\:ss"); SpecialAmmoPercentage = args.SpecialAmmoRegen / LightBowgun.GroundAmmoMaxTimer; })); }
private void LBGControl_Loaded(object sender, RoutedEventArgs e) { var args = new LightBowgunEventArgs(Context); OnSpecialAmmoRegenUpdate(this, args); OnGroundAmmoCountChange(this, args); OnAmmoCountChange(this, args); OnEquippedAmmoChange(this, args); OnSafijiivaCounterUpdate(this, new JobEventArgs(Context)); }
private void OnAmmoCountChange(object source, LightBowgunEventArgs args) { Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { sEquippedAmmo ammo = args.EquippedAmmo; sAmmo ammoInfo = args.Ammos.ElementAtOrDefault(ammo.index); AmmoText = $"{ammoInfo.Ammo}/{ammoInfo.Maximum}"; AmmoPercentage = (double)ammoInfo.Ammo / (double)ammoInfo.Maximum; TotalAmmoCounter = ammo.ItemId == 137 ? double.PositiveInfinity : ammoInfo.Total; CalculateCrafting(ammo.ItemId); })); }