mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
Refactored Dialog boxes so that an infinite amount can be opened
This commit is contained in:
+52
-5
@@ -159,10 +159,46 @@ Script.prototype.reset = function() {
|
||||
this.onlineExpGained = 0;
|
||||
this.logs = [];
|
||||
|
||||
this.moneyStolenMap.reset();
|
||||
this.numTimesHackMap.reset();
|
||||
this.numTimesGrowMap.reset();
|
||||
this.numTimesWeakenMap.reset();
|
||||
if (this.moneyStolenMap != null) {
|
||||
try {
|
||||
this.moneyStolenMap.reset();
|
||||
} catch(e) {
|
||||
this.moneyStolenMap = null;
|
||||
}
|
||||
} else {
|
||||
this.moneyStolenMap = new AllServersMap();
|
||||
}
|
||||
|
||||
if (this.numTimesHackMap != null) {
|
||||
try {
|
||||
this.numTimesHackMap.reset();
|
||||
} catch(e) {
|
||||
this.numTimesHackMap = null;
|
||||
}
|
||||
} else {
|
||||
this.numTimesHackMap = new AllServersMap();
|
||||
}
|
||||
|
||||
if (this.numTimesGrowMap != null) {
|
||||
try {
|
||||
this.numTimesGrowMap.reset();
|
||||
} catch(e) {
|
||||
this.numTimesGrowMap = null;
|
||||
}
|
||||
} else {
|
||||
this.numTimesGrowMap = new AllServersMap();
|
||||
}
|
||||
|
||||
if (this.numTimesWeakenMap != null) {
|
||||
try {
|
||||
this.numTimesWeakenMap.reset();
|
||||
} catch(e) {
|
||||
this.numTimesWeakenMap = null;
|
||||
}
|
||||
} else {
|
||||
this.numTimesWeakenMap = new AllServersMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Updates how much RAM the script uses when it is running.
|
||||
@@ -434,4 +470,15 @@ AllServersMap.prototype.printConsole = function() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AllServersMap.prototype.toJSON = function() {
|
||||
return Generic_toJSON("AllServersMap", this);
|
||||
}
|
||||
|
||||
|
||||
AllServersMap.fromJSON = function(value) {
|
||||
return Generic_fromJSON(AllServersMap, value.data);
|
||||
}
|
||||
|
||||
Reviver.constructors.AllServersMap = AllServersMap;
|
||||
Reference in New Issue
Block a user