Skip to content

Commit

Permalink
Fix MapPin for multiple maps
Browse files Browse the repository at this point in the history
  • Loading branch information
piegamesde committed Aug 9, 2020
1 parent 75cb5ea commit fb7278e
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import de.piegames.blockmap.gui.standalone.SimpleImageCache;
import de.piegames.blockmap.gui.standalone.SimplePlayerProfileCache;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.image.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.controlsfx.control.PopOver;
Expand All @@ -43,6 +39,8 @@

import de.piegames.blockmap.MinecraftVersion;
import de.piegames.blockmap.gui.DisplayViewport;
import de.piegames.blockmap.gui.standalone.SimpleImageCache;
import de.piegames.blockmap.gui.standalone.SimplePlayerProfileCache;
import de.piegames.blockmap.world.ChunkMetadata;
import de.piegames.blockmap.world.ChunkMetadata.ChunkMetadataCulled;
import de.piegames.blockmap.world.ChunkMetadata.ChunkMetadataFailed;
Expand All @@ -64,12 +62,16 @@
import javafx.beans.binding.DoubleBinding;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.CacheHint;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Separator;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.image.WritableImage;
import javafx.scene.input.MouseButton;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
Expand Down Expand Up @@ -600,9 +602,9 @@ private static class MapPin extends Pin {
}
}

protected List<de.piegames.blockmap.world.LevelMetadata.MapPin> maps;
protected List<LevelMetadata.MapPin> maps;

public MapPin(Vector2d position, List<de.piegames.blockmap.world.LevelMetadata.MapPin> maps, DisplayViewport viewport) {
public MapPin(Vector2d position, List<LevelMetadata.MapPin> maps, DisplayViewport viewport) {
super(position, PinType.MAP_POSITION, viewport);
this.maps = Objects.requireNonNull(maps);
}
Expand All @@ -620,7 +622,7 @@ protected PopOver initInfo() {
content.add(new Label(Integer.toString(maps.size())), 1, rowCount++);
}

for (de.piegames.blockmap.world.LevelMetadata.MapPin map : maps) {
for (LevelMetadata.MapPin map : maps) {
BorderPane mapPane = new BorderPane();
mapPane.setLeft(new Label("Scale:"));
mapPane.setRight(new Label("1:" + (1 << map.getScale())));
Expand All @@ -633,7 +635,7 @@ protected PopOver initInfo() {
image.getPixelWriter().setColor(x, y, COLOR_IDS[0xFF & data[y << 7 | x]]);
mapPane.setBottom(new ImageView(image));
}
content.add(mapPane, 0, rowCount++, 1, 2);
content.add(mapPane, 0, rowCount++, 2, 1);
}
info.setContentNode(content);
return info;
Expand Down

0 comments on commit fb7278e

Please sign in to comment.