Allocate the correct number of widget ids for multiplicity icons.

This commit is contained in:
Avi Weinstock 2023-01-18 23:39:33 -05:00
parent aba6f6654e
commit 1cf74cecdb
2 changed files with 5 additions and 5 deletions

View File

@ -187,10 +187,10 @@ impl<'a> Widget for BuffsBar<'a> {
if state.ids.debuff_timers.len() < debuff_count {
state.update(|state| state.ids.debuff_timers.resize(debuff_count, gen));
};
if state.ids.buff_multiplicities.len() < buff_count {
if state.ids.buff_multiplicities.len() < 2 * buff_count {
state.update(|state| state.ids.buff_multiplicities.resize(2 * buff_count, gen));
};
if state.ids.debuff_multiplicities.len() < debuff_count {
if state.ids.debuff_multiplicities.len() < 2 * debuff_count {
state.update(|state| {
state
.ids
@ -382,7 +382,7 @@ impl<'a> Widget for BuffsBar<'a> {
if state.ids.buff_txts.len() < buff_count {
state.update(|state| state.ids.buff_txts.resize(buff_count, gen));
};
if state.ids.buff_multiplicities.len() < buff_count {
if state.ids.buff_multiplicities.len() < 2 * buff_count {
state.update(|state| state.ids.buff_multiplicities.resize(2 * buff_count, gen));
};

View File

@ -452,7 +452,7 @@ impl<W: Positionable> Position for W {
}
}
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub enum BuffIconKind<'a> {
Buff {
kind: BuffKind,
@ -550,7 +550,7 @@ impl<'a> PartialEq for BuffIconKind<'a> {
impl<'a> Eq for BuffIconKind<'a> {}
#[derive(Clone, Copy)]
#[derive(Clone, Copy, Debug)]
pub struct BuffIcon<'a> {
kind: BuffIconKind<'a>,
is_buff: bool,