Reused the old way the maps are displayed in the new GUI, with some tweaks.

* NEW: updated the maps tooltips in the list GUI, using the old display with « Single map » / « Poster map (42×68) » instead of the raw maps count.
This commit is contained in:
Amaury Carrade 2015-09-10 16:08:42 +02:00
parent 34b3a66220
commit 48af13118f

View File

@ -36,15 +36,36 @@ public class MapListGui extends ExplorerGui<ImageMap>
@Override @Override
protected ItemStack getViewItem(ImageMap data) protected ItemStack getViewItem(ImageMap map)
{ {
if(data instanceof SingleMap) ItemStack icon = new ItemStack(Material.MAP);
{
return GuiUtils.makeItem(Material.EMPTY_MAP, data.getName(), "Single map", "#" + data.getId());
} ItemMeta meta = icon.getItemMeta();
PosterMap map = (PosterMap) data;
return GuiUtils.makeItem(Material.MAP, data.getName(), meta.setDisplayName(ChatColor.GREEN + "" + ChatColor.BOLD + map.getName());
"Poster map ("+map.getColumnCount()+"x"+map.getRowCount()+")", "#" + data.getId());
String mapDescription;
if(map instanceof SingleMap)
mapDescription = "Single map";
else
mapDescription = "Poster map (" + ((PosterMap) map).getColumnCount() + "×" + ((PosterMap) map).getRowCount() + ")";
meta.setLore(Arrays.asList(
ChatColor.WHITE + mapDescription,
"",
ChatColor.GRAY + "Map ID: " + map.getId(),
"",
ChatColor.GRAY + "» Left-click to get this map",
ChatColor.GRAY + "» Right-click for details and options"
));
GuiUtils.hideItemAttributes(meta);
icon.setItemMeta(meta);
return icon;
} }
@Override @Override