mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
update
This commit is contained in:
@@ -70,8 +70,8 @@ public class GameScene extends HudScene {
|
||||
if (skipRoads) {
|
||||
location = forHeader ? "Waste Map" : "waste";
|
||||
} else {
|
||||
//should load while walking on "road"
|
||||
location = "";
|
||||
//current workaround to get the POI town name
|
||||
location = WorldStage.getInstance().getBoundary();
|
||||
}
|
||||
else {
|
||||
BiomeData data = biomeData.get(currentBiome);
|
||||
|
||||
@@ -584,6 +584,7 @@ public class GameHUD extends Stage {
|
||||
case "town":
|
||||
changeBGM(MusicPlaylist.TOWN);
|
||||
break;
|
||||
case "dungeon":
|
||||
case "cave":
|
||||
changeBGM(MusicPlaylist.CAVE);
|
||||
break;
|
||||
|
||||
@@ -63,6 +63,30 @@ public class MapSprite extends Actor {
|
||||
return actorGroup;
|
||||
}
|
||||
|
||||
public static String getBoundaryName(int chunkX, int chunkY) {
|
||||
String boundary = "";
|
||||
List<PointOfInterest> poi = WorldSave.getCurrentSave().getWorld().getPointsOfInterest(chunkX, chunkY);
|
||||
|
||||
for (PointOfInterest p : poi) {
|
||||
if ("town".equalsIgnoreCase(p.getData().type)) {
|
||||
if (p.getData().name.startsWith("Waste"))
|
||||
boundary = "waste";
|
||||
else if (p.getData().name.startsWith("Plains"))
|
||||
boundary = "white";
|
||||
else if (p.getData().name.startsWith("Forest"))
|
||||
boundary = "green";
|
||||
else if (p.getData().name.startsWith("Island"))
|
||||
boundary = "blue";
|
||||
else if (p.getData().name.startsWith("Mountain"))
|
||||
boundary = "red";
|
||||
else if (p.getData().name.startsWith("Swamp"))
|
||||
boundary = "black";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return boundary;
|
||||
}
|
||||
|
||||
//BitmapFont font;
|
||||
@Override
|
||||
public void draw(Batch batch, float parentAlpha) {
|
||||
|
||||
@@ -294,6 +294,10 @@ public class WorldStage extends GameStage implements SaveFileContent {
|
||||
background.loadChunk(pos.x, pos.y);
|
||||
handlePointsOfInterestCollision();
|
||||
}
|
||||
public String getBoundary() {
|
||||
GridPoint2 pos = background.translateFromWorldToChunk(player.getX(), player.getY());
|
||||
return MapSprite.getBoundaryName(pos.x, pos.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leave() {
|
||||
|
||||
Reference in New Issue
Block a user