Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This plugin sets the topmost open save slot when starting a new save in a game.
- //Put this plugin at the very top of your plugin manager to minimize compatibility issues.
- //ver 1.0b
- DataManager.selectSavefileForNewGame = function() {
- var globalInfo = this.loadGlobalInfo();
- var earlySelect = -1;
- this._lastAccessedId = 1;
- if (globalInfo) {
- for (var i = 1; i < globalInfo.length; i++) {
- if(!this.isThisGameFile(i)){
- this._lastAccessedId = i;
- earlySelect = this._lastAccessedId;
- break;
- }
- };
- if (earlySelect == -1) {
- var numSavefiles = Math.max(0, globalInfo.length - 1);
- if (numSavefiles < this.maxSavefiles()) {
- this._lastAccessedId = numSavefiles + 1;
- } else {
- var timestamp = Number.MAX_VALUE;
- for (var i = 1; i < globalInfo.length; i++) {
- if (!globalInfo[i]) {
- this._lastAccessedId = i;
- break;
- }
- if (globalInfo[i].timestamp < timestamp) {
- timestamp = globalInfo[i].timestamp;
- this._lastAccessedId = i;
- }
- }
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement