bool console = false;
std::string consoletext[15] = {};
-std::string displaytext[15] = {};
-float displaytime[15] = {};
-float displayblinkdelay = 0;
-bool displayblink = 0;
-unsigned displayselected = 0;
float consoleblinkdelay = 0;
bool consoleblink = 0;
unsigned consoleselected = 0;
extern bool console;
extern std::string consoletext[15];
-extern std::string displaytext[15];
-extern float displaytime[15];
-extern float displayblinkdelay;
-extern bool displayblink;
-extern unsigned displayselected;
extern float consoleblinkdelay;
extern bool consoleblink;
extern unsigned consoleselected;
glDepthMask(1);
}
- if (!console) {
- displaytime[0] = 0;
- glEnable(GL_TEXTURE_2D);
- glColor4f(1, 1, 1, 1);
- for (unsigned i = 1; i < 15; i++)
- if (displaytime[i] < 4)
- for (unsigned j = 0; j < displaytext[i].size(); j++) {
- glColor4f(1, 1, 1, 4 - displaytime[i]);
- string = std::string(1, displaytext[i][j]);
- text->glPrint(30 + j * 10, 30 + i * 20 + (screenheight - 330), string, 0, 1, screenwidth, screenheight);
- }
- }
-
if (difficulty < 2 && !Dialog::inDialog()) { // minimap
float mapviewdist = 20000;
if (consoleblink) {
text->glPrint(30 + (float)(consoleselected) * 10 - offset * 10, 30, "_", 0, 1, 1024, 768);
}
- for (unsigned i = 0; i < 15; i++)
- for (unsigned j = 0; j < consoletext[i].size(); j++) {
- glColor4f(1, 1, 1, 1 - (float)(i) / 16);
- text->glPrint(30 + j * 10 - offset * 10, 30 + i * 20, std::string(1, consoletext[i][j]), 0, 1, 1024, 768);
- }
+ for (unsigned i = 0; i < 15; i++) {
+ text->glPrint(30 - offset * 10, 30 + i * 20, consoletext[i], 0, 1, 1024, 768);
+ }
}
}
static XYZ facing, flatfacing;
static int target;
- for (int i = 0; i < 15; i++) {
- displaytime[i] += multiplier;
- }
-
Input::Tick();
if (Input::isKeyPressed(SDL_SCANCODE_F6)) {
extern void toggleFullscreen();
int entername = 0;
+std::string newusername = "";
+unsigned newuserselected = 0;
+float newuserblinkdelay = 0;
+bool newuserblink = false;
std::vector<MenuItem> Menu::items;
} else {
mainmenu = 1;
}
- displaytext[0].clear();
- displayselected = 0;
+ newusername.clear();
+ newuserselected = 0;
entername = 0;
}
break;
OPENAL_SetFrequency(channels[stream_menutheme]);
if (entername) {
- inputText(displaytext[0], &displayselected);
+ inputText(newusername, &newuserselected);
if (!waiting) { // the input as finished
- if (!displaytext[0].empty()) { // with enter
- Account::add(string(displaytext[0]));
+ if (!newusername.empty()) { // with enter
+ Account::add(string(newusername));
mainmenu = 8;
fireSound(firestartsound);
- displaytext[0].clear();
+ newusername.clear();
- displayselected = 0;
+ newuserselected = 0;
}
entername = 0;
Load();
}
- displayblinkdelay -= multiplier;
- if (displayblinkdelay <= 0) {
- displayblinkdelay = .3;
- displayblink = !displayblink;
+ newuserblinkdelay -= multiplier;
+ if (newuserblinkdelay <= 0) {
+ newuserblinkdelay = .3;
+ newuserblink = !newuserblink;
}
}
if (entername) {
- setText(0, displaytext[0], 20, 400, -1, -1);
- setText(-2, displayblink ? "_" : "", 20 + displayselected * 10, 400, -1, -1);
+ setText(0, newusername, 20, 400, -1, -1);
+ setText(-2, newuserblink ? "_" : "", 20 + newuserselected * 10, 400, -1, -1);
}
if (oldmainmenu != mainmenu)