mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 17:29:30 +02:00
Auto correct date
Changes date from MM-DD-YYYY to YYYY-MM-DD automatically when running updates Updates logs when renaming or exporting them
This commit is contained in:
parent
8882d7bb12
commit
4e3fbe0c01
@ -348,6 +348,13 @@ export function enemyPokeName(scene: BattleScene, index: integer | Pokemon | Ene
|
||||
* @see DRPD
|
||||
*/
|
||||
function updateLog(drpd: DRPD): DRPD {
|
||||
if (drpd.date[2] == "-") {
|
||||
var date_month = drpd.date.substring(0, 2)
|
||||
var date_day = drpd.date.substring(3, 5)
|
||||
var date_year = drpd.date.substring(6, 10)
|
||||
console.log(`Corrected date from ${drpd.date} to ${date_year}-${date_month}-${date_day}`)
|
||||
drpd.date = `${date_year}-${date_month}-${date_day}`
|
||||
}
|
||||
if (drpd.version == "1.0.0") {
|
||||
drpd.version = "1.0.0a"
|
||||
console.log("Updated to 1.0.0a - changed item IDs to strings")
|
||||
@ -1221,6 +1228,7 @@ export function setFileInfo(title: string, authors: string[]) {
|
||||
console.log("Setting file " + rarityslot[1] + " to " + title + " / [" + authors.join(", ") + "]")
|
||||
var fileID = rarityslot[1] as string
|
||||
var drpd = JSON.parse(localStorage.getItem(fileID)) as DRPD;
|
||||
drpd = updateLog(drpd)
|
||||
drpd.title = title;
|
||||
for (var i = 0; i < authors.length; i++) {
|
||||
while (authors[i][0] == " ") {
|
||||
|
@ -1571,7 +1571,7 @@ export class EncounterPhase extends BattlePhase {
|
||||
LoggerTools.resetWaveActions(this.scene, undefined, true)
|
||||
|
||||
if (LoggerTools.autoCheckpoints.includes(this.scene.currentBattle.waveIndex)) {
|
||||
this.scene.gameData.saveGameToAuto(this.scene)
|
||||
//this.scene.gameData.saveGameToAuto(this.scene)
|
||||
}
|
||||
|
||||
if (this.scene.currentBattle.battleType === BattleType.WILD) {
|
||||
@ -2678,8 +2678,15 @@ export class TurnInitPhase extends FieldPhase {
|
||||
});
|
||||
|
||||
var Pt = this.scene.getEnemyParty()
|
||||
var Pt1 = [this.scene.getEnemyParty()[0], this.scene.getEnemyParty()[2], this.scene.getEnemyParty()[4]]
|
||||
var Pt2 = [this.scene.getEnemyParty()[1], this.scene.getEnemyParty()[3], this.scene.getEnemyParty()[5]]
|
||||
var Pt1 = []
|
||||
var Pt2 = []
|
||||
for (var i = 0; i < Pt.length; i++) {
|
||||
if (i % 2 == 0) {
|
||||
Pt1.push(Pt[i])
|
||||
} else {
|
||||
Pt2.push(Pt[i])
|
||||
}
|
||||
}
|
||||
Pt.forEach((pokemon, i) => {
|
||||
if (pokemon != undefined)
|
||||
if (pokemon.hasTrainer() || true) {
|
||||
|
Loading…
Reference in New Issue
Block a user