git repos / blockattack-game

blame: source/code/ScoresDisplay.cpp

normal view · raw

c3b697c6 sago007 2016-02-07 17:30 1
/*
7a956470 sago007 2016-02-14 17:09 2
===========================================================================
7a956470 sago007 2016-02-14 17:09 3
blockattack - Block Attack - Rise of the Blocks
7a956470 sago007 2016-02-14 17:09 4
Copyright (C) 2005-2016 Poul Sander
c3b697c6 sago007 2016-02-07 17:30 5
7a956470 sago007 2016-02-14 17:09 6
This program is free software: you can redistribute it and/or modify
7a956470 sago007 2016-02-14 17:09 7
it under the terms of the GNU General Public License as published by
7a956470 sago007 2016-02-14 17:09 8
the Free Software Foundation, either version 2 of the License, or
7a956470 sago007 2016-02-14 17:09 9
(at your option) any later version.
7a956470 sago007 2016-02-14 17:09 10
7a956470 sago007 2016-02-14 17:09 11
This program is distributed in the hope that it will be useful,
7a956470 sago007 2016-02-14 17:09 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
7a956470 sago007 2016-02-14 17:09 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7a956470 sago007 2016-02-14 17:09 14
GNU General Public License for more details.
7a956470 sago007 2016-02-14 17:09 15
7a956470 sago007 2016-02-14 17:09 16
You should have received a copy of the GNU General Public License
7a956470 sago007 2016-02-14 17:09 17
along with this program.  If not, see http://www.gnu.org/licenses/
7a956470 sago007 2016-02-14 17:09 18
7a956470 sago007 2016-02-14 17:09 19
Source information and contacts persons can be found at
7a956470 sago007 2016-02-14 17:09 20
http://www.blockattack.net
7a956470 sago007 2016-02-14 17:09 21
===========================================================================
7a956470 sago007 2016-02-14 17:09 22
*/
c3b697c6 sago007 2016-02-07 17:30 23
c3b697c6 sago007 2016-02-07 17:30 24
#include "ScoresDisplay.hpp"
c3b697c6 sago007 2016-02-07 17:30 25
#include "global.hpp"
c3b697c6 sago007 2016-02-07 17:30 26
#include "common.h"
c3b697c6 sago007 2016-02-07 17:30 27
#include "stats.h"
d21782d4 sago007 2016-03-13 11:17 28
#include "MenuSystem.h"
c3b697c6 sago007 2016-02-07 17:30 29
d2ba3cf5 sago007 2018-05-13 15:00 30
static void setButtonFont(const sago::SagoDataHolder* holder, sago::SagoTextField& field, const char* text) {
34ab7861 sago007 2018-03-28 14:47 31
	field.SetHolder(holder);
34ab7861 sago007 2018-03-28 14:47 32
	field.SetFont("freeserif");
34ab7861 sago007 2018-03-28 14:47 33
	field.SetColor({255,255,255,255});
34ab7861 sago007 2018-03-28 14:47 34
	field.SetFontSize(24);
d8fe60bd sago007 2018-04-02 16:15 35
	field.SetOutline(1, {128,128,128,255});
34ab7861 sago007 2018-03-28 14:47 36
	field.SetText(text);
34ab7861 sago007 2018-03-28 14:47 37
}
e1b2e653 sago007 2017-11-28 18:10 38
69d8f1dc sago007 2018-03-31 16:19 39
sago::SagoTextField* ScoresDisplay::getCachedText(const std::string& text) {
69d8f1dc sago007 2018-03-31 16:19 40
	std::shared_ptr<sago::SagoTextField> ptr = fieldCache[text];
69d8f1dc sago007 2018-03-31 16:19 41
	if (!ptr) {
69d8f1dc sago007 2018-03-31 16:19 42
		std::shared_ptr<sago::SagoTextField> newText = std::make_shared<sago::SagoTextField>();
69d8f1dc sago007 2018-03-31 16:19 43
		sagoTextSetBlueFont(*newText.get());
0b8fb137 sago007 2018-03-31 19:53 44
		newText->SetText(text);
69d8f1dc sago007 2018-03-31 16:19 45
		fieldCache[text] = newText;
69d8f1dc sago007 2018-03-31 16:19 46
	}
69d8f1dc sago007 2018-03-31 16:19 47
	return fieldCache[text].get();
69d8f1dc sago007 2018-03-31 16:19 48
}
69d8f1dc sago007 2018-03-31 16:19 49
69d8f1dc sago007 2018-03-31 16:19 50
void ScoresDisplay::Write(SDL_Renderer* target, int x, int y, const char* text) {
69d8f1dc sago007 2018-03-31 16:19 51
	getCachedText(text)->Draw(target, x, y);
c3b697c6 sago007 2016-02-07 17:30 52
}
c3b697c6 sago007 2016-02-07 17:30 53
79d552fa sago007 2019-02-12 17:17 54
const int numberOfPages = 7;
c3b697c6 sago007 2016-02-07 17:30 55
13476fc2 sago007 2016-09-28 18:34 56
void ScoresDisplay::DrawBackgroundAndCalcPlacements() {
72383a9e sago007 2016-10-30 11:56 57
	DrawBackground(globalData.screen);
72383a9e sago007 2016-10-30 11:56 58
	nextX = globalData.xsize-buttonXsize-20;
72383a9e sago007 2016-10-30 11:56 59
	backY = globalData.ysize-buttonYsize-20;
13476fc2 sago007 2016-09-28 18:34 60
	nextY = backY;
13476fc2 sago007 2016-09-28 18:34 61
}
13476fc2 sago007 2016-09-28 18:34 62
c3b697c6 sago007 2016-02-07 17:30 63
//Draws the highscores
79d552fa sago007 2019-02-12 17:17 64
void ScoresDisplay::DrawHighscores(int x, int y, bool endless, int level = 0) {
13476fc2 sago007 2016-09-28 18:34 65
	DrawBackgroundAndCalcPlacements();
c3b697c6 sago007 2016-02-07 17:30 66
	if (endless) {
79d552fa sago007 2019-02-12 17:17 67
		std::string header = SPrintStringF(_("Endless (%s):"), std::to_string(level).c_str());
79d552fa sago007 2019-02-12 17:17 68
		Write(globalData.screen, x+100,y+100, header.c_str() );
c3b697c6 sago007 2016-02-07 17:30 69
	}
c3b697c6 sago007 2016-02-07 17:30 70
	else {
69d8f1dc sago007 2018-03-31 16:19 71
		Write(globalData.screen, x+100,y+100, _("Time Trial:") );
c3b697c6 sago007 2016-02-07 17:30 72
	}
c3b697c6 sago007 2016-02-07 17:30 73
	for (int i =0; i<10; i++) {
7a956470 sago007 2016-02-14 17:09 74
		record r;
c3b697c6 sago007 2016-02-07 17:30 75
		if (endless) {
79d552fa sago007 2019-02-12 17:17 76
			switch(level) {
79d552fa sago007 2019-02-12 17:17 77
				case 1:
79d552fa sago007 2019-02-12 17:17 78
					r = theTopScoresEndless1.getScoreNumber(i);
79d552fa sago007 2019-02-12 17:17 79
					break;
79d552fa sago007 2019-02-12 17:17 80
				case 2:
79d552fa sago007 2019-02-12 17:17 81
					r = theTopScoresEndless2.getScoreNumber(i);
79d552fa sago007 2019-02-12 17:17 82
					break;
79d552fa sago007 2019-02-12 17:17 83
				case 3:
79d552fa sago007 2019-02-12 17:17 84
					r = theTopScoresEndless3.getScoreNumber(i);
79d552fa sago007 2019-02-12 17:17 85
					break;
79d552fa sago007 2019-02-12 17:17 86
				case 4:
79d552fa sago007 2019-02-12 17:17 87
					r = theTopScoresEndless4.getScoreNumber(i);
79d552fa sago007 2019-02-12 17:17 88
					break;
79d552fa sago007 2019-02-12 17:17 89
				default:
79d552fa sago007 2019-02-12 17:17 90
					r = theTopScoresEndless0.getScoreNumber(i);
79d552fa sago007 2019-02-12 17:17 91
			}
c3b697c6 sago007 2016-02-07 17:30 92
		}
c3b697c6 sago007 2016-02-07 17:30 93
		else {
905de2a2 sago007 2019-02-08 18:46 94
			r = theTopScoresTimeTrial.getScoreNumber(i);
c3b697c6 sago007 2016-02-07 17:30 95
		}
7a956470 sago007 2016-02-14 17:09 96
		char playerScore[32];
7a956470 sago007 2016-02-14 17:09 97
		char playerName[32];
7a956470 sago007 2016-02-14 17:09 98
		snprintf(playerScore, sizeof(playerScore), "%i", r.score);
7a956470 sago007 2016-02-14 17:09 99
		snprintf(playerName, sizeof(playerName), "%s", r.name.c_str());
69d8f1dc sago007 2018-03-31 16:19 100
		Write(globalData.screen, x+420,y+150+i*35, playerScore);
69d8f1dc sago007 2018-03-31 16:19 101
		Write(globalData.screen, x+60,y+150+i*35, playerName);
c3b697c6 sago007 2016-02-07 17:30 102
	}
c3b697c6 sago007 2016-02-07 17:30 103
}
c3b697c6 sago007 2016-02-07 17:30 104
c3b697c6 sago007 2016-02-07 17:30 105
void ScoresDisplay::DrawStats() {
13476fc2 sago007 2016-09-28 18:34 106
	DrawBackgroundAndCalcPlacements();
c3b697c6 sago007 2016-02-07 17:30 107
	int y = 5;
c3b697c6 sago007 2016-02-07 17:30 108
	const int y_spacing = 30;
69d8f1dc sago007 2018-03-31 16:19 109
	Write(globalData.screen, 10,y,_("Stats") );
c3b697c6 sago007 2016-02-07 17:30 110
	y+=y_spacing*2;
69d8f1dc sago007 2018-03-31 16:19 111
	Write(globalData.screen, 10,y,_("Chains") );
c3b697c6 sago007 2016-02-07 17:30 112
	for (int i=2; i<13; i++) {
c3b697c6 sago007 2016-02-07 17:30 113
		y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 114
		Write(globalData.screen, 10,y,(std::to_string(i)+"X").c_str());
e373cd75 Poul Sander 2018-11-07 19:21 115
		std::string numberAsString = std::to_string(Stats::getInstance()->getNumberOf("chainX"+std::to_string(i)));
69d8f1dc sago007 2018-03-31 16:19 116
		Write(globalData.screen, 300,y,numberAsString.c_str());
c3b697c6 sago007 2016-02-07 17:30 117
	}
c3b697c6 sago007 2016-02-07 17:30 118
	y+=y_spacing*2;
69d8f1dc sago007 2018-03-31 16:19 119
	Write(globalData.screen, 10,y,_("Lines Pushed: ") );
e373cd75 Poul Sander 2018-11-07 19:21 120
	std::string numberAsString = std::to_string(Stats::getInstance()->getNumberOf("linesPushed"));
69d8f1dc sago007 2018-03-31 16:19 121
	Write(globalData.screen, 300,y,numberAsString.c_str());
c3b697c6 sago007 2016-02-07 17:30 122
c3b697c6 sago007 2016-02-07 17:30 123
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 124
	Write(globalData.screen, 10,y, _("Puzzles solved: ") );
549ecfae sago007 2016-10-09 08:37 125
	numberAsString = std::to_string(Stats::getInstance()->getNumberOf("puzzlesSolved"));
69d8f1dc sago007 2018-03-31 16:19 126
	Write(globalData.screen, 300,y,numberAsString.c_str());
c3b697c6 sago007 2016-02-07 17:30 127
c3b697c6 sago007 2016-02-07 17:30 128
	y+=y_spacing*2;
69d8f1dc sago007 2018-03-31 16:19 129
	Write(globalData.screen, 10,y, _("Run time: ") );
c3b697c6 sago007 2016-02-07 17:30 130
	commonTime ct = TimeHandler::peekTime("totalTime",TimeHandler::ms2ct(SDL_GetTicks()));
c3b697c6 sago007 2016-02-07 17:30 131
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 132
	Write(globalData.screen, 10, y, SPrintCF( _("Days: %i"), ct.days) );
c3b697c6 sago007 2016-02-07 17:30 133
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 134
	Write(globalData.screen, 10, y, SPrintCF( _("Hours: %i"), ct.hours) );
c3b697c6 sago007 2016-02-07 17:30 135
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 136
	Write(globalData.screen, 10, y, SPrintCF( _("Minutes: %i"), ct.minutes) );
c3b697c6 sago007 2016-02-07 17:30 137
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 138
	Write(globalData.screen, 10, y, SPrintCF( _("Seconds: %i"), ct.seconds) );
c3b697c6 sago007 2016-02-07 17:30 139
c3b697c6 sago007 2016-02-07 17:30 140
	y-=y_spacing*4; //Four rows back
72383a9e sago007 2016-10-30 11:56 141
	const int x_offset3 = globalData.xsize/3+10; //Ofset for three rows
69d8f1dc sago007 2018-03-31 16:19 142
	Write(globalData.screen, x_offset3,y, _("Play time: ") );
c3b697c6 sago007 2016-02-07 17:30 143
	ct = TimeHandler::getTime("playTime");
c3b697c6 sago007 2016-02-07 17:30 144
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 145
	Write(globalData.screen, x_offset3, y, SPrintCF( _("Days: %i"), ct.days) );
c3b697c6 sago007 2016-02-07 17:30 146
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 147
	Write(globalData.screen, x_offset3, y, SPrintCF( _("Hours: %i"), ct.hours) );
c3b697c6 sago007 2016-02-07 17:30 148
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 149
	Write(globalData.screen, x_offset3, y, SPrintCF( _("Minutes: %i"), ct.minutes) );
c3b697c6 sago007 2016-02-07 17:30 150
	y+=y_spacing;
69d8f1dc sago007 2018-03-31 16:19 151
	Write(globalData.screen, x_offset3, y, SPrintCF( _("Seconds: %i"), ct.seconds) );
c3b697c6 sago007 2016-02-07 17:30 152
72383a9e sago007 2016-10-30 11:56 153
	const int x_offset = globalData.xsize/2+10;
c3b697c6 sago007 2016-02-07 17:30 154
	y = 5+y_spacing*2;
69d8f1dc sago007 2018-03-31 16:19 155
	Write(globalData.screen, x_offset,y, _("VS CPU (win/loss)") );
c3b697c6 sago007 2016-02-07 17:30 156
	for (int i=0; i<7; i++) {
c3b697c6 sago007 2016-02-07 17:30 157
		y += y_spacing;
e373cd75 Poul Sander 2018-11-07 19:21 158
		Write(globalData.screen, x_offset,y,std::string("AI "+std::to_string(i+1)).c_str());
549ecfae sago007 2016-10-09 08:37 159
		numberAsString = std::to_string(Stats::getInstance()->getNumberOf("defeatedAI"+std::to_string(i)));
e373cd75 Poul Sander 2018-11-07 19:21 160
		std::string numberAsString2 = std::to_string(Stats::getInstance()->getNumberOf("defeatedByAI"+std::to_string(i)));
e373cd75 Poul Sander 2018-11-07 19:21 161
		std::string toPrint = numberAsString + "/" + numberAsString2;
69d8f1dc sago007 2018-03-31 16:19 162
		Write(globalData.screen, x_offset+230,y,toPrint.c_str());
c3b697c6 sago007 2016-02-07 17:30 163
	}
c3b697c6 sago007 2016-02-07 17:30 164
}
c3b697c6 sago007 2016-02-07 17:30 165
c3b697c6 sago007 2016-02-07 17:30 166
ScoresDisplay::ScoresDisplay() {
c3b697c6 sago007 2016-02-07 17:30 167
}
c3b697c6 sago007 2016-02-07 17:30 168
c3b697c6 sago007 2016-02-07 17:30 169
ScoresDisplay::~ScoresDisplay() {
c3b697c6 sago007 2016-02-07 17:30 170
}
c3b697c6 sago007 2016-02-07 17:30 171
c3b697c6 sago007 2016-02-07 17:30 172
bool ScoresDisplay::IsActive() {
c3b697c6 sago007 2016-02-07 17:30 173
	return isActive;
c3b697c6 sago007 2016-02-07 17:30 174
}
c3b697c6 sago007 2016-02-07 17:30 175
647f12da sago007 2016-09-12 20:07 176
void ScoresDisplay::Draw(SDL_Renderer*) {
c3b697c6 sago007 2016-02-07 17:30 177
	switch (page) {
79d552fa sago007 2019-02-12 17:17 178
		case 0:
79d552fa sago007 2019-02-12 17:17 179
		case 1:
79d552fa sago007 2019-02-12 17:17 180
		case 2:
79d552fa sago007 2019-02-12 17:17 181
		case 3:
79d552fa sago007 2019-02-12 17:17 182
		case 4:
79d552fa sago007 2019-02-12 17:17 183
			//Highscores, endless
79d552fa sago007 2019-02-12 17:17 184
			DrawHighscores(100,100,true, page);
79d552fa sago007 2019-02-12 17:17 185
			break;
79d552fa sago007 2019-02-12 17:17 186
		case 5:
79d552fa sago007 2019-02-12 17:17 187
			//Highscores, Time Trial
79d552fa sago007 2019-02-12 17:17 188
			DrawHighscores(100,100,false);
79d552fa sago007 2019-02-12 17:17 189
			break;
79d552fa sago007 2019-02-12 17:17 190
		case 6:
79d552fa sago007 2019-02-12 17:17 191
		default:
79d552fa sago007 2019-02-12 17:17 192
			DrawStats();
c3b697c6 sago007 2016-02-07 17:30 193
	};
c3b697c6 sago007 2016-02-07 17:30 194
34ab7861 sago007 2018-03-28 14:47 195
	const sago::SagoDataHolder* holder = &globalData.spriteHolder->GetDataHolder();
c3b697c6 sago007 2016-02-07 17:30 196
	//Draw buttons:
72383a9e sago007 2016-10-30 11:56 197
	globalData.bHighScore.Draw(globalData.screen, 0, scoreX,scoreY);
72383a9e sago007 2016-10-30 11:56 198
	globalData.bBack.Draw(globalData.screen, 0, backX, backY);
34ab7861 sago007 2018-03-28 14:47 199
	static sago::SagoTextField backLabel;
34ab7861 sago007 2018-03-28 14:47 200
	setButtonFont(holder, backLabel, _("Back"));
34ab7861 sago007 2018-03-28 14:47 201
	backLabel.Draw(globalData.screen, backX+60,backY+10, sago::SagoTextField::Alignment::center);
72383a9e sago007 2016-10-30 11:56 202
	globalData.bNext.Draw(globalData.screen, 0, nextX, nextY);
34ab7861 sago007 2018-03-28 14:47 203
	static sago::SagoTextField nextLabel;
34ab7861 sago007 2018-03-28 14:47 204
	setButtonFont(holder, nextLabel, _("Next"));
34ab7861 sago007 2018-03-28 14:47 205
	nextLabel.Draw(globalData.screen, nextX+60, nextY+10, sago::SagoTextField::Alignment::center);
c3b697c6 sago007 2016-02-07 17:30 206
c3b697c6 sago007 2016-02-07 17:30 207
	//Draw page number
e373cd75 Poul Sander 2018-11-07 19:21 208
	std::string pageXofY = SPrintStringF(_("Page %i of %i"), page+1, numberOfPages);
c9a65d81 sago007 2018-03-31 16:22 209
	getCachedText(pageXofY)->Draw(globalData.screen,  globalData.xsize/2, globalData.ysize-60, sago::SagoTextField::Alignment::center);
c3b697c6 sago007 2016-02-07 17:30 210
}
c3b697c6 sago007 2016-02-07 17:30 211
58a2d7e1 sago007 2016-02-12 18:53 212
void ScoresDisplay::ProcessInput(const SDL_Event& event, bool& processed) {
c7f2082f sago007 2016-03-13 11:48 213
20d77c6e sago007 2016-11-12 16:28 214
	UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey);
092bdebe sago007 2017-03-19 14:39 215
79d552fa sago007 2019-02-12 17:17 216
	if (isRightEvent(event)) {
d21782d4 sago007 2016-03-13 11:17 217
		page++;
d21782d4 sago007 2016-03-13 11:17 218
		if (page>=numberOfPages) {
d21782d4 sago007 2016-03-13 11:17 219
			page = 0;
c3b697c6 sago007 2016-02-07 17:30 220
		}
647f12da sago007 2016-09-12 20:07 221
		processed = true;
d21782d4 sago007 2016-03-13 11:17 222
	}
8e3fb7e1 sago007 2016-03-13 11:26 223
79d552fa sago007 2019-02-12 17:17 224
	if (isLeftEvent(event)) {
d21782d4 sago007 2016-03-13 11:17 225
		page--;
d21782d4 sago007 2016-03-13 11:17 226
		if (page<0) {
d21782d4 sago007 2016-03-13 11:17 227
			page = numberOfPages-1;
c3b697c6 sago007 2016-02-07 17:30 228
		}
647f12da sago007 2016-09-12 20:07 229
		processed = true;
c3b697c6 sago007 2016-02-07 17:30 230
	}
8e3fb7e1 sago007 2016-03-13 11:26 231
d21782d4 sago007 2016-03-13 11:17 232
	if (isConfirmEvent(event) || isEscapeEvent(event)) {
d21782d4 sago007 2016-03-13 11:17 233
		isActive = false;
647f12da sago007 2016-09-12 20:07 234
		processed = true;
d21782d4 sago007 2016-03-13 11:17 235
	}
