basic i18n for english + code touchups

Getting Invalid Probability error when attacking a lot of enemies - needs to be checked out
This commit is contained in:
socksonme 2022-04-26 20:16:18 +03:00 committed by Socksonme
parent ddf0ba6dd6
commit 762b726d21
3 changed files with 35 additions and 19 deletions

View File

@ -26,9 +26,12 @@
"hud.settings.toggle_bar_experience": "Toggle Experience Bar", "hud.settings.toggle_bar_experience": "Toggle Experience Bar",
"hud.settings.scrolling_combat_text": "Scrolling Combat Text", "hud.settings.scrolling_combat_text": "Scrolling Combat Text",
"hud.settings.single_damage_number": "Single Damage Numbers", "hud.settings.single_damage_number": "Single Damage Numbers",
"hud.settings.damage_accumulation_duration": "Damage Accumulation Duration",
"hud.settings.cumulated_damage": "Cumulated Damage", "hud.settings.cumulated_damage": "Cumulated Damage",
"hud.settings.incoming_damage": "Incoming 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.cumulated_incoming_damage": "Cumulated Incoming Damage",
"hud.settings.round_damage": "Round Damage",
"hud.settings.speech_bubble": "Speech Bubble", "hud.settings.speech_bubble": "Speech Bubble",
"hud.settings.speech_bubble_self": "Show Own Speech Bubbles", "hud.settings.speech_bubble_self": "Show Own Speech Bubbles",
"hud.settings.speech_bubble_dark_mode": "Speech Bubble Dark Mode", "hud.settings.speech_bubble_dark_mode": "Speech Bubble Dark Mode",

View File

@ -1084,7 +1084,6 @@ pub struct Hud {
force_chat_cursor: Option<Index>, force_chat_cursor: Option<Index>,
tab_complete: Option<String>, tab_complete: Option<String>,
pulse: f32, pulse: f32,
//TODO: ask if this is fine (even though I'm 99.99999% sure it is)
hp_pulse: f32, hp_pulse: f32,
slot_manager: slots::SlotManager, slot_manager: slots::SlotManager,
hotbar: hotbar::State, hotbar: hotbar::State,
@ -1567,8 +1566,6 @@ impl Hud {
0 0
}; };
// Timer sets the widget offset // 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 { let y = if floater.info.amount < 0.0 {
floater.timer as f64 floater.timer as f64
* number_speed * number_speed
@ -4530,6 +4527,7 @@ impl Hud {
client: &Client, client: &Client,
global_state: &GlobalState, global_state: &GlobalState,
) { ) {
let interface = &global_state.settings.interface;
match outcome { match outcome {
Outcome::ExpChange { uid, exp, xp_pools } => { Outcome::ExpChange { uid, exp, xp_pools } => {
self.floaters.exp_floaters.push(ExpFloater { 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 // Group up damage from the same tick, with the same instance number and
// crit value // 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() { for floater in floater_list.floaters.iter_mut().rev() {
if floater.timer > 0.0 { if floater.timer > 0.0 {
break; break;
} }
if floater.info.instance == info.instance 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.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; return;
} }
} }
@ -4610,7 +4612,8 @@ impl Hud {
} else { } else {
f.info.amount > 0.0 f.info.amount > 0.0
}) && if !hit_me { }) && 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 { } else {
true true
} }
@ -4618,12 +4621,24 @@ impl Hud {
match last_floater { match last_floater {
Some(f) Some(f)
// TODO: Change later so it's based on options // If the batch option is enabled, group floaters together for a
// TODO: Might have to discuss whether or not to create a new floater or every crit // default time
if (if hit_me { if (if hit_me {
f.timer < global_state.settings.interface.sct_inc_dmg_accum_duration // 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 { } 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; f.jump_timer = 0.0;

View File

@ -720,12 +720,10 @@ impl<'a> Widget for Interface<'a> {
O Show Damage Numbers O Show Damage Numbers
O Show single Damage Numbers O Show single Damage Numbers
// 0 to ??? seconds O Damage Accumulation Duration: 0s ----I----2s
O Damage Accumulation Duration: 0s ----I----5s
O Show batched dealt Damage O Show batched dealt Damage
O Show incoming Damage O Show incoming Damage
// 0 to ??? seconds O Incoming Damage Accumulation Duration: 0s ----I----2s
O Incoming Damage Accumulation Duration: 0s ----I----5s
O Batch incoming Numbers O Batch incoming Numbers
O Round Damage Numbers O Round Damage Numbers
TODO: Do something like https://gitlab.com/veloren/veloren/-/issues/836 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 { if !show_sct_damage_batch {
Text::new( Text::new(
self.localized_strings 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) .down_from(state.ids.sct_single_dmg_radio, 8.0)
.right_from(state.ids.sct_single_dmg_radio, 10.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 { if !show_sct_player_batch {
Text::new( Text::new(
self.localized_strings 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) .down_from(state.ids.sct_inc_dmg_radio, 8.0)
.right_from(state.ids.sct_inc_dmg_radio, 10.0) .right_from(state.ids.sct_inc_dmg_radio, 10.0)