public void loadSavedBrowsingPosition() { // Apply zoom first, because browsing position depends on it: setMapScale(biomeData.getBrowsingZoom()); mapOffsetX = biomeData.getBrowsingX(); mapOffsetY = biomeData.getBrowsingY(); isDragging = false; }
@Override public void onGuiClosed() { super.onGuiClosed(); removeChild(markerFinalizer); removeChild(blinkingIcon); Keyboard.enableRepeatEvents(false); biomeData.setBrowsingPosition(mapOffsetX, mapOffsetY, mapScale); PacketDispatcher.sendToServer( new BrowsingPositionPacket( stack.getItemDamage(), player.dimension, mapOffsetX, mapOffsetY, mapScale)); }
private void renderMarker(Marker marker, double scale) { int markerX = worldXToScreenX(marker.getX()); int markerY = worldZToScreenY(marker.getZ()); if (!marker.isVisibleAhead() && !biomeData.hasTileAt(marker.getChunkX(), marker.getChunkZ())) { return; } boolean mouseIsOverMarker = isMouseInRadius(markerX, markerY, (int) Math.ceil(MARKER_RADIUS * scale)); if (state.is(PLACING_MARKER)) { GL11.glColor4f(1, 1, 1, 0.5f); } else if (state.is(DELETING_MARKER)) { if (marker.isGlobal()) { GL11.glColor4f(1, 1, 1, 0.5f); } else { if (mouseIsOverMarker) { GL11.glColor4f(0.5f, 0.5f, 0.5f, 1); toDelete = marker; } else { GL11.glColor4f(1, 1, 1, 1); if (toDelete == marker) { toDelete = null; } } } } else { GL11.glColor4f(1, 1, 1, 1); } AtlasRenderHelper.drawFullTexture( MarkerTextureMap.instance().getTexture(marker.getType()), markerX - (double) MARKER_SIZE / 2 * scale, markerY - (double) MARKER_SIZE / 2 * scale, (int) Math.round(MARKER_SIZE * scale), (int) Math.round(MARKER_SIZE * scale)); if (isMouseOver && mouseIsOverMarker && marker.getLabel().length() > 0) { drawTooltip(Arrays.asList(marker.getLocalizedLabel()), mc.fontRenderer); } }