projectile system
This commit is contained in:
parent
918b4884b2
commit
ad4a2cf393
17 changed files with 400 additions and 23 deletions
|
|
@ -39,16 +39,34 @@ fn resource_ui(
|
|||
.anchor(Align2::RIGHT_TOP, [0., 0.])
|
||||
.show(ctx, |ui| {
|
||||
ui.label(RichText::new(format!("Souls: {}", resources.souls)).size(large_font_size));
|
||||
ui.label(RichText::new(format!("Bones: {}", resources.bones)).size(large_font_size));
|
||||
ui.heading(RichText::new("Buildings").underline());
|
||||
for (info, cost, name) in buildings.iter() {
|
||||
if !info.unlocked {
|
||||
continue;
|
||||
}
|
||||
let souls_text = if cost.souls > 0 {
|
||||
format!("{} souls", cost.souls)
|
||||
} else {
|
||||
"".to_string()
|
||||
};
|
||||
let divider_text = if cost.souls > 0 && cost.bones > 0 {
|
||||
", "
|
||||
} else if cost.souls == 0 && cost.bones == 0 {
|
||||
"FREE!!!"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
let bones_text = if cost.bones > 0 {
|
||||
format!("{} bones", cost.bones)
|
||||
} else {
|
||||
"".to_string()
|
||||
};
|
||||
if ui
|
||||
.button(
|
||||
RichText::new(format!(
|
||||
"{} - {} souls, {} bones",
|
||||
name, cost.souls, cost.bones
|
||||
"{} - {}{}{}",
|
||||
name, souls_text, divider_text, bones_text
|
||||
))
|
||||
.size(font_size),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue