Skip to content

Commit

Permalink
merit refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
m00nwtchr committed Mar 12, 2024
1 parent 70041b3 commit d46d575
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 426 deletions.
2 changes: 2 additions & 0 deletions cofd/app/src/component/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ impl<Message> Component<Message, iced::Renderer> for InfoBar<Message> {
} else {
character.splat.set_xsplat(Some(xsplat));
}
character.calc_mod_map();
}
Event::YSplatChanged(ysplat) => {
if ysplat.name().eq("") {
character.splat.set_ysplat(None);
} else {
character.splat.set_ysplat(Some(ysplat));
}
//character.calc_mod_map();
}
Event::ZSplatChanged(zsplat) => {
if zsplat.name().eq("") {
Expand Down
22 changes: 11 additions & 11 deletions cofd/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,11 @@ mod demo {
(VampireMerit::CacophonySavvy.into(), 3),
(Merit::FastTalking, 1),
(
Merit::ProfessionalTraining(
String::new(),
Some([Skill::Expression, Skill::Occult]),
None,
),
Merit::ProfessionalTraining {
profession: String::new(),
skills: [Skill::Expression, Skill::Occult],
skill: None,
},
2,
),
// (Merit::Contacts(String::new()), 2),
Expand Down Expand Up @@ -455,7 +455,7 @@ mod demo {
(Merit::Giant, 3),
(Merit::TrainedObserver, 1),
(Merit::DefensiveCombat(true, Some(Skill::Brawl)), 1),
(WerewolfMerit::FavoredForm(Some(Form::Gauru)).into(), 2),
(WerewolfMerit::FavoredForm { form: Form::Gauru }.into(), 2),
(WerewolfMerit::EfficientKiller.into(), 2),
(Merit::RelentlessAssault, 2),
(Merit::Language("First Tongue".to_owned()), 1),
Expand Down Expand Up @@ -547,11 +547,11 @@ mod demo {
(Merit::Status("Mysterium".to_string()), 1),
(MageMerit::HighSpeech.into(), 1),
(
Merit::ProfessionalTraining(
"e".to_owned(),
Some([Skill::Investigation, Skill::Science]),
None,
),
Merit::ProfessionalTraining {
profession: String::new(),
skills: [Skill::Investigation, Skill::Science],
skill: None,
},
3,
),
(Merit::TrainedObserver, 1),
Expand Down
4 changes: 3 additions & 1 deletion cofd/app/src/view/overview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl<Message> OverviewTab<Message> {
}));
}
} else {
let mut vec = character.splat.all_abilities().unwrap();
let mut vec = abilities.clone();

if let Some(ability) = character.splat.custom_ability(fl!("custom")) {
vec.push(ability);
Expand Down Expand Up @@ -214,6 +214,8 @@ where
Event::AbilityValChanged(ability, val) => {
if let Some(val_) = character.get_ability_value_mut(&ability) {
*val_ = val;
} else {
character.add_ability(ability, val);
}

character.calc_mod_map();
Expand Down
Loading

0 comments on commit d46d575

Please sign in to comment.