Skip to content

Commit

Permalink
Merge branch 'louis-e:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
zer0-dev authored Jan 11, 2025
2 parents 8ed8642 + 7b7ff6b commit 28ecbb5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gui-src/locales/ru.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"select_location": "Выбрать местоположение",
"zoom_in_and_choose": "Приблизьте и выберите область с помощью инструмента прямоугольника",
"zoom_in_and_choose": "Приблизьте и выберите область",
"select_world": "Выбрать мир",
"choose_world": "Выбрать мир",
"no_world_selected": "Мир не выбран",
Expand Down
3 changes: 3 additions & 0 deletions src/element_processing/barriers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pub fn generate_barriers(editor: &mut WorldEditor, element: &ProcessedElement, g
);
// Place bollard
}
} else if barrier_type == "kerb" {
// Ignore kerbs
return;
} else if let ProcessedElement::Way(way) = element {
// Determine wall height
let wall_height: i32 = element
Expand Down
17 changes: 8 additions & 9 deletions src/element_processing/buildings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@ pub fn generate_buildings(
relation_levels: Option<i32>,
) {
// Adjust starting height based on building:min_level
let start_level = if let Some(min_level_str) = element.tags.get("building:min_level") {
if let Ok(min_level) = min_level_str.parse::<i32>() {
ground_level + (min_level * 4) // Each level is 4 blocks high
} else {
ground_level
}
let min_level = if let Some(min_level_str) = element.tags.get("building:min_level") {
min_level_str.parse::<i32>().unwrap_or(0)
} else {
ground_level
0
};
let start_level = ground_level + (min_level * 4);

let mut previous_node: Option<(i32, i32)> = None;
let mut corner_addup: (i32, i32, i32) = (0, 0, 0);
Expand Down Expand Up @@ -97,8 +94,10 @@ pub fn generate_buildings(
// Determine building height from tags
if let Some(levels_str) = element.tags.get("building:levels") {
if let Ok(levels) = levels_str.parse::<i32>() {
if levels >= 1 {
building_height = ((levels * 4 + 2) as f64 * scale_factor) as i32;
let lev = levels - min_level;

if lev >= 1 {
building_height = ((lev * 4 + 2) as f64 * scale_factor) as i32;
building_height = building_height.max(3);
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,14 @@ fn gui_select_world(generate_new: bool) -> Result<String, i32> {
.join("saves")
})
} else if cfg!(target_os = "linux") {
dirs::home_dir().map(|home: PathBuf| home.join(".minecraft").join("saves"))
dirs::home_dir().map(|home| {
let flatpak_path = home.join(".var/app/com.mojang.Minecraft/.minecraft/saves");
if flatpak_path.exists() {
flatpak_path
} else {
home.join(".minecraft/saves")
}
})
} else {
None
};
Expand Down

0 comments on commit 28ecbb5

Please sign in to comment.