From 63bf2b1a3d6bb6e17b326a8fdf0771e8d248eeb2 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 15 Dec 2024 00:53:03 +0800 Subject: [PATCH] clear bookmarks - closes #6685 --- .../forge/adventure/scene/MapViewScene.java | 4 ++ .../forge/adventure/scene/SaveLoadScene.java | 2 + .../forge/adventure/world/BiomeStructure.java | 5 +- .../src/forge/adventure/world/ColorMap.java | 54 +++++++++---------- .../src/forge/adventure/world/WorldSave.java | 19 +++++++ 5 files changed, 54 insertions(+), 30 deletions(-) diff --git a/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java b/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java index 4ef8733afb0..656587eba6f 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/MapViewScene.java @@ -149,4 +149,8 @@ float getMapY(float posY) { return (posY / (float) WorldSave.getCurrentSave().getWorld().getTileSize() / (float) WorldSave.getCurrentSave().getWorld().getHeightInTiles()) * img.getHeight(); } + public void clearBookMarks() { + if (bookmark != null) + bookmark.clear(); + } } diff --git a/forge-gui-mobile/src/forge/adventure/scene/SaveLoadScene.java b/forge-gui-mobile/src/forge/adventure/scene/SaveLoadScene.java index 65fc3bd66bc..87269a91907 100644 --- a/forge-gui-mobile/src/forge/adventure/scene/SaveLoadScene.java +++ b/forge-gui-mobile/src/forge/adventure/scene/SaveLoadScene.java @@ -225,6 +225,7 @@ public void loadSave() { break; case Load: try { + MapViewScene.instance().clearBookMarks(); Forge.setTransitionScreen(new TransitionScreen(() -> { loaded = false; if (WorldSave.load(currentSlot)) { @@ -253,6 +254,7 @@ public void loadSave() { Current.player().resetQuestFlags(); Current.player().setCharacterFlag("newGamePlus", 1); AdventurePlayer.current().addQuest("28"); + WorldSave.getCurrentSave().clearBookmarks(); WorldStage.getInstance().enterSpawnPOI(); SoundSystem.instance.changeBackgroundTrack(); Forge.switchScene(GameScene.instance()); diff --git a/forge-gui-mobile/src/forge/adventure/world/BiomeStructure.java b/forge-gui-mobile/src/forge/adventure/world/BiomeStructure.java index 02f6d7d10b8..60be73ac46c 100644 --- a/forge-gui-mobile/src/forge/adventure/world/BiomeStructure.java +++ b/forge-gui-mobile/src/forge/adventure/world/BiomeStructure.java @@ -110,7 +110,7 @@ public void initialize() { } public ColorMap sourceImage() { - return new ColorMap(Config.instance().getFile(data.sourcePath)); + return new ColorMap(Config.instance().getFile(data.sourcePath), data.sourcePath); } public String sourceImagePath() { @@ -118,8 +118,7 @@ public String sourceImagePath() { } private ColorMap maskImage() { - return new ColorMap(Config.instance().getFile(data.maskPath)); - + return new ColorMap(Config.instance().getFile(data.maskPath), data.maskPath); } diff --git a/forge-gui-mobile/src/forge/adventure/world/ColorMap.java b/forge-gui-mobile/src/forge/adventure/world/ColorMap.java index 738fb706423..bbbb1e51105 100644 --- a/forge-gui-mobile/src/forge/adventure/world/ColorMap.java +++ b/forge-gui-mobile/src/forge/adventure/world/ColorMap.java @@ -4,53 +4,53 @@ import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Pixmap; -public class ColorMap -{ +public class ColorMap { private final int width; private final int height; private final Color[] data; - public ColorMap(int w,int h) - { - width=w; - height=h; - data=new Color[w*h]; - for(int i=0;i