2019-08-10 11:43:24 +00:00
|
|
|
// Hyperbolic Rogue -- menus
|
|
|
|
// Copyright (C) 2011-2019 Zeno Rogue, see 'hyper.cpp' for details
|
|
|
|
|
|
|
|
/** \file menus.cpp
|
|
|
|
* \brief generic menus (start menu, main menu, Overview, etc.)
|
|
|
|
*/
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
// -- overview --
|
|
|
|
|
2019-09-05 07:15:40 +00:00
|
|
|
#include "hyper.h"
|
2017-03-23 10:53:57 +00:00
|
|
|
#define BLACKISH 0x404040
|
|
|
|
#define REDDISH 0x400000
|
|
|
|
|
2018-06-10 23:58:31 +00:00
|
|
|
namespace hr {
|
2019-08-09 19:00:52 +00:00
|
|
|
EX ld whatever[16];
|
|
|
|
EX int whateveri[16];
|
2017-05-27 19:40:40 +00:00
|
|
|
|
2017-07-10 18:47:38 +00:00
|
|
|
int PREC(ld x) {
|
|
|
|
ld sh = shiftmul;
|
|
|
|
if(sh > -.2 && sh < .2) x = 10.01;
|
|
|
|
return int(shiftmul * x);
|
2017-07-04 13:38:33 +00:00
|
|
|
}
|
2017-07-10 18:47:38 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showOverview() {
|
2017-08-18 00:47:49 +00:00
|
|
|
cmode = sm::ZOOMABLE | sm::OVERVIEW;
|
2019-05-12 23:57:40 +00:00
|
|
|
DEBBI(DF_GRAPH, ("show overview"));
|
2017-08-18 00:47:49 +00:00
|
|
|
|
2017-12-09 03:01:56 +00:00
|
|
|
if(dialog::infix != "")
|
|
|
|
mouseovers = dialog::infix;
|
2017-08-18 00:47:49 +00:00
|
|
|
else {
|
|
|
|
mouseovers = XLAT("world overview");
|
|
|
|
mouseovers += " ";
|
|
|
|
mouseovers += XLAT(" kills: %1/%2", its(tkills()), its(killtypes()));
|
|
|
|
mouseovers += XLAT(" $$$: %1", its(gold()));
|
2019-06-16 13:26:53 +00:00
|
|
|
if(randomPatternsMode) ;
|
|
|
|
else if(landUnlocked(laHell)) {
|
2017-08-18 00:47:49 +00:00
|
|
|
int i1, i2; countHyperstoneQuest(i1, i2);
|
|
|
|
mouseovers += XLAT(" Hyperstone: %1/%2", its(i1), its(i2));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
mouseovers += XLAT(" Hell: %1/9", its(orbsUnlocked()));
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
|
2017-03-23 10:53:57 +00:00
|
|
|
bool pages;
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2019-05-28 23:09:38 +00:00
|
|
|
{
|
|
|
|
dynamicval<int> ds(dual::state, dual::state ? 2 : 0);
|
2018-01-08 22:11:29 +00:00
|
|
|
generateLandList(isLandIngame);
|
2019-05-28 23:09:38 +00:00
|
|
|
}
|
2017-08-18 00:47:49 +00:00
|
|
|
|
2019-01-03 01:14:22 +00:00
|
|
|
bool not_in_game = false;
|
|
|
|
|
2017-12-09 03:01:56 +00:00
|
|
|
if(dialog::infix != "") {
|
2019-01-03 01:14:22 +00:00
|
|
|
auto land_matches = [] (eLand l) {
|
2017-08-18 00:47:49 +00:00
|
|
|
string s = dnameof(l);
|
|
|
|
s += "@";
|
|
|
|
s += dnameof(treasureType(l));
|
|
|
|
s += "@";
|
2017-10-10 10:43:41 +00:00
|
|
|
s += dnameof(nativeOrbType(l));
|
2019-01-03 01:14:22 +00:00
|
|
|
return dialog::hasInfix(s);
|
|
|
|
};
|
|
|
|
|
|
|
|
vector<eLand> filtered;
|
|
|
|
for(eLand l: landlist) if(land_matches(l)) filtered.push_back(l);
|
|
|
|
if(filtered.size())
|
2017-11-03 18:31:42 +00:00
|
|
|
landlist = filtered;
|
2019-01-03 01:14:22 +00:00
|
|
|
else {
|
|
|
|
for(int i=0; i<landtypes; i++) if(land_matches(eLand(i))) filtered.push_back(eLand(i));
|
|
|
|
if(filtered.size()) landlist = filtered, not_in_game = true;
|
|
|
|
}
|
2017-08-18 00:47:49 +00:00
|
|
|
}
|
|
|
|
|
2018-06-22 12:47:24 +00:00
|
|
|
int nl = isize(landlist), nlm;
|
2017-11-03 18:31:42 +00:00
|
|
|
|
|
|
|
int lstart = 0;
|
|
|
|
|
2017-08-18 00:47:49 +00:00
|
|
|
if(nl > 30) {
|
2017-03-23 10:53:57 +00:00
|
|
|
pages = true;
|
2017-11-03 18:31:42 +00:00
|
|
|
lstart += dialog::handlePage(nl, nlm, (nl+1)/2);
|
2017-03-23 10:53:57 +00:00
|
|
|
}
|
2017-08-18 00:47:49 +00:00
|
|
|
else nlm = nl;
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2019-01-03 01:14:22 +00:00
|
|
|
int vf = min((vid.yres-64-vid.fsize*2) / nlm + (not_in_game ? 1 : 0), vid.xres/40);
|
2017-03-23 10:53:57 +00:00
|
|
|
|
2018-08-17 22:46:45 +00:00
|
|
|
eLand curland = getLandForList(cwt.at);
|
2016-08-26 09:58:03 +00:00
|
|
|
|
|
|
|
getcstat = '0';
|
|
|
|
|
2019-01-03 01:14:22 +00:00
|
|
|
if(not_in_game) {
|
|
|
|
int i0 = 56 + vid.fsize + nl * vf;
|
|
|
|
displayfrZ(64, i0, 1, vf-4, "(these lands are not in game)", forecolor, 0);
|
|
|
|
}
|
|
|
|
|
2016-08-26 09:58:03 +00:00
|
|
|
for(int i=0; i<nl; i++) {
|
2017-11-03 18:31:42 +00:00
|
|
|
eLand l = landlist[lstart + i];
|
2016-08-26 09:58:03 +00:00
|
|
|
int xr = vid.xres / 64;
|
2017-03-23 10:53:57 +00:00
|
|
|
int i0 = 56 + vid.fsize + i * vf;
|
2018-09-04 17:53:42 +00:00
|
|
|
color_t col;
|
2017-03-23 10:53:57 +00:00
|
|
|
if(landUnlocked(l)) col = linf[l].color; else col = 0x404040;
|
2016-08-26 09:58:03 +00:00
|
|
|
if(l == curland)
|
2017-07-04 13:38:33 +00:00
|
|
|
displayfrZ(1, i0, 1, vf-4, "*", forecolor, 0);
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*1, i0, 1, vf-4, XLAT1(linf[l].name), col, 0))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 1000 + l;
|
|
|
|
eItem it = treasureType(l);
|
|
|
|
int lv = items[it] * landMultiplier(l);
|
|
|
|
if(lv >= 25) col = 0xFFD500;
|
2019-06-17 09:00:23 +00:00
|
|
|
else if(lv && it == itSavedPrincess) col = 0xFFD500;
|
2016-08-26 09:58:03 +00:00
|
|
|
else if(lv >= 10) col = 0x00D500;
|
|
|
|
else if(items[it]) col = 0xC0C0C0;
|
2017-03-23 10:53:57 +00:00
|
|
|
else col = BLACKISH;
|
|
|
|
int c8 = (vf+2)/3;
|
2019-11-27 23:39:27 +00:00
|
|
|
if(displayfrZH(xr*24-c8*6, i0, 1, vf-4, (required_for_hyperstones(it) ? "" : "*") + its(items[it]), col, 16))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+it;
|
|
|
|
if(!cheater)
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*24, i0, 1, vf-4, its(hiitems[modecode()][it]), col, 16))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+it;
|
2017-03-23 10:53:57 +00:00
|
|
|
if(items[it]) col = iinf[it].color; else col = BLACKISH;
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*24+c8*4, i0, 1, vf-4, s0 + iinf[it].glyph, col, 16))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+it;
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*24+c8*5, i0, 1, vf-4, XLAT1(iinf[it].name), col, 0))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+it;
|
2017-10-10 10:43:41 +00:00
|
|
|
eItem io = nativeOrbType(l);
|
2016-08-26 09:58:03 +00:00
|
|
|
if(io == itShard) {
|
2017-03-23 10:53:57 +00:00
|
|
|
if(items[it] >= 10) col = winf[waMirror].color; else col = BLACKISH;
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*46, i0, 1, vf-4, XLAT1(winf[waMirror].name), col, 0))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 3000+waMirror;
|
|
|
|
if(getcstat == 3000+waMirror)
|
|
|
|
mouseovers = XLAT(
|
2018-08-17 22:46:45 +00:00
|
|
|
olrDescriptions[getOLR(io, cwt.at->land)], cwt.at->land, it, treasureTypeUnlock(curland, io));
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
else if(io) {
|
|
|
|
if(lv >= 25) col = 0xFFD500;
|
|
|
|
else if(lv >= 10) col = 0xC0C0C0;
|
2017-03-23 10:53:57 +00:00
|
|
|
else col = BLACKISH;
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*46-c8*4, i0, 1, vf-4, its(items[io]), col, 16))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+io;
|
2017-03-23 10:53:57 +00:00
|
|
|
if(lv >= 10) col = iinf[io].color; else col = BLACKISH;
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*46-c8, i0, 1, vf-4, s0 + iinf[io].glyph, col, 16))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+io;
|
2018-07-22 10:54:05 +00:00
|
|
|
if(displayfrZH(xr*46, i0, 1, vf-4, XLAT1(iinf[io].name), col, 0))
|
2016-08-26 09:58:03 +00:00
|
|
|
getcstat = 2000+io;
|
|
|
|
if(getcstat == 2000+io)
|
|
|
|
mouseovers = XLAT(
|
2017-12-03 18:12:15 +00:00
|
|
|
olrDescriptions[getOLR(io, curland)], curland, it, treasureTypeUnlock(curland, io));
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
}
|
2017-03-23 10:53:57 +00:00
|
|
|
|
|
|
|
dialog::displayPageButtons(3, pages);
|
2017-07-10 18:47:38 +00:00
|
|
|
|
|
|
|
keyhandler = [] (int sym, int uni) {
|
|
|
|
int umod = uni % 1000;
|
|
|
|
int udiv = uni / 1000;
|
|
|
|
if(udiv == 1 && umod < landtypes) {
|
2017-10-14 19:43:21 +00:00
|
|
|
const eLand l = eLand(umod);
|
2017-10-08 23:40:32 +00:00
|
|
|
gotoHelp(""); gotoHelpFor(l);
|
2017-10-08 22:21:39 +00:00
|
|
|
if(cheater) {
|
2017-10-14 19:43:21 +00:00
|
|
|
help_extension hex;
|
|
|
|
hex.key = 't';
|
|
|
|
hex.text = XLAT("teleport");
|
|
|
|
hex.action = [l] () {
|
2017-10-08 22:21:39 +00:00
|
|
|
cheater++;
|
|
|
|
bool princ = (l == laPrincessQuest);
|
|
|
|
if(princ) {
|
|
|
|
if(kills[moVizier] == 0) kills[moVizier] = 1;
|
|
|
|
princess::forceMouse = true;
|
|
|
|
princess::gotoPrincess = true;
|
|
|
|
cheatMoveTo(laPalace);
|
|
|
|
}
|
|
|
|
else cheatMoveTo(l);
|
|
|
|
canmove = true;
|
|
|
|
if(princ) fullcenter();
|
|
|
|
popScreen();
|
|
|
|
popScreen();
|
2017-10-14 19:43:21 +00:00
|
|
|
};
|
|
|
|
help_extensions.push_back(hex);
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-10 18:47:38 +00:00
|
|
|
else if(udiv == 2 && umod < ittypes) {
|
2017-10-08 22:21:39 +00:00
|
|
|
gotoHelp(generateHelpForItem(eItem(umod)));
|
|
|
|
if(cheater) {
|
|
|
|
dialog::helpToEdit(items[umod], 0, 200, 10, 10);
|
|
|
|
dialog::reaction = [] () {
|
|
|
|
if(hardcore) canmove = true;
|
|
|
|
else checkmove();
|
|
|
|
cheater++;
|
|
|
|
};
|
2017-07-10 18:47:38 +00:00
|
|
|
}
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
2017-07-10 18:47:38 +00:00
|
|
|
else if(udiv == 3 && umod < walltypes) gotoHelp(generateHelpForWall(eWall(umod)));
|
|
|
|
else if(uni == SDLK_F1) gotoHelp(
|
|
|
|
"This displays all lands available in the game. "
|
|
|
|
"Bonus lands (available only in separate challenges) "
|
|
|
|
"are not included. Lands written in dark have to be "
|
|
|
|
"unlocked, and lands in dark red are unavailable "
|
|
|
|
"because of using special options. Click on any "
|
|
|
|
"land or item to get information about it. Hover over "
|
|
|
|
"an Orb to know its relation to the current land. "
|
|
|
|
"Cheaters can click to move between lands, and use the "
|
|
|
|
"mousewheel to gain or lose treasures and orbs quickly (Ctrl = precise, Shift = reverse)."
|
|
|
|
);
|
|
|
|
else if(dialog::handlePageButtons(uni)) ;
|
2017-12-09 03:01:56 +00:00
|
|
|
else if(dialog::editInfix(uni)) ;
|
2017-07-10 18:47:38 +00:00
|
|
|
else if(doexiton(sym, uni)) popScreen();
|
|
|
|
};
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
// -- main menu --
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showMainMenu() {
|
2020-03-07 23:59:42 +00:00
|
|
|
cancel(); cancel = noaction;
|
2017-07-10 18:47:38 +00:00
|
|
|
gamescreen(2);
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2017-03-23 10:53:57 +00:00
|
|
|
getcstat = ' ';
|
|
|
|
|
|
|
|
dialog::init(XLAT("HyperRogue %1", VER), 0xC00000, 200, 100);
|
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addItem(XLAT("settings"), 's');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push(showSettings);
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addItem(XLAT("special modes"), 'm');
|
2017-07-04 13:38:33 +00:00
|
|
|
|
2017-07-22 23:33:27 +00:00
|
|
|
#if CAP_SAVE
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem(XLAT("local highscores"), 't');
|
2016-08-26 09:58:03 +00:00
|
|
|
#endif
|
2018-06-12 22:00:01 +00:00
|
|
|
dialog::addHelp();
|
2016-08-26 09:58:03 +00:00
|
|
|
if(cheater)
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem(XLAT("cheats"), 'c');
|
|
|
|
else dialog::addBreak(100);
|
2019-08-14 07:14:52 +00:00
|
|
|
dialog::addItem(XLAT("restart game"), 'r');
|
2017-12-03 18:51:45 +00:00
|
|
|
|
|
|
|
dialog::addItem(XLAT(inSpecialMode() ? "reset special modes" : "back to the start menu"), 'R');
|
2016-08-26 09:58:03 +00:00
|
|
|
|
|
|
|
string q;
|
2020-05-03 18:56:41 +00:00
|
|
|
#if ISMOBILE
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem(XLAT("visit the website"), 'q');
|
|
|
|
#else
|
|
|
|
q = quitsaves() ? "save" : "quit";
|
2016-08-26 09:58:03 +00:00
|
|
|
q = q + " the game";
|
2019-08-14 07:14:52 +00:00
|
|
|
dialog::addItem(XLAT(q), 'q');
|
2017-03-23 10:53:57 +00:00
|
|
|
#endif
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2017-03-23 10:53:57 +00:00
|
|
|
if(canmove)
|
2016-08-26 09:58:03 +00:00
|
|
|
q = "review your quest";
|
|
|
|
else
|
2017-07-10 18:47:38 +00:00
|
|
|
q = "game over screen";
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem(XLAT(q), SDLK_ESCAPE);
|
2018-11-17 18:24:02 +00:00
|
|
|
dialog::addItem(get_o_key().first, 'o');
|
2017-03-23 10:53:57 +00:00
|
|
|
|
2017-07-04 13:38:33 +00:00
|
|
|
if(inv::on)
|
|
|
|
dialog::addItem(XLAT("inventory"), 'i');
|
|
|
|
|
2020-05-03 18:56:41 +00:00
|
|
|
#if ISMOBILE
|
2017-08-13 17:15:14 +00:00
|
|
|
#if CAP_ACHIEVE
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem(XLAT("leaderboards/achievements"), '3');
|
|
|
|
#endif
|
2017-03-31 19:41:09 +00:00
|
|
|
#endif
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2017-07-22 23:33:27 +00:00
|
|
|
#if CAP_ANDROIDSHARE
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem("SHARE", 's'-96);
|
|
|
|
#endif
|
2018-07-09 17:55:56 +00:00
|
|
|
|
2017-07-10 18:47:38 +00:00
|
|
|
if(!canmove) q = "review the scene";
|
2016-08-26 09:58:03 +00:00
|
|
|
else if(turncount > 0) q = "continue game";
|
|
|
|
else q = "play the game!";
|
|
|
|
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::addItem(XLAT(q), ' ');
|
|
|
|
dialog::display();
|
2017-07-10 18:47:38 +00:00
|
|
|
|
|
|
|
keyhandler = [] (int sym, int uni) {
|
|
|
|
dialog::handleNavigation(sym, uni);
|
2018-12-06 11:31:51 +00:00
|
|
|
if(sym == SDLK_F1 || uni == 'h') gotoHelp("@");
|
|
|
|
else if(uni == 'c' && cheater) pushScreen(showCheatMenu);
|
|
|
|
else if(uni == 'm') pushScreen(showChangeMode);
|
2018-12-14 17:21:52 +00:00
|
|
|
else if(uni == 'R') dialog::do_if_confirmed([] {
|
2019-02-17 17:43:39 +00:00
|
|
|
#if CAP_STARTANIM
|
|
|
|
startanims::pick();
|
|
|
|
#endif
|
|
|
|
popScreenAll(), pushScreen(showStartMenu);
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
2017-07-22 23:33:27 +00:00
|
|
|
#if CAP_SAVE
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(uni == 't') scores::load();
|
2017-07-10 18:47:38 +00:00
|
|
|
#endif
|
2018-12-14 17:21:52 +00:00
|
|
|
else if(uni == 'r' || sym == SDLK_F5) dialog::do_if_confirmed([] {
|
2018-06-10 22:58:38 +00:00
|
|
|
restart_game();
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
2019-01-07 03:52:11 +00:00
|
|
|
else if(uni == 'q' || sym == SDLK_F10) {
|
|
|
|
if(needConfirmation()) dialog::do_if_confirmed([] {
|
2017-07-22 23:33:27 +00:00
|
|
|
#if ISMOBILE
|
2019-01-07 03:52:11 +00:00
|
|
|
extern void openURL();
|
|
|
|
openURL();
|
2017-07-22 23:33:27 +00:00
|
|
|
#else
|
2019-01-07 03:52:11 +00:00
|
|
|
quitmainloop = true;
|
2017-07-22 23:33:27 +00:00
|
|
|
#endif
|
2019-01-07 03:52:11 +00:00
|
|
|
});
|
|
|
|
else quitmainloop = true;
|
|
|
|
}
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(uni == 'o') {
|
2017-07-10 18:47:38 +00:00
|
|
|
clearMessages();
|
2018-11-17 18:24:02 +00:00
|
|
|
get_o_key().second();
|
2017-07-10 18:47:38 +00:00
|
|
|
}
|
2017-07-22 23:33:27 +00:00
|
|
|
#if CAP_INV
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(uni == 'i') {
|
2017-07-10 18:47:38 +00:00
|
|
|
clearMessages();
|
2017-07-12 16:03:53 +00:00
|
|
|
pushScreen(inv::show);
|
2017-03-23 10:53:57 +00:00
|
|
|
}
|
2016-08-26 09:58:03 +00:00
|
|
|
#endif
|
2017-07-10 18:47:38 +00:00
|
|
|
else if(sym == SDLK_ESCAPE)
|
|
|
|
showMissionScreen();
|
2020-05-03 18:56:41 +00:00
|
|
|
#if ISMOBILE
|
2017-07-10 18:47:38 +00:00
|
|
|
#ifdef HAVE_ACHIEVEMENTS
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(NUMBERKEY == '3') {
|
2017-07-10 18:47:38 +00:00
|
|
|
achievement_final(false);
|
|
|
|
pushScreen(leader::showMenu);
|
|
|
|
}
|
2017-07-04 13:38:33 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2017-07-10 18:47:38 +00:00
|
|
|
else if(doexiton(sym, uni)) {
|
|
|
|
popScreenAll();
|
|
|
|
msgs.clear();
|
2017-07-04 13:38:33 +00:00
|
|
|
}
|
2017-07-10 18:47:38 +00:00
|
|
|
};
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
// -- display modes --
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void editScale() {
|
2020-04-16 22:53:58 +00:00
|
|
|
dialog::editNumber(vpconf.scale, .001, 1000, .1, 1, XLAT("scale factor"),
|
2017-11-06 20:18:40 +00:00
|
|
|
XLAT("Scale the displayed model."));
|
2018-03-25 13:27:42 +00:00
|
|
|
dialog::scaleSinh();
|
2017-11-06 20:18:40 +00:00
|
|
|
}
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showGraphQuickKeys() {
|
2018-12-13 16:02:10 +00:00
|
|
|
cmode = sm::SIDE | sm::MAYDARK;
|
2017-07-12 17:50:39 +00:00
|
|
|
gamescreen(0);
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::init(XLAT("quick options"));
|
2021-02-01 10:20:22 +00:00
|
|
|
|
|
|
|
dialog::addItem("quick projection", '1');
|
2019-02-26 11:23:07 +00:00
|
|
|
|
2020-01-30 16:45:05 +00:00
|
|
|
const char *wdmodes[7] = {"ASCII", "black", "plain", "Escher", "plain/3D", "Escher/3D", "ASCII/3D"};
|
2017-07-04 13:38:33 +00:00
|
|
|
dialog::addSelItem(XLAT("wall display mode"), XLAT(wdmodes[vid.wallmode]), '5');
|
2017-03-23 10:53:57 +00:00
|
|
|
|
2020-09-15 18:39:15 +00:00
|
|
|
const char *mdmodes[6] = {"ASCII", "items only", "items and monsters", "3D", "?", "?"};
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addSelItem(XLAT("monster display mode"), XLAT(mdmodes[vid.monmode]), '8');
|
2018-03-25 12:04:40 +00:00
|
|
|
|
2020-09-15 18:39:15 +00:00
|
|
|
const char *hlmodes[3] = {"press Alt", "highlight", "super-highlight"};
|
|
|
|
dialog::addSelItem(XLAT("highlight stuff"), XLAT(hlmodes[vid.highlightmode]), 508);
|
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addBoolItem(XLAT("draw the grid"), (vid.grid), '6');
|
|
|
|
dialog::addBoolItem(XLAT("mark heptagons"), (vid.darkhepta), '7');
|
2018-03-25 12:04:40 +00:00
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addBreak(50);
|
2019-04-04 15:13:15 +00:00
|
|
|
dialog::addInfo(XLAT("Hint: these keys usually work during the game"));
|
|
|
|
dialog::addInfo(XLAT("also hold Alt during the game to toggle high contrast"));
|
2019-03-30 22:45:28 +00:00
|
|
|
|
|
|
|
dialog::addBreak(50);
|
|
|
|
dialog::addBack();
|
2017-03-23 10:53:57 +00:00
|
|
|
dialog::display();
|
2019-03-30 22:45:28 +00:00
|
|
|
|
2017-07-10 18:47:38 +00:00
|
|
|
keyhandler = [] (int sym, int uni) {
|
|
|
|
dialog::handleNavigation(sym, uni);
|
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
if(gmodekeys(sym, uni)) ;
|
|
|
|
else if(doexiton(sym, uni)) popScreen();
|
2017-07-10 18:47:38 +00:00
|
|
|
};
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void enable_cheat() {
|
2018-11-01 17:59:25 +00:00
|
|
|
if(tactic::on && gold()) {
|
|
|
|
addMessage(XLAT("Not available in the pure tactics mode!"));
|
|
|
|
}
|
|
|
|
else if(daily::on) {
|
|
|
|
addMessage(XLAT("Not available in the daily challenge!"));
|
|
|
|
}
|
2018-12-14 17:21:52 +00:00
|
|
|
else if(!cheater) dialog::cheat_if_confirmed([] {
|
2018-11-01 17:59:25 +00:00
|
|
|
cheater++;
|
|
|
|
addMessage(XLAT("You activate your demonic powers!"));
|
2020-05-03 18:56:41 +00:00
|
|
|
#if !ISMOBILE
|
2018-11-01 17:59:25 +00:00
|
|
|
addMessage(XLAT("Shift+F, Shift+O, Shift+T, Shift+L, Shift+U, etc."));
|
|
|
|
#endif
|
|
|
|
popScreen();
|
2018-12-14 17:21:52 +00:00
|
|
|
});
|
2018-11-01 17:59:25 +00:00
|
|
|
else {
|
|
|
|
popScreen();
|
2019-11-22 22:10:02 +00:00
|
|
|
specialland = firstland = princess::challenge ? laPalace : laIce;
|
2018-11-01 17:59:25 +00:00
|
|
|
restart_game();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
// -- game modes --
|
2017-07-04 13:38:33 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void switchHardcore() {
|
2017-07-04 13:38:33 +00:00
|
|
|
if(hardcore && !canmove) {
|
2018-06-10 22:58:38 +00:00
|
|
|
restart_game();
|
2017-07-04 13:38:33 +00:00
|
|
|
hardcore = false;
|
|
|
|
}
|
|
|
|
else if(hardcore && canmove) { hardcore = false; }
|
|
|
|
else { hardcore = true; canmove = true; hardcoreAt = turncount; }
|
|
|
|
if(hardcore)
|
|
|
|
addMessage("One wrong move, and it is game over!");
|
|
|
|
else
|
|
|
|
addMessage("Not so hardcore?");
|
2017-07-22 23:33:27 +00:00
|
|
|
if(pureHardcore()) popScreenAll();
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showCreative() {
|
2019-03-30 22:45:28 +00:00
|
|
|
cmode = sm::SIDE | sm::MAYDARK;
|
|
|
|
gamescreen(3);
|
|
|
|
dialog::init(XLAT("creative mode"));
|
|
|
|
|
2019-05-06 23:08:49 +00:00
|
|
|
#if CAP_EDIT
|
2019-04-04 15:13:15 +00:00
|
|
|
dialog::addItem(XLAT("map editor"), 'm');
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::add_action([] {
|
2020-05-31 14:43:36 +00:00
|
|
|
dialog::cheat_if_confirmed([] {
|
2019-03-30 22:45:28 +00:00
|
|
|
cheater++;
|
|
|
|
pushScreen(mapeditor::showMapEditor);
|
|
|
|
lastexplore = turncount;
|
|
|
|
addMessage(XLAT("You activate your terraforming powers!"));
|
|
|
|
});
|
|
|
|
});
|
2019-05-06 23:08:49 +00:00
|
|
|
#endif
|
2019-03-30 22:45:28 +00:00
|
|
|
|
|
|
|
#if CAP_EDIT
|
2020-04-17 18:04:33 +00:00
|
|
|
dialog::addItem(XLAT("shape editor"), 'g');
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::add_action([] {
|
2020-04-17 18:04:33 +00:00
|
|
|
mapeditor::drawing_tool = false;
|
2021-02-01 10:45:52 +00:00
|
|
|
mapeditor::intexture = false;
|
2019-03-30 22:45:28 +00:00
|
|
|
pushScreen(mapeditor::showDrawEditor);
|
|
|
|
mapeditor::initdraw(cwt.at);
|
|
|
|
});
|
|
|
|
#endif
|
|
|
|
|
2020-04-17 18:04:33 +00:00
|
|
|
#if CAP_EDIT
|
|
|
|
dialog::addItem(XLAT("drawing tool"), 'd');
|
|
|
|
dialog::add_action([] {
|
|
|
|
dialog::cheat_if_confirmed([] {
|
|
|
|
mapeditor::drawing_tool = true;
|
2021-02-01 10:45:52 +00:00
|
|
|
mapeditor::intexture = false;
|
2020-04-17 18:04:33 +00:00
|
|
|
pushScreen(mapeditor::showDrawEditor);
|
|
|
|
mapeditor::initdraw(cwt.at);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
#endif
|
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
// display modes
|
|
|
|
#if CAP_MODEL
|
2019-08-15 13:05:43 +00:00
|
|
|
if(GDIM == 2) {
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addItem(XLAT("paper model creator"), 'n');
|
|
|
|
dialog::add_action([] { netgen::run(); });
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-05-06 23:08:49 +00:00
|
|
|
#if CAP_SHOT
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addItem(XLAT("screenshots"), 's');
|
2019-03-30 22:59:51 +00:00
|
|
|
dialog::add_action_push(shot::menu);
|
2019-05-06 23:08:49 +00:00
|
|
|
#endif
|
2019-03-30 22:59:51 +00:00
|
|
|
|
2019-05-06 23:08:49 +00:00
|
|
|
#if CAP_ANIMATIONS
|
2019-04-03 18:32:46 +00:00
|
|
|
dialog::addBoolItem(XLAT("animations"), anims::any_on(), 'a');
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::add_action_push(anims::show);
|
2019-05-06 23:08:49 +00:00
|
|
|
#endif
|
2019-03-30 22:45:28 +00:00
|
|
|
|
2019-08-09 22:58:50 +00:00
|
|
|
dialog::addBoolItem(XLAT("history mode"), history::on || history::includeHistory, 'h');
|
|
|
|
dialog::add_action_push(history::history_menu);
|
2019-04-03 18:32:46 +00:00
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
#if CAP_TEXTURE
|
2019-08-15 13:05:43 +00:00
|
|
|
if(GDIM == 2) {
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addBoolItem(XLAT("texture mode"), texture::config.tstate == texture::tsActive, 't');
|
|
|
|
dialog::add_action_push(texture::showMenu);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
dialog::addBoolItem(XLAT("cheat mode"), (cheater), 'c');
|
|
|
|
dialog::add_action(enable_cheat);
|
|
|
|
|
|
|
|
// dialog::addBoolItem(XLAT("expansion"), viewdists, 'x');
|
|
|
|
|
|
|
|
dialog::addBreak(50);
|
|
|
|
dialog::addBack();
|
|
|
|
dialog::display();
|
|
|
|
}
|
2019-05-30 09:52:34 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void show_chaos() {
|
2019-05-30 09:52:34 +00:00
|
|
|
gamescreen(3);
|
|
|
|
dialog::init(XLAT("Chaos mode"));
|
|
|
|
chaosUnlocked = chaosUnlocked || autocheat;
|
|
|
|
|
|
|
|
dialog::addHelp(
|
|
|
|
"In the Chaos mode, lands change very often, and "
|
|
|
|
"there are no walls between them. "
|
|
|
|
"Some lands are incompatible with this."
|
|
|
|
"\n\nYou need to reach Crossroads IV to unlock the Chaos mode."
|
|
|
|
);
|
|
|
|
|
|
|
|
dialog::addBreak(100);
|
|
|
|
|
|
|
|
dialog::addBoolItem(XLAT("Chaos mode") + " " + ONOFF(false), !chaosmode, 'A');
|
2019-06-01 15:04:50 +00:00
|
|
|
dialog::add_action([] { dialog::do_if_confirmed([] { if(chaosUnlocked) restart_game(rg::chaos); }); });
|
2019-05-30 09:52:34 +00:00
|
|
|
|
|
|
|
if(chaosUnlocked) for(int a=1; a<5; a++) {
|
2019-06-01 15:03:55 +00:00
|
|
|
if(a > 1 && ISWEB) continue;
|
2019-10-12 11:47:41 +00:00
|
|
|
if(a == 1 && walls_not_implemented()) continue;
|
2019-05-30 09:52:34 +00:00
|
|
|
dialog::addBoolItem(
|
|
|
|
a == 1 ? XLATN("Crossroads IV") :
|
|
|
|
a == 2 ? XLATN("Palace") :
|
|
|
|
a == 3 ? XLAT("total chaos") :
|
|
|
|
XLAT("random walk"),
|
|
|
|
chaosmode == a, 'A' + a);
|
|
|
|
dialog::add_action([a] { dialog::do_if_confirmed([a] {
|
|
|
|
int cm = chaosmode;
|
|
|
|
stop_game_and_switch_mode(rg::chaos);
|
|
|
|
if(!chaosmode && cm != a) switch_game_mode(rg::chaos);
|
|
|
|
if(chaosmode) chaosmode = a;
|
|
|
|
start_game();
|
|
|
|
}); });
|
|
|
|
}
|
|
|
|
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBack();
|
|
|
|
dialog::display();
|
|
|
|
}
|
2021-02-06 01:55:51 +00:00
|
|
|
|
|
|
|
EX void mode_higlights() {
|
|
|
|
gamescreen(3);
|
|
|
|
dialog::init(XLAT("highlights & achievements"));
|
|
|
|
|
|
|
|
dialog::addBigItem(XLAT("Space Rocks"), 'r');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
stop_game();
|
|
|
|
resetModes();
|
|
|
|
specialland = laAsteroids;
|
|
|
|
set_geometry(gKleinQuartic);
|
|
|
|
set_variation(eVariation::bitruncated);
|
|
|
|
shmup::on = true;
|
|
|
|
start_game();
|
|
|
|
}));
|
|
|
|
dialog::addInfo(XLAT("classic game except hyperbolic"));
|
|
|
|
dialog::extend();
|
|
|
|
|
2021-02-07 17:29:49 +00:00
|
|
|
#if CAP_RACING && MAXMDIM >= 4
|
2021-02-06 01:55:51 +00:00
|
|
|
dialog::addBigItem(XLAT("Racing in Thurston geometries"), 't'-96);
|
|
|
|
dialog::add_action(dialog::add_confirmation(racing::start_thurston));
|
|
|
|
dialog::addInfo(XLAT("race through a maze in exotic 3D geometry!"));
|
|
|
|
dialog::extend();
|
2021-02-07 17:29:49 +00:00
|
|
|
#endif
|
2021-02-06 01:55:51 +00:00
|
|
|
|
|
|
|
dialog::addBigItem(XLAT1("Halloween"), 'Z');
|
|
|
|
dialog::add_action(dialog::add_confirmation(halloween::start_all));
|
|
|
|
dialog::addInfo(XLAT("Halloween mini-game"));
|
|
|
|
dialog::extend();
|
|
|
|
|
|
|
|
dialog::addBigItem(XLAT1("heptagonal mode"), 'H');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes('7');
|
|
|
|
start_game();
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
}));
|
|
|
|
dialog::addInfo(XLAT("can you find the Heptagonal Grail?"));
|
|
|
|
dialog::extend();
|
|
|
|
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBigItem(XLAT1("other achievements:"), 0);
|
|
|
|
dialog::addItem(XLAT("General Euclid"), 'e');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes();
|
|
|
|
set_geometry(gEuclid);
|
|
|
|
firstland = specialland = laMirrorOld;
|
|
|
|
start_game();
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
}));
|
|
|
|
|
|
|
|
dialog::addItem(XLAT("Worm of the World"), 'w');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes();
|
|
|
|
set_geometry(gZebraQuotient);
|
|
|
|
firstland = specialland = laDesert;
|
|
|
|
start_game();
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
}));
|
|
|
|
|
2021-02-07 17:29:49 +00:00
|
|
|
#if CAP_CRYSTAL
|
|
|
|
if(hiitemsMax(itHolyGrail) || cheater || autocheat) {
|
2021-02-06 01:55:51 +00:00
|
|
|
dialog::addItem(XLAT("Knight of the 16-Cell Table"), '1');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes();
|
|
|
|
crystal::set_crystal(8);
|
|
|
|
firstland = specialland = laCamelot;
|
|
|
|
start_game();
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
pushScreen(crystal::crystal_knight_help);
|
|
|
|
}));
|
|
|
|
|
|
|
|
dialog::addItem(XLAT("Knight of the 3-Spherical Table"), '3');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes();
|
|
|
|
crystal::set_crystal(8);
|
|
|
|
set_variation(eVariation::bitruncated);
|
|
|
|
set_variation(eVariation::bitruncated);
|
|
|
|
firstland = specialland = laCamelot;
|
|
|
|
start_game();
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
pushScreen(crystal::crystal_knight_help);
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
dialog::addItem("(locked until you find a Holy Grail)", 0);
|
|
|
|
}
|
2021-02-07 17:29:49 +00:00
|
|
|
#endif
|
2021-02-06 01:55:51 +00:00
|
|
|
|
2021-02-07 17:29:49 +00:00
|
|
|
#if MAXMDIM >= 4
|
2021-02-06 01:55:51 +00:00
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBigItem(XLAT1("some cool visualizations"), 0);
|
|
|
|
dialog::addItem(XLAT("Emerald Mine in {5,3,4}"), '5');
|
|
|
|
dialog::add_action(dialog::add_confirmation([] {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes();
|
|
|
|
specialland = laEmerald;
|
|
|
|
set_geometry(gSpace534);
|
|
|
|
check_cgi();
|
|
|
|
cgi.require_basics();
|
|
|
|
cgi.require_shapes();
|
|
|
|
fieldpattern::field_from_current();
|
|
|
|
set_geometry(gFieldQuotient);
|
|
|
|
int p = 2;
|
|
|
|
for(;; p++) { currfp.Prime = p; currfp.force_hash = 0x72414D0C; if(!currfp.solve()) break; }
|
|
|
|
start_game();
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
}));
|
2021-02-07 17:29:49 +00:00
|
|
|
#endif
|
2021-02-06 01:55:51 +00:00
|
|
|
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBack();
|
|
|
|
dialog::display();
|
|
|
|
}
|
2018-03-24 15:00:13 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showChangeMode() {
|
2017-07-10 18:47:38 +00:00
|
|
|
gamescreen(3);
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::init(XLAT("special modes"));
|
|
|
|
// gameplay modes
|
2017-03-23 10:53:57 +00:00
|
|
|
|
2017-07-22 23:33:27 +00:00
|
|
|
#if CAP_TOUR
|
2019-09-13 16:01:28 +00:00
|
|
|
dialog::addBoolItem(XLAT("guided tour"), tour::on, 'T');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed(tour::start);
|
2017-04-08 15:18:29 +00:00
|
|
|
#endif
|
2021-03-06 10:00:36 +00:00
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addBoolItem(XLAT("creative mode"), (false), 'c');
|
|
|
|
dialog::add_action_push(showCreative);
|
2021-03-06 10:00:36 +00:00
|
|
|
|
2018-08-28 15:17:34 +00:00
|
|
|
dialog::addBoolItem(XLAT("experiment with geometry"), geometry || CHANGED_VARIATION || viewdists, 'e');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action(runGeometryExperiments);
|
2019-03-30 22:45:28 +00:00
|
|
|
|
|
|
|
dialog::addBreak(100);
|
|
|
|
|
|
|
|
dialog::addBoolItem(XLAT(SHMUPTITLE), shmup::on, 's');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed(shmup::switch_shmup);
|
|
|
|
|
2019-03-30 22:45:28 +00:00
|
|
|
dialog::addBoolItem(XLAT("multiplayer"), multi::players > 1, 'm');
|
2019-06-13 09:01:39 +00:00
|
|
|
dialog::add_action_push(multi::showConfigureMultiplayer);
|
2021-03-06 10:00:36 +00:00
|
|
|
|
|
|
|
if(!shmup::on) {
|
|
|
|
dialog::addSelItem(XLAT("hardcore mode"),
|
2016-08-26 09:58:03 +00:00
|
|
|
hardcore && !pureHardcore() ? XLAT("PARTIAL") : ONOFF(hardcore), 'h');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action(switchHardcore);
|
|
|
|
}
|
2017-07-12 16:03:53 +00:00
|
|
|
if(getcstat == 'h')
|
|
|
|
mouseovers = XLAT("One wrong move and it is game over!");
|
2016-08-26 09:58:03 +00:00
|
|
|
|
2017-03-23 10:53:57 +00:00
|
|
|
multi::cpid = 0;
|
|
|
|
dialog::addBoolItem(XLAT("Chaos mode"), (chaosmode), 'C');
|
2019-05-30 09:52:34 +00:00
|
|
|
dialog::add_action_push(show_chaos);
|
2021-03-06 10:00:36 +00:00
|
|
|
|
2020-07-29 21:01:15 +00:00
|
|
|
dialog::addBoolItem(XLAT("puzzle/exploration mode"), peace::on, 'p');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_push(peace::showMenu);
|
|
|
|
|
2017-07-16 21:00:55 +00:00
|
|
|
dialog::addBoolItem(XLAT("Orb Strategy mode"), (inv::on), 'i');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed([] { restart_game(rg::inv); });
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
dialog::addBoolItem(XLAT("pure tactics mode"), (tactic::on), 't');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_push_clear(tactic::showMenu);
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
dialog::addBoolItem(XLAT("Yendor Challenge"), (yendor::on), 'y');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action([] {
|
|
|
|
clearMessages();
|
|
|
|
if(yendor::everwon || autocheat)
|
|
|
|
pushScreen(yendor::showMenu);
|
|
|
|
else gotoHelp(yendor::chelp);
|
|
|
|
});
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
dialog::addBoolItem(XLAT("%1 Challenge", moPrincess), (princess::challenge), 'P');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed([] {
|
|
|
|
if(!princess::everSaved)
|
|
|
|
addMessage(XLAT("Save %the1 first to unlock this challenge!", moPrincess));
|
|
|
|
else restart_game(rg::princess);
|
|
|
|
});
|
|
|
|
|
2017-07-12 16:03:53 +00:00
|
|
|
dialog::addBoolItem(XLAT("random pattern mode"), (randomPatternsMode), 'r');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed([] {
|
|
|
|
stop_game();
|
|
|
|
firstland = laIce;
|
|
|
|
restart_game(rg::randpattern);
|
|
|
|
});
|
|
|
|
|
2018-11-24 22:52:13 +00:00
|
|
|
#if CAP_RACING
|
|
|
|
dialog::addBoolItem(XLAT("racing mode"), racing::on, 'R');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action(racing::configure_race);
|
2018-11-24 22:52:13 +00:00
|
|
|
#endif
|
2019-06-01 15:03:55 +00:00
|
|
|
#if CAP_ARCM && !ISWEB
|
2019-05-29 18:22:03 +00:00
|
|
|
if(multi::players == 1) {
|
|
|
|
dialog::addBoolItem(XLAT("dual geometry mode"), dual::state, 'D');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed([] { restart_game(rg::dualmode); });
|
2019-05-29 18:22:03 +00:00
|
|
|
}
|
2020-01-28 16:57:32 +00:00
|
|
|
if(dual::state) {
|
|
|
|
dialog::addBoolItem(XLAT("dual geometry puzzle"), dpgen::in, 'G');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_confirmed([] { pushScreen(dpgen::show_menu); });
|
2020-01-28 16:57:32 +00:00
|
|
|
}
|
2019-05-29 00:44:30 +00:00
|
|
|
#endif
|
2018-05-15 21:26:04 +00:00
|
|
|
#if CAP_DAILY
|
2018-06-29 10:30:41 +00:00
|
|
|
dialog::addBoolItem(XLAT("Strange Challenge"), daily::on, 'z');
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::add_action_push(daily::showMenu);
|
2018-05-15 21:26:04 +00:00
|
|
|
#endif
|
2017-03-23 10:53:57 +00:00
|
|
|
|
|
|
|
dialog::addBreak(50);
|
2021-02-06 01:55:51 +00:00
|
|
|
|
|
|
|
dialog::addItem(XLAT("highlights & achievements"), 'h');
|
|
|
|
dialog::add_action_push(mode_higlights);
|
2017-03-23 10:53:57 +00:00
|
|
|
|
2018-06-12 22:00:01 +00:00
|
|
|
dialog::addBack();
|
2021-03-06 10:00:36 +00:00
|
|
|
dialog::display();
|
2016-08-26 09:58:03 +00:00
|
|
|
}
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX bool showstartmenu;
|
2017-08-06 12:50:16 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX bool showHalloween() {
|
2017-10-09 08:51:16 +00:00
|
|
|
time_t t = time(NULL);
|
|
|
|
struct tm tm = *localtime(&t);
|
|
|
|
int month = tm.tm_mon + 1;
|
|
|
|
int day = tm.tm_mday;
|
|
|
|
if(month == 10 && day >= 24) return true;
|
|
|
|
if(month == 11 && day <= 7) return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-04-30 22:21:18 +00:00
|
|
|
int daily_mode;
|
2018-03-24 15:00:13 +00:00
|
|
|
|
2019-12-14 13:09:58 +00:00
|
|
|
void announce_random() {
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addTitle("(random option)", 0x808080, 50);
|
|
|
|
}
|
|
|
|
|
|
|
|
void announce_nothing() {
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addTitle("", 0x808080, 50);
|
|
|
|
}
|
|
|
|
|
|
|
|
void announce_seasonal() {
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addTitle("(seasonal option)", 0x808080, 50);
|
|
|
|
}
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showStartMenu() {
|
2018-04-30 22:21:18 +00:00
|
|
|
if(!daily_mode) {
|
|
|
|
daily_mode = hrand(10) + 1;
|
2018-03-24 15:00:13 +00:00
|
|
|
if(showHalloween())
|
2018-04-30 22:21:18 +00:00
|
|
|
daily_mode = 20;
|
2018-03-24 15:00:13 +00:00
|
|
|
}
|
|
|
|
|
2019-12-14 13:10:34 +00:00
|
|
|
getcstat = ' ';
|
|
|
|
|
2019-02-17 17:43:39 +00:00
|
|
|
#if CAP_STARTANIM
|
2019-12-14 13:10:34 +00:00
|
|
|
startanims::display();
|
2019-02-17 17:43:39 +00:00
|
|
|
#endif
|
2017-08-06 12:50:16 +00:00
|
|
|
|
|
|
|
dialog::init();
|
|
|
|
|
|
|
|
dialog::addInfo(XLAT("Welcome to HyperRogue!"));
|
|
|
|
dialog::addBreak(100);
|
|
|
|
|
|
|
|
dialog::addBigItem(XLAT("HyperRogue classic"), 'c');
|
|
|
|
dialog::addInfo(XLAT("explore the world, collect treasures"));
|
|
|
|
dialog::addInfo(XLAT("do not get checkmated"));
|
|
|
|
|
|
|
|
#if CAP_INV
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBigItem(XLAT("Orb Strategy mode"), 'i');
|
|
|
|
dialog::addInfo(XLAT("use your Orbs in tough situations"));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CAP_TOUR
|
|
|
|
dialog::addBreak(100);
|
2019-09-13 16:01:28 +00:00
|
|
|
dialog::addBigItem(XLAT("guided tour"), 't');
|
2017-08-06 12:50:16 +00:00
|
|
|
dialog::addInfo(XLAT("learn about hyperbolic geometry!"));
|
|
|
|
#endif
|
|
|
|
|
2019-12-14 13:09:58 +00:00
|
|
|
if(have_current_settings()) {
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBigItem(XLAT1("use current/saved settings"), SDLK_ESCAPE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(have_current_graph_settings()) {
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBigItem(XLAT1("reset the graphics settings"), 'r');
|
|
|
|
dialog::add_action([] () { reset_graph_settings(); });
|
|
|
|
}
|
|
|
|
|
|
|
|
dialog::addBreak(100);
|
|
|
|
dialog::addBigItem(XLAT("main menu"), 'm');
|
|
|
|
dialog::addInfo(XLAT("more options"));
|
|
|
|
|
2018-04-30 22:21:18 +00:00
|
|
|
switch(daily_mode) {
|
2018-03-24 15:00:13 +00:00
|
|
|
case 1:
|
|
|
|
#if CAP_SHMUP_GOOD
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addBigItem(XLAT("shoot'em up mode"), 's');
|
|
|
|
dialog::addInfo(XLAT("continuous spacetime"));
|
|
|
|
#if CAP_ACHIEVE
|
|
|
|
dialog::addInfo(XLAT("(most achievements are not available)"));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addBigItem(XLAT("heptagonal mode"), '7');
|
|
|
|
dialog::addInfo(XLAT("more curvature"));
|
|
|
|
dialog::addInfo(XLAT("(most achievements are not available)"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2019-09-12 14:26:30 +00:00
|
|
|
dialog::addBigItem(XLAT("experiment with geometry"), 'g');
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addInfo(XLAT("(most achievements are not available)"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
if(chaosUnlocked) {
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addBigItem(XLAT("Chaos mode"), 'C');
|
|
|
|
dialog::addInfo(XLAT("(most achievements are not available)"));
|
|
|
|
}
|
|
|
|
break;
|
2018-03-29 22:18:41 +00:00
|
|
|
|
|
|
|
#if CAP_RUG
|
2018-03-24 15:00:13 +00:00
|
|
|
case 5:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addBigItem(XLAT("hypersian rug mode"), 'M');
|
|
|
|
dialog::addInfo(XLAT("see the true form"));
|
|
|
|
break;
|
2018-03-29 22:18:41 +00:00
|
|
|
#endif
|
|
|
|
|
2018-05-15 21:29:09 +00:00
|
|
|
#if CAP_TEXTURE && CAP_EDIT
|
2018-03-24 15:00:13 +00:00
|
|
|
case 6:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addBigItem(XLAT("texture mode"), 'T');
|
|
|
|
dialog::addInfo(XLAT("paint pictures"));
|
|
|
|
break;
|
2018-03-29 22:18:41 +00:00
|
|
|
#endif
|
2018-05-20 13:17:22 +00:00
|
|
|
|
|
|
|
#if CAP_DAILY
|
|
|
|
case 7:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2018-05-20 13:17:22 +00:00
|
|
|
dialog::addBigItem(XLAT("Strange Challenge"), 'z');
|
|
|
|
dialog::addInfo(XLAT("compete with other players on random lands in random geometries"));
|
|
|
|
break;
|
|
|
|
#endif
|
2019-09-28 14:16:49 +00:00
|
|
|
|
2019-09-28 19:59:10 +00:00
|
|
|
#if CAP_RACING
|
2019-09-28 14:16:49 +00:00
|
|
|
case 8:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2019-09-28 14:16:49 +00:00
|
|
|
dialog::addBigItem(XLAT("Racing"), 'r'-96);
|
|
|
|
dialog::addInfo(XLAT("how fast can you reach the end?"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 9:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_random();
|
2019-09-28 14:16:49 +00:00
|
|
|
dialog::addBigItem(XLAT("Racing in Thurston geometries"), 't'-96);
|
|
|
|
dialog::addInfo(XLAT("race through a maze in exotic 3D geometry!"));
|
|
|
|
break;
|
2019-09-28 19:59:10 +00:00
|
|
|
#endif
|
|
|
|
|
2018-03-24 15:00:13 +00:00
|
|
|
case 20:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_seasonal();
|
2018-05-26 23:06:54 +00:00
|
|
|
dialog::addBigItem(XLAT1("Halloween"), 'Z');
|
2018-03-24 15:00:13 +00:00
|
|
|
dialog::addInfo(XLAT("Halloween mini-game"));
|
|
|
|
break;
|
2019-09-28 14:15:10 +00:00
|
|
|
|
|
|
|
default:
|
2019-12-14 13:09:58 +00:00
|
|
|
announce_nothing();
|
2019-09-28 14:15:10 +00:00
|
|
|
dialog::addBigItem("", 0);
|
|
|
|
dialog::addInfo("");
|
|
|
|
break;
|
2018-03-24 15:00:13 +00:00
|
|
|
}
|
|
|
|
|
2017-08-06 12:50:16 +00:00
|
|
|
dialog::display();
|
|
|
|
clearMessages();
|
2017-09-01 20:36:03 +00:00
|
|
|
|
|
|
|
timerstart = time(NULL);
|
2017-08-06 12:50:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
initquickqueue();
|
|
|
|
int siz = min(vid.xres, vid.yres) / 8;
|
|
|
|
drawMonsterType(moPrincess, NULL, atscreenpos(siz,siz,siz) * spin(-M_PI/4), 0, 0);
|
|
|
|
drawMonsterType(moKnight, NULL, atscreenpos(vid.xres-siz,siz,siz) * spin(-3*M_PI/4), 0, 0);
|
|
|
|
drawItemType(itOrbYendor, NULL, atscreenpos(siz,vid.yres-siz,siz) * spin(M_PI/4), iinf[itOrbYendor].color, 0, false);
|
|
|
|
drawItemType(itKey, NULL, atscreenpos(siz,vid.yres-siz,siz) * spin(M_PI/4), iinf[itKey].color, 0, false);
|
|
|
|
drawItemType(itHyperstone, NULL, atscreenpos(vid.xres-siz,vid.yres-siz,siz) * spin(3*M_PI/4), iinf[itHyperstone].color, 0, false);
|
|
|
|
quickqueue();
|
|
|
|
*/
|
|
|
|
|
|
|
|
keyhandler = [] (int sym, int uni) {
|
|
|
|
dialog::handleNavigation(sym, uni);
|
|
|
|
if(uni == 'o') uni = 'i';
|
2019-12-14 13:10:34 +00:00
|
|
|
#if CAP_STARTANIM
|
|
|
|
else if(uni == startanims::EXPLORE_START_ANIMATION)
|
|
|
|
startanims::explore();
|
|
|
|
#endif
|
2018-03-29 22:18:41 +00:00
|
|
|
#if CAP_RUG
|
2018-03-24 15:00:13 +00:00
|
|
|
else if(uni == 'M') {
|
|
|
|
rug::init();
|
|
|
|
popScreenAll();
|
|
|
|
resetModes('c');
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
vid.wallmode = 3;
|
|
|
|
vid.monmode = 2;
|
|
|
|
rug::model_distance *= 2;
|
|
|
|
rug::init();
|
|
|
|
}
|
2018-03-29 22:18:41 +00:00
|
|
|
#endif
|
2018-05-15 21:29:09 +00:00
|
|
|
#if CAP_TEXTURE && CAP_EDIT
|
2018-03-24 15:00:13 +00:00
|
|
|
else if(uni == 'T') {
|
|
|
|
popScreenAll();
|
2019-01-03 14:16:12 +00:00
|
|
|
pushScreen(texture::showMenu);
|
2018-03-24 15:00:13 +00:00
|
|
|
resetModes('c');
|
2019-01-03 14:16:12 +00:00
|
|
|
stop_game();
|
|
|
|
firstland = specialland = laCanvas;
|
|
|
|
cheater = true;
|
|
|
|
patterns::canvasback = 0xFFFFFF;
|
|
|
|
mapeditor::drawplayer = false;
|
|
|
|
start_game();
|
2018-03-24 15:00:13 +00:00
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
2019-01-03 14:16:12 +00:00
|
|
|
calcparam();
|
|
|
|
drawthemap();
|
|
|
|
texture::start_editor();
|
2018-03-24 15:00:13 +00:00
|
|
|
}
|
2018-03-29 22:18:41 +00:00
|
|
|
#endif
|
2018-03-24 15:00:13 +00:00
|
|
|
else if(uni == 'g') {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes('c');
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
pushScreen(showEuclideanMenu);
|
|
|
|
}
|
|
|
|
else if(uni == 'c' || uni == 'i' || uni == 's' || uni == 'C' || uni == '7') {
|
|
|
|
if(uni == 'C' && !chaosUnlocked) {
|
|
|
|
return;
|
|
|
|
}
|
2017-08-06 12:50:16 +00:00
|
|
|
popScreenAll();
|
2017-12-03 18:51:45 +00:00
|
|
|
resetModes(uni);
|
2017-08-06 12:50:16 +00:00
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
2017-10-09 08:51:16 +00:00
|
|
|
stampbase = ticks;
|
2018-11-18 02:18:11 +00:00
|
|
|
if(uni == 's')
|
2019-08-09 21:08:42 +00:00
|
|
|
multi::configure();
|
2017-10-09 08:51:16 +00:00
|
|
|
}
|
2021-02-06 01:55:51 +00:00
|
|
|
else if(uni == 'Z')
|
|
|
|
halloween::start_all();
|
2020-04-17 13:35:48 +00:00
|
|
|
#if CAP_RACING && MAXMDIM >= 4
|
2019-09-28 14:16:49 +00:00
|
|
|
else if(uni == 'r' - 96) {
|
|
|
|
popScreenAll();
|
|
|
|
resetModes();
|
|
|
|
stop_game();
|
|
|
|
switch_game_mode(rg::racing);
|
|
|
|
racing::track_code = "OFFICIAL";
|
|
|
|
specialland = racing::race_lands[rand() % isize(racing::race_lands)];
|
|
|
|
start_game();
|
|
|
|
pmodel = mdBand;
|
2020-04-16 22:53:58 +00:00
|
|
|
pconf.model_orientation = racing::race_angle;
|
2019-09-28 14:16:49 +00:00
|
|
|
racing::race_advance = 1;
|
|
|
|
vid.yshift = 0;
|
2020-04-16 22:53:58 +00:00
|
|
|
pconf.camera_angle = 0;
|
|
|
|
pconf.xposition = 0;
|
|
|
|
pconf.yposition = 0;
|
|
|
|
pconf.scale = 1;
|
2019-09-28 14:16:49 +00:00
|
|
|
vid.use_smart_range = 1;
|
|
|
|
vid.smart_range_detail = 3;
|
|
|
|
}
|
2021-02-06 01:55:51 +00:00
|
|
|
else if(uni == 't' - 96)
|
|
|
|
racing::start_thurston();
|
2019-09-28 19:59:10 +00:00
|
|
|
#endif
|
2017-08-06 12:50:16 +00:00
|
|
|
#if CAP_TOUR
|
|
|
|
else if(uni == 't') {
|
|
|
|
popScreenAll();
|
2017-12-03 18:51:45 +00:00
|
|
|
resetModes('c');
|
2017-08-06 12:50:16 +00:00
|
|
|
tour::start();
|
|
|
|
}
|
|
|
|
#endif
|
2018-05-26 23:06:54 +00:00
|
|
|
#if CAP_DAILY
|
|
|
|
else if(uni == 'z') {
|
|
|
|
popScreenAll();
|
|
|
|
pushScreen(daily::showMenu);
|
|
|
|
}
|
2017-08-06 12:50:16 +00:00
|
|
|
#endif
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(uni == 'm') {
|
2017-08-06 12:50:16 +00:00
|
|
|
popScreen();
|
|
|
|
pushScreen(showMainMenu);
|
|
|
|
}
|
|
|
|
else if(sym == SDLK_F10)
|
|
|
|
quitmainloop = true;
|
|
|
|
else if(sym == SDLK_F1)
|
2018-01-06 22:41:28 +00:00
|
|
|
gotoHelp("@");
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(sym == SDLK_ESCAPE || uni == ' ') {
|
2017-08-06 12:50:16 +00:00
|
|
|
popScreen();
|
2017-10-09 08:51:16 +00:00
|
|
|
timerstart = time(NULL);
|
|
|
|
stampbase = ticks;
|
|
|
|
clearMessages();
|
|
|
|
welcomeMessage();
|
|
|
|
}
|
2019-09-28 14:15:58 +00:00
|
|
|
else if(sym == SDLK_F5) {
|
|
|
|
#if CAP_STARTANIM
|
|
|
|
startanims::pick();
|
|
|
|
#endif
|
|
|
|
daily_mode = 0;
|
|
|
|
}
|
2017-08-06 12:50:16 +00:00
|
|
|
};
|
|
|
|
}
|
2017-07-12 16:03:53 +00:00
|
|
|
|
|
|
|
// -- overview --
|
2017-07-10 18:47:38 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
#if HDR
|
2020-04-12 00:44:10 +00:00
|
|
|
struct named_functionality {
|
|
|
|
std::string first;
|
|
|
|
reaction_t second;
|
|
|
|
explicit named_functionality() = default;
|
|
|
|
explicit named_functionality(std::string s, reaction_t r) : first(std::move(s)), second(std::move(r)) {}
|
|
|
|
friend bool operator==(const named_functionality& a, const named_functionality& b) { return a.first == b.first; }
|
|
|
|
friend bool operator!=(const named_functionality& a, const named_functionality& b) { return a.first != b.first; }
|
|
|
|
};
|
2019-08-09 19:00:52 +00:00
|
|
|
inline named_functionality named_dialog(string x, reaction_t dialog) { return named_functionality(x, [dialog] () { pushScreen(dialog); }); }
|
|
|
|
#endif
|
|
|
|
|
2020-05-15 13:53:29 +00:00
|
|
|
#if HDR
|
|
|
|
using o_funcs = vector<named_functionality>;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
EX hookset<void(o_funcs&)> hooks_o_key;
|
2018-11-17 18:24:02 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX named_functionality get_o_key() {
|
2020-05-15 13:53:29 +00:00
|
|
|
vector<named_functionality> res;
|
|
|
|
callhooks(hooks_o_key, res);
|
|
|
|
|
|
|
|
if(in_full_game())
|
|
|
|
res.push_back(named_dialog(XLAT("world overview"), showOverview));
|
2018-11-17 18:24:02 +00:00
|
|
|
|
2018-05-15 21:26:04 +00:00
|
|
|
#if CAP_DAILY
|
2018-11-17 18:24:02 +00:00
|
|
|
if(daily::on)
|
2020-05-15 13:53:29 +00:00
|
|
|
res.push_back(named_functionality(XLAT("Strange Challenge"), [] () {
|
2018-11-17 18:24:02 +00:00
|
|
|
achievement_final(false);
|
|
|
|
pushScreen(daily::showMenu);
|
2020-05-15 13:53:29 +00:00
|
|
|
}));
|
2018-05-15 21:26:04 +00:00
|
|
|
#endif
|
2018-11-17 18:24:02 +00:00
|
|
|
|
|
|
|
if(viewdists)
|
2020-05-15 13:53:29 +00:00
|
|
|
res.push_back(named_functionality(XLAT("experiment with geometry"), runGeometryExperiments));
|
2018-11-17 18:24:02 +00:00
|
|
|
|
|
|
|
if(tactic::on)
|
2020-05-15 13:53:29 +00:00
|
|
|
res.push_back(named_dialog(XLAT("Pure Tactics mode"), tactic::showMenu));
|
2018-11-17 18:24:02 +00:00
|
|
|
|
|
|
|
if(yendor::on)
|
2020-05-15 13:53:29 +00:00
|
|
|
res.push_back(named_dialog(XLAT("Yendor Challenge"), yendor::showMenu));
|
2018-11-17 18:24:02 +00:00
|
|
|
|
|
|
|
if(peace::on)
|
2020-07-29 21:01:15 +00:00
|
|
|
res.push_back(named_dialog(XLAT("puzzles and exploration"), peace::showMenu));
|
2020-05-31 01:28:49 +00:00
|
|
|
|
2020-05-31 16:04:43 +00:00
|
|
|
#if CAP_TEXTURE
|
2020-05-31 01:28:49 +00:00
|
|
|
if(texture::config.tstate)
|
|
|
|
res.push_back(named_dialog(XLAT("texture mode"), texture::showMenu));
|
2020-05-31 16:04:43 +00:00
|
|
|
#endif
|
2018-11-17 18:24:02 +00:00
|
|
|
|
2018-12-04 01:40:27 +00:00
|
|
|
dialog::infix = "";
|
|
|
|
|
2020-05-15 13:53:29 +00:00
|
|
|
if((geometry != gNormal || NONSTDVAR) && !daily::on)
|
|
|
|
res.push_back(named_functionality(XLAT("experiment with geometry"), runGeometryExperiments));
|
2018-12-04 01:40:27 +00:00
|
|
|
|
2020-05-15 13:53:29 +00:00
|
|
|
if(res.empty()) return named_dialog(XLAT("world overview"), showOverview);
|
|
|
|
|
|
|
|
if(isize(res) == 1) return res[0];
|
|
|
|
|
|
|
|
return named_dialog(res[0].first + "/...", [res] {
|
2021-03-06 10:00:45 +00:00
|
|
|
emptyscreen();
|
2020-05-15 13:53:29 +00:00
|
|
|
dialog::init();
|
|
|
|
char id = 'o';
|
|
|
|
for(auto& r: res) {
|
|
|
|
dialog::addItem(r.first, id++);
|
|
|
|
dialog::add_action([r] { popScreen(); r.second(); });
|
|
|
|
}
|
|
|
|
dialog::display();
|
|
|
|
});
|
2017-07-10 18:47:38 +00:00
|
|
|
}
|
|
|
|
|
2019-09-06 06:17:02 +00:00
|
|
|
EX int messagelogpos;
|
|
|
|
EX int timeformat;
|
2019-08-10 08:57:14 +00:00
|
|
|
EX int stampbase;
|
2017-10-09 08:51:16 +00:00
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX string gettimestamp(msginfo& m) {
|
2017-10-09 08:51:16 +00:00
|
|
|
char buf[128];
|
|
|
|
switch(timeformat) {
|
|
|
|
case 0:
|
|
|
|
return its(m.turnstamp);
|
|
|
|
case 1:
|
|
|
|
strftime(buf, 128, "%H:%M:%S", localtime(&m.rtstamp));
|
|
|
|
return buf;
|
|
|
|
case 2:
|
|
|
|
snprintf(buf, 128, "%2d:%02d", m.gtstamp/60, m.gtstamp % 60);
|
|
|
|
return buf;
|
|
|
|
case 3:
|
|
|
|
{ int t = m.stamp - stampbase;
|
|
|
|
bool sign = t < 0;
|
|
|
|
if(sign) t = -t;
|
|
|
|
snprintf(buf, 128, "%2d:%02d.%03d", t/60000, (t/1000) % 60, t % 1000);
|
|
|
|
string s = buf;
|
|
|
|
if(sign) s = "-"+s;
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2019-08-09 19:00:52 +00:00
|
|
|
EX void showMessageLog() {
|
2019-05-12 23:57:40 +00:00
|
|
|
DEBBI(DF_GRAPH, ("show message log"));
|
2017-10-09 08:51:16 +00:00
|
|
|
|
|
|
|
int lines = vid.yres / vid.fsize - 2;
|
2018-06-22 12:47:24 +00:00
|
|
|
int maxpos = isize(gamelog) - lines;
|
2017-10-09 08:51:16 +00:00
|
|
|
messagelogpos = min(messagelogpos, maxpos);
|
|
|
|
messagelogpos = max(messagelogpos, 0);
|
|
|
|
|
2018-06-22 12:47:24 +00:00
|
|
|
for(int y=0; y<lines && messagelogpos+y < isize(gamelog); y++) {
|
2017-10-09 08:51:16 +00:00
|
|
|
msginfo& m = gamelog[messagelogpos+y];
|
|
|
|
displaystr(vid.fsize*8, vid.fsize*(y+1), 0, vid.fsize, fullmsg(m), 0xC0C0C0, 0);
|
|
|
|
displaystr(vid.fsize*7, vid.fsize*(y+1), 0, vid.fsize, gettimestamp(m), 0xC0C0C0, 16);
|
|
|
|
}
|
|
|
|
|
|
|
|
int i0 = vid.yres - vid.fsize;
|
|
|
|
int xr = vid.xres / 80;
|
|
|
|
|
|
|
|
string timeformats[5] = {"turns", "real time", "game time", "precise", "no time"};
|
|
|
|
|
2018-06-12 22:00:01 +00:00
|
|
|
displayButton(xr*70, i0, IFM(dialog::keyname(SDLK_ESCAPE) + " - ") + XLAT("go back"), SDLK_ESCAPE, 8);
|
|
|
|
displayButton(xr*10, i0, IFM("c - ") + XLAT("clear"), 'c', 8);
|
|
|
|
displayButton(xr*40, i0, IFM("t - ") + XLAT(timeformats[timeformat]), 't', 8);
|
2017-10-09 08:51:16 +00:00
|
|
|
|
2018-05-07 18:14:14 +00:00
|
|
|
keyhandler = [lines] (int sym, int uni) {
|
2017-10-09 08:51:16 +00:00
|
|
|
if(uni == PSEUDOKEY_WHEELDOWN) messagelogpos++;
|
|
|
|
else if(uni == PSEUDOKEY_WHEELUP) messagelogpos--;
|
2018-12-06 11:31:51 +00:00
|
|
|
else if(DKEY == SDLK_DOWN) messagelogpos++;
|
|
|
|
else if(DKEY == SDLK_UP) messagelogpos--;
|
|
|
|
else if(DKEY == SDLK_PAGEUP) messagelogpos -= lines;
|
|
|
|
else if(DKEY == SDLK_PAGEDOWN) messagelogpos -= lines;
|
2017-10-09 08:51:16 +00:00
|
|
|
else if(uni == 'c') gamelog.clear();
|
|
|
|
else if(uni == 't') { timeformat++; timeformat %= 5; }
|
|
|
|
else if(doexiton(sym, uni)) popScreen();
|
|
|
|
};
|
|
|
|
}
|
2018-11-11 10:06:32 +00:00
|
|
|
|
|
|
|
#if CAP_COMMANDLINE
|
|
|
|
|
|
|
|
int read_menu_args() {
|
|
|
|
using namespace arg;
|
|
|
|
|
|
|
|
if(argis("-d:over")) {
|
|
|
|
PHASEFROM(2); launch_dialog(showOverview);
|
|
|
|
}
|
|
|
|
else if(argis("-d:main")) {
|
|
|
|
PHASEFROM(2); launch_dialog(showMainMenu);
|
|
|
|
}
|
|
|
|
else if(argis("-d:mode")) {
|
|
|
|
PHASEFROM(2); launch_dialog(showChangeMode);
|
|
|
|
}
|
|
|
|
else if(argis("-d:shmup")) {
|
2019-08-09 21:08:42 +00:00
|
|
|
PHASEFROM(2); launch_dialog(); multi::configure();
|
2018-11-11 10:06:32 +00:00
|
|
|
}
|
|
|
|
else return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto ah_menu = addHook(hooks_args, 0, read_menu_args);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2018-06-10 23:58:31 +00:00
|
|
|
}
|