fix(content): compact datapack world picker
This commit is contained in:
1 parent
7986bab3a7
commit
94b71fdc4e
2 files changed
+16
-1
No files matched your search
@@ -677,7 +677,7 @@ impl DiscoveryState {
|
||||
true
|
||||
}
|
||||
|
||||
pub fn begin_world_selection(&mut self, worlds: Vec<ContentEntry>) -> bool {
|
||||
pub fn begin_world_selection(&mut self, mut worlds: Vec<ContentEntry>) -> bool {
|
||||
let Some(popup) = self.version_popup.as_mut() else {
|
||||
return false;
|
||||
};
|
||||
@@ -689,6 +689,13 @@ impl DiscoveryState {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for world in &mut worlds {
|
||||
world.icon_lines = world
|
||||
.icon_bytes
|
||||
.as_ref()
|
||||
.and_then(|bytes| crate::instance::content::make_icon_pixels(bytes, 6, 3))
|
||||
.or_else(|| Some(crate::instance::content::fallback_icon()));
|
||||
}
|
||||
popup.worlds = ContentListState::default();
|
||||
popup.worlds.entries = worlds;
|
||||
popup
|
||||
|
||||
Reference in new issue
Block a user