single player save file filtering
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
9651734bca
commit
f9e12553c9
@ -1338,6 +1338,7 @@ Disable fluid sim for performance
|
||||
Increase fall delay
|
||||
Rearchitect foliage rendering to combat grass pop-in/pop-out
|
||||
Increase sim range to fight game object pop-in
|
||||
Filter select-able saves on singleplayer screen to full game saves
|
||||
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ public class MenuWorldSelect {
|
||||
saveButtonContainer.setMarginRight(50);
|
||||
List<String> saveNames = SaveUtils.getSaves();
|
||||
for(String saveName : saveNames){
|
||||
if(!saveName.startsWith(".")){
|
||||
if(!saveName.startsWith(".") && SaveUtils.isProcedural(saveName)){
|
||||
|
||||
Div spacer = Div.createDiv();
|
||||
spacer.addChild(Button.createButton(saveName.toUpperCase(), () -> {
|
||||
|
||||
@ -236,9 +236,25 @@ public class SaveUtils {
|
||||
* @return true if the world file exists, false otherwise
|
||||
*/
|
||||
public static boolean saveHasWorldFile(String saveName){
|
||||
String dirPath = deriveSaveDirectoryPath(saveName) + "/world.json";
|
||||
String dirPath = SaveUtils.deriveSaveDirectoryPath(saveName) + "/world.json";
|
||||
LoggerInterface.loggerEngine.DEBUG("Exists? " + dirPath);
|
||||
return FileUtils.checkFileExists(dirPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the save is a procedural world
|
||||
* @param saveName The name of the save
|
||||
* @return true if the world is procedural, false otherwise
|
||||
*/
|
||||
public static boolean isProcedural(String saveName){
|
||||
if(!FileUtils.checkFileExists(SaveUtils.deriveSaveDirectoryPath(saveName) + "scene.json")){
|
||||
return false;
|
||||
}
|
||||
SceneFile sceneFile = FileUtils.loadObjectFromSavePath(saveName, "scene.json", SceneFile.class);
|
||||
if(sceneFile == null){
|
||||
return false;
|
||||
}
|
||||
return sceneFile.getRealmDescriptor().getType().equals(RealmDescriptor.REALM_DESCRIPTOR_PROCEDURAL);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user