Pause graphics problem

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
So, I am writing a plugin and it goes this way:

var gtemp_alias = Game_Temp.prototype.initialize;var scene_map_update = Scene_Map.prototype.update;var scene_battle_update = Scene_Battle.prototype.update;var pause_on_map = true;var pause_on_battle = true;var pause;function update_pause() { update_pause_execution(); update_pause_button();}function update_pause_execution() { if (!$gameTemp.pause) { return; } while(!$gameTemp.pause) { update_pauseX(); Input.update(); TouchInput.update(); Graphics.update(); }}function update_pauseX() { update_pause_button();}function check_pause() { if ($gameTemp.pause == true) { $gameTemp.pause = false; } else { $gameTemp.pause = true; } }function update_pause_button() { if (Input.isTriggered('shift')) { check_pause(); }}Game_Temp.prototype.initialize = function() { gtemp_alias.call(this); pause = false;};Scene_Map.prototype.update = function() { scene_map_update.call(this); if (pause_on_map) { update_pause(); }};Scene_Battle.prototype.update = function() { scene_battle_update.call(this); update_pause();};Question: Why does it not do anything, and why doesn't it pause like it should? Also, how can you do CTRL and F1 - F12 in the Input.isTriggered correctly?
 

Sn0wCrack

Veteran
Veteran
Joined
Aug 2, 2015
Messages
82
Reaction score
48
First Language
英語
I believe the root of your issue lies in this function:

function update_pause_execution() { if (!$gameTemp.pause) { return; } while(!$gameTemp.pause) { update_pauseX(); Input.update(); TouchInput.update(); Graphics.update(); }}The while loop's input is check when gameTemp.pause is false rather than when it's true.

Another reason may perhaps be from this:

var pause;
Code:
Game_Temp.prototype.initialize = function() {    gtemp_alias.call(this);    pause = false;};
Code:
function check_pause() {	if ($gameTemp.pause == true) {		$gameTemp.pause = false;	} else {		$gameTemp.pause = true;	}	}
I believe the "pause" variable you're defining is setting the local pause to to false, rather than one in Game_Temp (I could be wrong about this considering my JavaScript scope knowledge is pretty poor).

You can just reference your local pause variable instead rather than one started in Game_Temp. You can create one in Game_Temp by putting it in the initialize function like so:

Code:
Game_Temp.prototype.initialize = function() {    gtemp_alias.call(this);    this.pause = false;};
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top