c3b697c6 sago007 2016-02-07 17:30 236
}
c3b697c6 sago007 2016-02-07 17:30 237
c3b697c6 sago007 2016-02-07 17:30 238
void ScoresDisplay::Update() {
c3b697c6 sago007 2016-02-07 17:30 239
	// If the mouse button is released, make bMouseUp equal true
08c44684 sago007 2016-10-30 09:19 240
	if ( !(SDL_GetMouseState(nullptr, nullptr)&SDL_BUTTON(1)) ) {
c3b697c6 sago007 2016-02-07 17:30 241
		bMouseUp=true;
c3b697c6 sago007 2016-02-07 17:30 242
	}
c3b697c6 sago007 2016-02-07 17:30 243
c3b697c6 sago007 2016-02-07 17:30 244
	if (SDL_GetMouseState(nullptr,nullptr)&SDL_BUTTON(1) && bMouseUp) {
c3b697c6 sago007 2016-02-07 17:30 245
		bMouseUp = false;
c3b697c6 sago007 2016-02-07 17:30 246
c3b697c6 sago007 2016-02-07 17:30 247
		//The Score button:
20d77c6e sago007 2016-11-12 16:28 248
		if ((globalData.mousex>scoreX) && (globalData.mousex<scoreX+buttonXsize) && (globalData.mousey>scoreY) && (globalData.mousey<scoreY+buttonYsize)) {
c3b697c6 sago007 2016-02-07 17:30 249
			isActive = false;
c3b697c6 sago007 2016-02-07 17:30 250
		}
c3b697c6 sago007 2016-02-07 17:30 251
c3b697c6 sago007 2016-02-07 17:30 252
		//The back button:
20d77c6e sago007 2016-11-12 16:28 253
		if ((globalData.mousex>backX) && (globalData.mousex<backX+buttonXsize) && (globalData.mousey>backY) && (globalData.mousey<backY+buttonYsize)) {
c3b697c6 sago007 2016-02-07 17:30 254
			page--;
c3b697c6 sago007 2016-02-07 17:30 255
			if (page<0) {
c3b697c6 sago007 2016-02-07 17:30 256
				page = numberOfPages-1;
c3b697c6 sago007 2016-02-07 17:30 257
			}
c3b697c6 sago007 2016-02-07 17:30 258
		}
c3b697c6 sago007 2016-02-07 17:30 259
c3b697c6 sago007 2016-02-07 17:30 260
		//The next button:
20d77c6e sago007 2016-11-12 16:28 261
		if ((globalData.mousex>nextX) && (globalData.mousex<nextX+buttonXsize) && (globalData.mousey>nextY) && (globalData.mousey<nextY+buttonYsize)) {
c3b697c6 sago007 2016-02-07 17:30 262
			page++;
c3b697c6 sago007 2016-02-07 17:30 263
			if (page>=numberOfPages) {
c3b697c6 sago007 2016-02-07 17:30 264
				page = 0;
c3b697c6 sago007 2016-02-07 17:30 265
			}
c3b697c6 sago007 2016-02-07 17:30 266
		}
c3b697c6 sago007 2016-02-07 17:30 267
	}
c3b697c6 sago007 2016-02-07 17:30 268
}