diff --git a/assets/voxygen/i18n/en/hud/settings.ron b/assets/voxygen/i18n/en/hud/settings.ron index e7b2266b14..48dc95d8c7 100644 --- a/assets/voxygen/i18n/en/hud/settings.ron +++ b/assets/voxygen/i18n/en/hud/settings.ron @@ -26,9 +26,12 @@ "hud.settings.toggle_bar_experience": "Toggle Experience Bar", "hud.settings.scrolling_combat_text": "Scrolling Combat Text", "hud.settings.single_damage_number": "Single Damage Numbers", + "hud.settings.damage_accumulation_duration": "Damage Accumulation Duration", "hud.settings.cumulated_damage": "Cumulated Damage", "hud.settings.incoming_damage": "Incoming Damage", + "hud.settings.incoming_damage_accumulation_duration": "Incoming Damage Accumulation Duration", "hud.settings.cumulated_incoming_damage": "Cumulated Incoming Damage", + "hud.settings.round_damage": "Round Damage", "hud.settings.speech_bubble": "Speech Bubble", "hud.settings.speech_bubble_self": "Show Own Speech Bubbles", "hud.settings.speech_bubble_dark_mode": "Speech Bubble Dark Mode", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 33486678b4..e692f57bb5 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1084,7 +1084,6 @@ pub struct Hud { force_chat_cursor: Option, tab_complete: Option, pulse: f32, - //TODO: ask if this is fine (even though I'm 99.99999% sure it is) hp_pulse: f32, slot_manager: slots::SlotManager, hotbar: hotbar::State, @@ -1567,8 +1566,6 @@ impl Hud { 0 }; // Timer sets the widget offset - // TODO: I feel like I'd prefer for crits to behave the same way for players - // and monsters let y = if floater.info.amount < 0.0 { floater.timer as f64 * number_speed @@ -4530,6 +4527,7 @@ impl Hud { client: &Client, global_state: &GlobalState, ) { + let interface = &global_state.settings.interface; match outcome { Outcome::ExpChange { uid, exp, xp_pools } => { self.floaters.exp_floaters.push(ExpFloater { @@ -4587,17 +4585,21 @@ impl Hud { } { // Group up damage from the same tick, with the same instance number and // crit value - // Would you want to group up crits with the same instance number if you - // don't group the at all with the different setting? for floater in floater_list.floaters.iter_mut().rev() { if floater.timer > 0.0 { break; } if floater.info.instance == info.instance - && floater.info.crit_mult.is_some() == info.crit_mult.is_some() + // Group up crits and regular attacks for incoming damage + && (hit_me + || floater.info.crit_mult.is_some() + == info.crit_mult.is_some()) { floater.info.amount += info.amount; - floater.info.crit_mult = info.crit_mult; + floater.info.crit_mult = match info.crit_mult { + Some(_) => info.crit_mult, + None => floater.info.crit_mult, + }; return; } } @@ -4610,7 +4612,8 @@ impl Hud { } else { f.info.amount > 0.0 }) && if !hit_me { - info.crit_mult.is_some() == f.info.crit_mult.is_some() + // Ignore crit floaters if damage isn't incoming + f.info.crit_mult.is_none() } else { true } @@ -4618,12 +4621,24 @@ impl Hud { match last_floater { Some(f) - // TODO: Change later so it's based on options - // TODO: Might have to discuss whether or not to create a new floater or every crit - if (if hit_me { - f.timer < global_state.settings.interface.sct_inc_dmg_accum_duration + // If the batch option is enabled, group floaters together for a + // default time + if (if hit_me { + // Group up crits and regular attacks for incoming damage + f.timer + < if !interface.sct_player_batch { + interface.sct_inc_dmg_accum_duration + } else { + 1.0 + } } else { - f.timer < global_state.settings.interface.sct_dmg_accum_duration && f.info.crit_mult.is_none() + f.timer + < if !interface.sct_damage_batch { + interface.sct_dmg_accum_duration + } else { + 1.0 + // To avoid grouping up crits with non-crits + } && info.crit_mult.is_none() }) => { f.jump_timer = 0.0; diff --git a/voxygen/src/hud/settings_window/interface.rs b/voxygen/src/hud/settings_window/interface.rs index db75f6a058..4d4b19de7b 100644 --- a/voxygen/src/hud/settings_window/interface.rs +++ b/voxygen/src/hud/settings_window/interface.rs @@ -720,12 +720,10 @@ impl<'a> Widget for Interface<'a> { O Show Damage Numbers O Show single Damage Numbers - // 0 to ??? seconds - O Damage Accumulation Duration: 0s ----I----5s + O Damage Accumulation Duration: 0s ----I----2s O Show batched dealt Damage O Show incoming Damage - // 0 to ??? seconds - O Incoming Damage Accumulation Duration: 0s ----I----5s + O Incoming Damage Accumulation Duration: 0s ----I----2s O Batch incoming Numbers O Round Damage Numbers TODO: Do something like https://gitlab.com/veloren/veloren/-/issues/836 @@ -799,7 +797,7 @@ impl<'a> Widget for Interface<'a> { if !show_sct_damage_batch { Text::new( self.localized_strings - .get("hud.settings.sct_dmg_accum_duration"), + .get("hud.settings.damage_accumulation_duration"), ) .down_from(state.ids.sct_single_dmg_radio, 8.0) .right_from(state.ids.sct_single_dmg_radio, 10.0) @@ -892,7 +890,7 @@ impl<'a> Widget for Interface<'a> { if !show_sct_player_batch { Text::new( self.localized_strings - .get("hud.settings.sct_inc_dmg_accum_duration"), + .get("hud.settings.incoming_damage_accumulation_duration"), ) .down_from(state.ids.sct_inc_dmg_radio, 8.0) .right_from(state.ids.sct_inc_dmg_radio, 10.0)