1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 06:27:17 +00:00

made background screen darkening consistent and optional

This commit is contained in:
Zeno Rogue 2022-07-05 11:51:06 +02:00
parent b3a394c266
commit 75f58766a2
39 changed files with 170 additions and 129 deletions

View File

@ -936,7 +936,7 @@ string primes(int i) {
void connection_debugger() {
cmode = sm::SIDE | sm::DIALOG_STRICT_X;
gamescreen(0);
gamescreen();
auto& last = debug_polys.back();
@ -1331,7 +1331,7 @@ EX void sliders_changed(bool need_restart, bool need_start) {
EX void set_sliders() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("tessellation sliders"));
dialog::addHelp(current.comment);
char ch = 'A';

View File

@ -1323,7 +1323,7 @@ EX void show() {
}
}
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("Archimedean tilings"));
if(symbol_editing) {

View File

@ -226,7 +226,7 @@ EX void prepare_config() {
EX void show_config() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("Solv quotient spaces"));
dialog::addSelItem(XLAT("%1 period", "X/Y"), its(period_xy_edit), 'x');

View File

@ -738,6 +738,10 @@ EX void initConfig() {
param_enum(vid.graphglyph, "graphglyph", "graphical items/kills", 1)
-> editable({{"letters", ""}, {"auto", ""}, {"images", ""}}, "inventory/kill mode", 'd');
param_i(menu_darkening, "menu_darkening", 2)
-> editable(0, 8, 1, "menu map darkening", "A larger number means darker game map in the background. Set to 8 to disable the background.", 'd')
-> set_sets([] { dialog::bound_low(0); dialog::bound_up(8); dialog::dialogflags |= sm::DARKEN; });
addsaver(vid.flasheffects, "flasheffects", 1);
param_f(vid.binary_width, "bwidth", "binary-tiling-width", 1);
@ -1355,7 +1359,7 @@ EX void edit_sightrange() {
#if CAP_RUG
USING_NATIVE_GEOMETRY_IN_RUG;
#endif
gamescreen(0);
gamescreen();
dialog::init("sight range settings");
add_edit(vid.use_smart_range);
if(vid.use_smart_range)
@ -1476,7 +1480,7 @@ EX void menuitem_sightrange(char c IS('c')) {
EX void sets_sfx_volume() {
#if CAP_AUDIO
dialog::numberdark = dialog::DONT_SHOW;
dialog::dialogflags = sm::NOSCR;
#if ISANDROID
dialog::reaction = [] () {
settingsChanged = true;
@ -1489,7 +1493,7 @@ EX void sets_sfx_volume() {
EX void sets_music_volume() {
#if CAP_AUDIO
dialog::numberdark = dialog::DONT_SHOW;
dialog::dialogflags = sm::NOSCR;
dialog::reaction = [] () {
#if CAP_SDLAUDIO
Mix_VolumeMusic(musicvolume);
@ -1510,7 +1514,7 @@ EX void sets_music_volume() {
EX void showSpecialEffects() {
cmode = vid.xres > vid.yres * 1.4 ? sm::SIDE : sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("extra graphical effects"));
dialog::addBoolItem_action(XLAT("particles on attack"), (vid.particles), 'p');
@ -1526,7 +1530,7 @@ EX void showSpecialEffects() {
EX void show_vector_settings() {
cmode = vid.xres > vid.yres * 1.4 ? sm::SIDE : sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("vector settings"));
dialog::addSelItem(XLAT("line width"), fts(vid.linewidth), 'w');
@ -1575,7 +1579,7 @@ EX void show_vector_settings() {
EX void showGraphConfig() {
cmode = vid.xres > vid.yres * 1.4 ? sm::SIDE : sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("graphics configuration"));
@ -1755,7 +1759,8 @@ EX void edit_whatever(char type, int index) {
}
EX void configureOther() {
gamescreen(3);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("other settings"));
@ -1793,7 +1798,8 @@ EX void configureOther() {
}
EX void configureInterface() {
gamescreen(3);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("interface"));
#if CAP_TRANS
@ -1838,6 +1844,8 @@ EX void configureInterface() {
dialog::add_action([] { dialog::openColorDialog(crosshair_color); });
};
});
add_edit(menu_darkening);
dialog::addBreak(50);
dialog::addBack();
@ -1847,7 +1855,8 @@ EX void configureInterface() {
#if CAP_SDLJOY
EX void showJoyConfig() {
gamescreen(4);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("joystick configuration"));
@ -2018,7 +2027,7 @@ bool supported_ods() {
EX void showStereo() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("stereo vision config"));
add_edit(vid.stereo_mode);
@ -2137,7 +2146,7 @@ EX void edit_levellines(char c) {
EX void show3D() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("3D configuration"));
if(GDIM == 2) {
@ -2479,7 +2488,8 @@ EX void showCustomizeChar() {
cc_footphase += hypot(mousex - lmousex, mousey - lmousey);
lmousex = mousex; lmousey = mousey;
gamescreen(4);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("Customize character"));
if(shmup::on || multi::players) multi::cpid = multi::cpid_edit % multi::players;
@ -2562,7 +2572,7 @@ EX void refresh_canvas() {
EX void edit_color_table(colortable& ct, const reaction_t& r IS(reaction_t()), bool has_bit IS(false)) {
cmode = sm::SIDE;
gamescreen(0);
gamescreen();
dialog::init(XLAT("colors & aura"));
for(int i=0; i<isize(ct); i++) {
@ -2587,7 +2597,7 @@ EX void edit_color_table(colortable& ct, const reaction_t& r IS(reaction_t()), b
EX void show_color_dialog() {
cmode = sm::SIDE | sm::DIALOG_STRICT_X;
getcstat = '-';
gamescreen(0);
gamescreen();
dialog::init(XLAT("colors & aura"));
dialog::addColorItem(XLAT("background"), backcolor << 8, 'b');
@ -2731,7 +2741,8 @@ EX void resetConfigMenu() {
#if CAP_TRANS
EX void selectLanguageScreen() {
gamescreen(4);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init("select language"); // intentionally not translated
int v = vid.language;
@ -2789,7 +2800,8 @@ EX void selectLanguageScreen() {
#endif
EX void configureMouse() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("mouse & touchscreen"));
dialog::addBoolItem_action(XLAT("reverse pointer control"), (vid.revcontrol), 'r');
@ -2869,7 +2881,8 @@ template<class T> void add_edit(T& val) {
#endif
EX void find_setting() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("find a setting"));
if(dialog::infix != "") mouseovers = dialog::infix;
@ -2903,7 +2916,8 @@ EX void find_setting() {
}
EX void edit_all_settings() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("recently changed settings"));
for(auto &fs: params) fs.second->check_change();
@ -2925,7 +2939,8 @@ void list_setting::show_edit_option(char key) {
dialog::addSelItem(XLAT(menu_item_name), XLAT(opt), key);
dialog::add_action_push([this] {
add_to_changed(this);
gamescreen(2);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT(menu_item_name));
dialog::addBreak(100);
int q = isize(options);
@ -2945,7 +2960,8 @@ void list_setting::show_edit_option(char key) {
}
EX void showSettings() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("settings"));
dialog::addItem(XLAT("interface"), 'i');

View File

@ -1405,7 +1405,7 @@ void delayed_reset() {
EX void show() {
#if CAP_ORIENTATION
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("scrolling by device rotation"));

View File

@ -1443,7 +1443,8 @@ string make_help() {
}
EX void crystal_knight_help() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init();
dialog::addHelp(XLAT(
@ -1467,7 +1468,7 @@ EX void crystal_knight_help() {
EX void show() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("dimensional crystal"));
for(int i=5; i<=14; i++) {
string s;

View File

@ -293,7 +293,7 @@ struct debugScreen {
void operator () () {
cmode = sm::SIDE | sm::DIALOG_STRICT_X;
gamescreen(0);
gamescreen();
getcstat = '-';
dialog::init(show_debug_data ? XLAT("debug values") : XLAT("internal details"));
@ -468,7 +468,8 @@ EX void push_debug_screen() {
/** show the cheat menu */
EX void showCheatMenu() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init("cheat menu");
for(auto& ch: cheats) {
dialog::addItem(XLAT(ch.desc), ch.key);

View File

@ -683,7 +683,7 @@ EX namespace dialog {
EX void drawColorDialog() {
cmode = sm::NUMBER | dialogflags;
if(cmode & sm::SIDE) gamescreen(0);
if(cmode & sm::SIDE) gamescreen();
else emptyscreen();
dcenter = vid.xres/2;
@ -827,8 +827,6 @@ EX namespace dialog {
};
}
EX int numberdark;
EX void formula_keyboard(bool lr) {
addKeyboardItem("1234567890");
addKeyboardItem("=+-*/^()\x3");
@ -891,9 +889,7 @@ EX namespace dialog {
EX void drawNumberDialog() {
cmode = sm::NUMBER | dialogflags;
if(numberdark < DONT_SHOW)
gamescreen(numberdark);
else emptyscreen();
gamescreen();
init(ne.title);
addInfo(ne.s);
if(ne.intval && ne.sc.direct == &identity_f)
@ -1057,7 +1053,6 @@ EX namespace dialog {
reaction = reaction_t();
reaction_final = reaction_t();
extra_options = reaction_t();
numberdark = 0;
ne.animatable = true;
#if CAP_ANIMATIONS
anims::get_parameter_animation(x, ne.s);
@ -1297,9 +1292,7 @@ EX namespace dialog {
EX void string_edit_dialog() {
cmode = sm::NUMBER | dialogflags;
if(numberdark < DONT_SHOW)
gamescreen(numberdark);
else emptyscreen();
gamescreen();
init(ne.title);
addInfo(view_edited_string());
addBreak(100);
@ -1336,11 +1329,11 @@ EX namespace dialog {
pushScreen(string_edit_dialog);
reaction = reaction_t();
extra_options = reaction_t();
numberdark = 0;
}
EX void confirm_dialog(const string& text, const reaction_t& act) {
gamescreen(1);
cmode = sm::DARKEN;
gamescreen();
dialog::addBreak(250);
dialog::init(XLAT("WARNING"), 0xFF0000, 150, 100);
dialog::addHelp(text);

View File

@ -882,7 +882,7 @@ EX namespace euc {
auto& T_edit = eu_edit.user_axes;
auto& twisted_edit = eu_edit.twisted;
cmode = sm::SIDE | sm::MAYDARK | sm::TORUSCONFIG;
gamescreen(1);
gamescreen();
dialog::init(XLAT("Euclidean quotient spaces"));
for(int y=0; y<dim+1; y++)

View File

@ -631,7 +631,7 @@ void celldrawer::do_viewdist() {
EX void viewdist_configure_dialog() {
dialog::init("");
cmode |= sm::SIDE | sm::MAYDARK | sm::EXPANSION;
gamescreen(0);
gamescreen();
dialog::addSelItem(XLAT("which distance"), XLAT(dfnames[distance_from]), 'c');
dialog::add_action([] () { distance_from = mod_allowed() ? eDistanceFrom((distance_from + 1) % 3) : eDistanceFrom(2 - distance_from); });

View File

@ -40,7 +40,8 @@ string euchelp =
#if CAP_FIELD
void showQuotientConfig() {
using namespace fieldpattern;
gamescreen(2);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("field quotient"));
fgeomextra& gxcur = fgeomextras[current_extra];
for(int i=0; i<isize(fgeomextras); i++) {
@ -102,7 +103,8 @@ void showQuotientConfig() {
auto& cfp = currfp;
auto triplets = cfp.find_triplets();
pushScreen([triplets] {
gamescreen(2);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("alternate manifolds"));
int id = 0;
for(auto t: triplets) {
@ -153,7 +155,7 @@ string validclasses[4] = {" (X)", " (½)", "", " (!)"};
EX void ge_land_selection() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
if(cheater) for(int i=0; i<landtypes; i++) landvisited[i] = true;
@ -275,7 +277,7 @@ EX vector<geometry_filter*> available_filters = { &gf_hyperbolic, &gf_spherical,
void ge_select_filter() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(2);
gamescreen();
dialog::init(XLAT("geometries"));
@ -365,7 +367,7 @@ bool same_tiling(eGeometry g2) {
void ge_select_tiling() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
if(!current_filter) { popScreen(); return; }
dialog::init();
@ -447,7 +449,8 @@ EX string dim_name() {
EX void showQuotientConfig3() {
using namespace fieldpattern;
gamescreen(2);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("field quotient"));
auto& ds = discoveries[cginf.tiling_name];
@ -546,7 +549,7 @@ EX string geometry_name() {
EX void select_quotient_screen() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("quotient spaces in ") + ginf[geometry].tiling_name);
char key = 'a';
@ -932,7 +935,7 @@ EX void showEuclideanMenu() {
// for(int i=2; i<lt; i++) landvisited[i] = true;
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("experiment with geometry"));

View File

@ -806,7 +806,7 @@ EX namespace gp {
void show() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("variations"));
int min_quality_chess = 0;

View File

@ -5323,14 +5323,21 @@ extern bool wclick;
EX bool just_refreshing;
EX void gamescreen(int _darken) {
EX int menu_darkening = 2;
EX void gamescreen() {
if(cmode & sm::NOSCR) {
emptyscreen();
return;
}
if(just_refreshing) return;
if(subscreens::split([=] () {
calcparam();
compute_graphical_distance();
gamescreen(_darken);
gamescreen();
})) {
if(racing::on) return;
// create the gmatrix
@ -5348,7 +5355,7 @@ EX void gamescreen(int _darken) {
if(dual::split([=] () {
vid.xres = gx;
vid.yres = gy;
dual::in_subscreen([=] () { gamescreen(_darken); });
dual::in_subscreen([=] () { gamescreen(); });
})) {
calcparam();
return;
@ -5356,13 +5363,21 @@ EX void gamescreen(int _darken) {
calcparam();
if((cmode & sm::MAYDARK) && !current_display->sidescreen && !inHighQual) {
_darken += 2;
darken = 0;
if(!inHighQual && !vrhr::active()) {
if((cmode & sm::MAYDARK) && !current_display->sidescreen)
darken += menu_darkening;
else if(cmode & sm::DARKEN)
darken += menu_darkening;
}
if(vid.highlightmode == (hiliteclick ? 0 : 2))
darken++;
if(darken >= 8) {
emptyscreen();
return;
}
darken = _darken;
if(vrhr::active()) darken = 0;
if(history::includeHistory) history::restore();
anims::apply();
@ -5434,7 +5449,7 @@ EX void normalscreen() {
if(GDIM == 3 || !outofmap(mouseh.h)) getcstat = '-';
cmode = sm::NORMAL | sm::DOTOUR | sm::CENTER;
if(viewdists && show_distance_lists) cmode |= sm::SIDE | sm::MAYDARK;
gamescreen((vid.highlightmode == (hiliteclick ? 0 : 2)) ? 1 : 0); drawStats();
gamescreen(); drawStats();
if(nomenukey || ISMOBILE)
;
#if CAP_TOUR
@ -5491,6 +5506,8 @@ namespace sm {
static const int VR_MENU = (1<<18); // always show the menu in VR
static const int SHOWCURSOR = (1<<19); // despite MAP/DRAW always show the cursor, no panning
static const int PANNING = (1<<20); // smooth scrolling works
static const int DARKEN = (1<<21); // darken the game background
static const int NOSCR = (1<<22); // do not show the game background
}
#endif

View File

@ -1072,14 +1072,14 @@ EX void describeMouseover() {
}
EX void showHelp() {
cmode = sm::HELP | sm::DOTOUR;
cmode = sm::HELP | sm::DOTOUR | sm::DARKEN;
getcstat = SDLK_ESCAPE;
if(help == "HELPFUN") {
help_delegate();
return;
}
gamescreen(2);
gamescreen();
string help2;
if(help[0] == '@') {
int iv = help.find("\t");

View File

@ -190,7 +190,7 @@ EX namespace history {
int lastprogress;
EX void progress_screen() {
gamescreen(0);
gamescreen();
mouseovers = "";
}
@ -570,7 +570,7 @@ EX namespace history {
EX void history_menu() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("history mode"));

View File

@ -136,7 +136,8 @@ void toggleanim(bool v) {
}
void showDemo() {
gamescreen(2);
cmode = sm::DARKEN;
gamescreen();
getcstat = ' ';

View File

@ -644,7 +644,8 @@ void erase_unconnected(cellwalker cw) {
int edit_spin;
EX void show_portals() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("manage portals"));

View File

@ -490,10 +490,10 @@ EX namespace inv {
if(remaining[itOrbSword]) items[itOrbSword]++;
if(remaining[itOrbSword2]) items[itOrbSword2]++;
gamescreen(2);
cmode = sm::CENTER | sm::DARKEN;
gamescreen();
if(remaining[itOrbSword]) items[itOrbSword]--;
if(remaining[itOrbSword2]) items[itOrbSword2]--;
cmode = sm::CENTER;
orbcoord.clear();
for(int y=-3; y<=3; y++) for(int x=-5; x<=5; x++) if(x+y<=6 && x+y >= -6 && (x||y))

View File

@ -868,7 +868,7 @@ bool too_small_euclidean() {
void show_gridmaker() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("irregular grid"));
dialog::addSelItem(XLAT("density"), fts(density), 'd');
dialog::add_action([] {

View File

@ -1361,7 +1361,7 @@ EX namespace mapeditor {
EX void showMapEditor() {
cmode = sm::MAP | sm::PANNING;
gamescreen(0);
gamescreen();
int fs = editor_fsize();
@ -2042,7 +2042,7 @@ EX namespace mapeditor {
EX void showDrawEditor() {
#if CAP_POLY
cmode = sm::DRAW | sm::PANNING;
gamescreen(0);
gamescreen();
drawGrid();
if(callhandlers(false, hooks_prestats)) return;
@ -3159,7 +3159,7 @@ EX namespace mapeditor {
EX void map_settings() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("Map settings"));

View File

@ -221,7 +221,7 @@ EX const char *hlmodes[3] = {"press Alt", "highlight", "super-highlight"};
EX void showGraphQuickKeys() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("quick options"));
@ -309,7 +309,7 @@ EX void switch_casual() {
EX void showCreative() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(3);
gamescreen();
dialog::init(XLAT("creative mode"));
#if CAP_EDIT
@ -382,7 +382,8 @@ EX void showCreative() {
}
EX void show_chaos() {
gamescreen(3);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("land structure"));
chaosUnlocked = chaosUnlocked || autocheat;
@ -439,7 +440,8 @@ EX void show_chaos() {
}
EX void mode_higlights() {
gamescreen(3);
cmode = sm::NOSCR;
gamescreen();
dialog::init(XLAT("highlights & achievements"));
dialog::addBigItem(XLATN("Space Rocks"), 'r');
@ -623,7 +625,8 @@ EX void menuitem_land_structure(char key) {
}
EX void showChangeMode() {
gamescreen(3);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("special modes"));
dialog::addBoolItem(XLAT("experiment with geometry"), geometry || CHANGED_VARIATION || viewdists, 'e');
@ -752,6 +755,7 @@ EX void showStartMenu() {
getcstat = ' ';
#if CAP_STARTANIM
cmode = sm::DARKEN;
startanims::display();
#endif

View File

@ -361,7 +361,7 @@ EX namespace models {
EX void model_list() {
cmode = sm::SIDE | sm::MAYDARK | sm::CENTER;
gamescreen(0);
gamescreen();
dialog::init(XLAT("models & projections"));
#if CAP_RUG
USING_NATIVE_GEOMETRY_IN_RUG;
@ -417,7 +417,7 @@ EX namespace models {
EX void model_menu() {
cmode = sm::SIDE | sm::MAYDARK | sm::CENTER;
gamescreen(0);
gamescreen();
#if CAP_RUG
USING_NATIVE_GEOMETRY_IN_RUG;
#endif
@ -704,8 +704,8 @@ EX namespace models {
}
EX void quick_model() {
cmode = sm::CENTER;
gamescreen(1);
cmode = sm::CENTER | sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init("models & projections");
if(GDIM == 2 && !euclid) {

View File

@ -393,8 +393,8 @@ struct shmup_configurer {
void operator()() {
#if CAP_SDL
cmode = sm::SHMUPCONFIG;
gamescreen(3);
cmode = sm::SHMUPCONFIG | sm::SIDE | sm::DARKEN;
gamescreen();
dialog::init(XLAT("keyboard & joysticks"));
bool haveconfig = shmup::on || players > 1 || multi::alwaysuse;
@ -503,7 +503,8 @@ EX void configure() {
}
EX void showConfigureMultiplayer() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init("multiplayer");
for(int i=1; i <= MAXPLAYER; i++) {

View File

@ -699,7 +699,7 @@ EX namespace netgen {
void show() {
cmode = sm::SIDE;
gamescreen(0);
gamescreen();
if(true) {
initquickqueue();
for(int i=0; i<CELLS; i++) {

View File

@ -1000,7 +1000,7 @@ EX void prepare_niltorus3() {
EX void show_niltorus3() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("Nil quotient spaces"));
for(int a=0; a<3; a++) {
string title = XLAT("%1 period", s0+char('X'+a));
@ -1662,7 +1662,7 @@ EX namespace product {
EX void show_config() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("quotient product spaces"));
dialog::addSelItem(XLAT("%1 period", "Z"), its(hybrid::csteps), 'z');
dialog::add_action(hybrid::configure_period);

View File

@ -1969,7 +1969,7 @@ EX namespace patterns {
void showPrePatternP(bool instant) {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init("predesigned patterns");
dialog::addItem(WDIM == 3 ? XLAT("empty") : XLAT("single color"), 'g');
@ -2178,7 +2178,7 @@ EX namespace patterns {
cmode = sm::SIDE | sm::MAYDARK;
{
dynamicval<bool> dc(displaycodes, whichPattern);
gamescreen(0);
gamescreen();
}
dialog::init();
@ -2466,7 +2466,7 @@ EX namespace patterns {
cmode = sm::SIDE | sm::MAYDARK;
{
dynamicval<bool> dc(displaycodes, true);
gamescreen(0);
gamescreen();
}
dialog::init();
for(int i=0; i<isize(cpatterns); i++) {
@ -2986,7 +2986,7 @@ EX namespace linepatterns {
EX void showMenu() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("line patterns"));

View File

@ -1291,7 +1291,8 @@ EX bool warningprotection(const string& s) {
if(items[itWarning]) return false;
warning_shown = true;
pushScreen([s] () {
gamescreen(1);
cmode = sm::DARKEN;
gamescreen();
dialog::addBreak(250);
dialog::init(XLAT("WARNING"), 0xFF0000, 150, 100);
dialog::addBreak(500);

View File

@ -315,8 +315,8 @@ eLand nextHyperstone() {
EX void showGameMenu() {
cmode = sm::DOTOUR | sm::MISSION | sm::CENTER;
gamescreen(1); drawStats();
cmode = sm::DOTOUR | sm::MISSION | sm::CENTER | sm::MAYDARK | sm::SIDE;
gamescreen(); drawStats();
getcstat = SDLK_ESCAPE;
dialog::init(

View File

@ -918,8 +918,8 @@ EX void load_official_track() {
}
void track_chooser(bool official) {
cmode = 0;
gamescreen(2);
cmode = sm::NOSCR;
gamescreen();
dialog::init(XLAT(official ? "Official tracks" : "Generate a racing track"));
map<char, eLand> landmap;
@ -959,7 +959,7 @@ void track_chooser(bool official) {
void race_projection() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("racing projections"));
@ -1065,7 +1065,8 @@ void race_projection() {
#if MAXMDIM >= 4
EX void thurston_racing() {
gamescreen(1);
cmode = sm::NOSCR;
gamescreen();
dialog::init(XLAT("racing in Thurston geometries"));
dialog::addBreak(100);
@ -1119,7 +1120,8 @@ void race_projection() {
void raceconfigurer() {
gamescreen(1);
cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init(XLAT("Racing"));

View File

@ -2745,7 +2745,7 @@ EX void random_fog() {
EX void menu() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("volumetric raycasting"));
if(!cheater) {
@ -2797,7 +2797,7 @@ EX }
EX void configure() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("raycasting configuration"));
dialog::addBoolItem(XLAT("available in current geometry"), available(), 0);

View File

@ -2507,7 +2507,7 @@ int target_subcube_count;
EX void edit_variation() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("variations"));
dialog::addBoolItem(XLAT("pure"), target_variation == eVariation::pure, 'p');

View File

@ -1511,7 +1511,7 @@ ld old_distance;
EX void rug_geometry_choice() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("hypersian rug mode"), iinf[itPalace].color, 150, 100);
USING_NATIVE_GEOMETRY;
@ -1540,7 +1540,7 @@ EX void rug_geometry_choice() {
EX void show() {
cmode = sm::SIDE | sm::MAYDARK | sm::PANNING;
gamescreen(0);
gamescreen();
dialog::init(XLAT("hypersian rug mode"), iinf[itPalace].color, 150, 100);
dialog::addBoolItem(XLAT("enable the Hypersian Rug mode"), rug::rugged, 'u');

View File

@ -2437,7 +2437,7 @@ EX void verify_parsed_treestates(arb::arbi_tiling& c) {
EX void show() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("strict tree maps"));
dialog::addHelp(XLAT(

View File

@ -231,7 +231,7 @@ EX void memory_for_lib() {
}
EX void show_memory_menu() {
gamescreen(0);
gamescreen();
dialog::init(XLAT("memory"));
dialog::addHelp(XLAT(

View File

@ -670,7 +670,7 @@ EX int shot_aa = 1;
EX void default_screenshot_content() {
gamescreen(0);
gamescreen();
if(caption != "")
displayfr(vid.xres/2, vid.fsize+vid.fsize/4, 3, vid.fsize*2, caption, forecolor, 8);
@ -934,7 +934,7 @@ EX string format_extension() {
EX void choose_screenshot_format() {
cmode = sm::SIDE;
gamescreen(0);
gamescreen();
dialog::init(XLAT("screenshots"), iinf[itPalace].color, 150, 100);
#if CAP_PNG
dialog::addItem(XLAT("PNG"), 'p');
@ -954,7 +954,7 @@ EX void choose_screenshot_format() {
EX void menu() {
cmode = sm::SIDE;
gamescreen(0);
gamescreen();
if(format == screenshot_format::svg && !CAP_SVG)
format = screenshot_format::png;
if(format == screenshot_format::png && !CAP_PNG)
@ -1530,7 +1530,7 @@ EX void rug_angle_options() {
EX void show() {
cmode = sm::SIDE; needs_highqual = false;
animation_lcm = 1;
gamescreen(0);
gamescreen();
animation_period = 2 * M_PI * animation_lcm / animation_factor;
dialog::init(XLAT("animations"), iinf[itPalace].color, 150, 100);
dialog::addSelItem(XLAT("period"), fts(period)+ " ms", 'p');
@ -1905,7 +1905,7 @@ void explorable(reaction_t ee) {
void no_init() { }
startanim null_animation { "", no_init, [] { gamescreen(2); }};
startanim null_animation { "", no_init, [] { gamescreen(); }};
#if CAP_STARTANIM
startanim joukowsky { "Joukowsky transform", no_init, [] {
@ -1915,7 +1915,7 @@ startanim joukowsky { "Joukowsky transform", no_init, [] {
dynamicval<ld> ds(pconf.scale, 1/4.);
models::configure();
dynamicval<color_t> dc(ringcolor, 0);
gamescreen(2);
gamescreen();
explorable([] { pmodel = mdJoukowskyInverted; pushScreen(models::model_menu); });
}};
@ -1924,7 +1924,7 @@ startanim bandspin { "spinning in the band model", no_init, [] {
dynamicval<ld> dt(pconf.model_orientation, ticks / 25.);
dynamicval<int> dv(vid.use_smart_range, 2);
models::configure();
gamescreen(2);
gamescreen();
explorable([] { pmodel = mdJoukowskyInverted; pushScreen(models::model_menu); });
}};
@ -1937,7 +1937,7 @@ startanim perspective { "projection distance", no_init, [] {
dynamicval<ld> da(pconf.alpha, x);
dynamicval<ld> ds(pconf.scale, (1+x)/2);
calcparam();
gamescreen(2);
gamescreen();
explorable(projectionDialog);
}};
@ -1953,7 +1953,7 @@ startanim rug { "Hypersian Rug", [] {
dynamicval<bool> b(rug::rugged, true);
rug::physics();
dynamicval<transmatrix> t(rug::rugView, cspin(1, 2, ticks / 3000.) * rug::rugView);
gamescreen(2);
gamescreen();
if(!rug::rugged) current = &null_animation;
explorable([] { rug::rugged = true; pushScreen(rug::show); });
#endif
@ -1965,7 +1965,7 @@ startanim spin_around { "spinning around", no_init, [] {
ld alpha = 2 * M_PI * ticks / 10000.;
ld circle_radius = acosh(2.);
dynamicval<transmatrix> dv(View, spin(-cos_auto(circle_radius)*alpha) * xpush(circle_radius) * spin(alpha) * View);
gamescreen(2);
gamescreen();
}};
#endif
@ -1995,7 +1995,7 @@ startanim row_of_ghosts { "row of ghosts", no_init, [] {
}
});
dynamicval<bool> rd(mapeditor::drawplayer, false);
gamescreen(2);
gamescreen();
}};
startanim army_of_ghosts { "army of ghosts", no_init, [] {
@ -2020,7 +2020,7 @@ startanim army_of_ghosts { "army of ghosts", no_init, [] {
}
}
});
gamescreen(2);
gamescreen();
}};
startanim ghost_spiral { "ghost spiral", no_init, [] {
@ -2030,7 +2030,7 @@ startanim ghost_spiral { "ghost spiral", no_init, [] {
draw_ghost(spin(t * i * 2 * M_PI) * xpush(asinh(15. / i)) * spin(M_PI/2), 1);
}
});
gamescreen(2);
gamescreen();
}};
startanim fib_ghosts { "Fibonacci ghosts", no_init, [] {
@ -2047,14 +2047,14 @@ startanim fib_ghosts { "Fibonacci ghosts", no_init, [] {
draw_ghost(T, i);
}
});
gamescreen(2);
gamescreen();
}};
startanim fpp { "first-person perspective", no_init, [] {
if(MAXMDIM == 3) { current = &null_animation; return; }
geom3::switch_fpp();
View = cspin(0, 2, ticks / 5000.) * View;
gamescreen(2);
gamescreen();
View = cspin(0, 2, -ticks / 5000.) * View;
geom3::switch_fpp();
}};
@ -2066,7 +2066,7 @@ startanim fpp { "first-person perspective", no_init, [] {
EX startanim *current = &null_animation;
EX void pick() {
if(((gold() > 0 || tkills() > 0) && canmove) || geometry != gNormal || ISWEB || ISMOBILE || vid.always3 || pmodel || rug::rugged || vid.wallmode < 2 || vid.monmode < 2 || glhr::noshaders || !vid.usingGL) {
if(((gold() > 0 || tkills() > 0) && canmove) || geometry != gNormal || ISWEB || ISMOBILE || vid.always3 || pmodel || rug::rugged || vid.wallmode < 2 || vid.monmode < 2 || glhr::noshaders || !vid.usingGL || !enabled) {
current = &null_animation;
return;
}

View File

@ -676,7 +676,7 @@ transmatrix coverage_matrix;
EX void show_surfaces() {
cmode = sm::SIDE;
gamescreen(0);
gamescreen();
dialog::init(XLAT("constant curvature surfaces"), iinf[itPalace].color, 150, 0);
bool b = rug::rugged || coverage_style;

View File

@ -1168,7 +1168,7 @@ bool texture_config::load() {
void showMagicMenu() {
cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X;
gamescreen(0);
gamescreen();
dialog::init(XLAT("texture auto-adjustment"));
@ -1270,7 +1270,7 @@ EX void start_editor() {
EX void showMenu() {
cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X;
gamescreen(0);
gamescreen();
if(config.tstate == tsAdjusting) {
ptds.clear();
config.mark_triangles();

4
vr.cpp
View File

@ -1153,7 +1153,7 @@ EX void render() {
EX void show_vr_demos() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("VR demos"));
dialog::addInfo(XLAT("warning: these will restart your game!"));
@ -1325,7 +1325,7 @@ EX void reference_button() {
EX void show_vr_settings() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
gamescreen();
dialog::init(XLAT("VR settings"));
dialog::addItem(XLAT("VR demos"), 'D');

View File

@ -241,7 +241,7 @@ void use_probs() {
EX void wfc_menu() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(1);
gamescreen();
dialog::init(XLAT("Wave Function Collapse"));
dialog::addSelItem(XLAT("import the current map"), XLAT("rules: %1", its(isize(probs))), 'i');