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
+36 -20
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');