File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ Game_System.prototype.initialize = function() {
1616 this . _winCount = 0 ;
1717 this . _escapeCount = 0 ;
1818 this . _saveCount = 0 ;
19+ this . _frameCount = 0 ;
1920 this . _versionId = 0 ;
2021 this . _framesOnSave = 0 ;
2122 this . _bgmOnSave = null ;
@@ -116,6 +117,10 @@ Game_System.prototype.saveCount = function() {
116117 return this . _saveCount ;
117118} ;
118119
120+ Game_System . prototype . frameCount = function ( ) {
121+ return this . _frameCount ;
122+ } ;
123+
119124Game_System . prototype . versionId = function ( ) {
120125 return this . _versionId ;
121126} ;
@@ -164,6 +169,10 @@ Game_System.prototype.onBattleEscape = function() {
164169 this . _escapeCount ++ ;
165170} ;
166171
172+ Game_System . prototype . onFrameUpdate = function ( ) {
173+ this . _frameCount ++ ;
174+ } ;
175+
167176Game_System . prototype . onBeforeSave = function ( ) {
168177 this . _saveCount ++ ;
169178 this . _versionId = $dataSystem . versionId ;
@@ -173,13 +182,16 @@ Game_System.prototype.onBeforeSave = function() {
173182} ;
174183
175184Game_System . prototype . onAfterLoad = function ( ) {
185+ if ( ! this . _frameCount ) {
186+ this . _frameCount = this . _framesOnSave ;
187+ }
176188 Graphics . frameCount = this . _framesOnSave ;
177189 AudioManager . playBgm ( this . _bgmOnSave ) ;
178190 AudioManager . playBgs ( this . _bgsOnSave ) ;
179191} ;
180192
181193Game_System . prototype . playtime = function ( ) {
182- return Math . floor ( Graphics . frameCount / 60 ) ;
194+ return Math . floor ( this . _frameCount / 60 ) ;
183195} ;
184196
185197Game_System . prototype . playtimeText = function ( ) {
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ Scene_Base.prototype.start = function() {
105105 * @memberof Scene_Base
106106 */
107107Scene_Base . prototype . update = function ( ) {
108+ $gameSystem . onFrameUpdate ( ) ;
108109 this . updateFade ( ) ;
109110 this . updateChildren ( ) ;
110111} ;
You can’t perform that action at this time.
0 commit comments