Don't display the world map on character edit

This commit is contained in:
Joshua Barretto 2023-03-31 14:36:30 +01:00
parent acec45b756
commit 45644da98a

View File

@ -178,6 +178,9 @@ enum Mode {
create_button: button::State,
rand_character_button: button::State,
rand_name_button: button::State,
/// `character_id.is_some()` can be used to determine if we're in edit
/// mode as opposed to create mode.
// TODO: Something less janky? Express the problem domain better!
character_id: Option<CharacterId>,
start_site_idx: usize,
},
@ -1241,7 +1244,8 @@ impl Controls {
rand_character.into(),
];
let right_column_content = vec![
let right_column_content = if character_id.is_none() {
vec![
Image::new(self.map_img)
.height(Length::Units(300))
.width(Length::Units(300))
@ -1285,7 +1289,11 @@ impl Controls {
.max_width(200)
.padding(5)
.into(),
];
]
} else {
// If we're editing an existing character, don't display the world column
Vec::new()
};
let column = |column_content, scroll| {
let column = Container::new(