1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 13:07:16 +00:00

try harder to fit editor menu on the screen

This commit is contained in:
Zeno Rogue 2024-07-27 21:05:10 +02:00
parent eb9eac7318
commit 75a73f40b3
3 changed files with 9 additions and 2 deletions

View File

@ -719,6 +719,10 @@ EX namespace dialog {
dwidth = vid.xres - vid.yres;
dcenter = vid.xres - dwidth / 2;
}
else if(cmode & sm::DIALOG_OFFMAP) {
dwidth = vid.xres / 3;
dcenter = vid.xres * 5 / 6;
}
measure();

View File

@ -5574,6 +5574,8 @@ EX void calcparam() {
if(tour::on && (tour::slides[tour::currentslide].flags & tour::SIDESCREEN) && ok)
current_display->sidescreen = true;
#endif
if((cmode & sm::DIALOG_OFFMAP) && !centered_menus && vid.xres > vid.yres * 11/10)
current_display->sidescreen = true;
if(current_display->sidescreen) cd->xcenter = vid.yres/2;
}
@ -5863,7 +5865,7 @@ namespace sm {
static constexpr int CENTER = 1024;
static constexpr int ZOOMABLE = 4096;
static constexpr int TORUSCONFIG = 8192;
static constexpr int MAYDARK = 16384;
static constexpr int MAYDARK = 16384; // use together with SIDE; if the screen is not wide or centered_menus is set, it will disable SIDE and instead darken the screen
static constexpr int DIALOG_STRICT_X = 32768; // do not interpret dialog clicks outside of the X region
static constexpr int EXPANSION = (1<<16);
static constexpr int HEXEDIT = (1<<17);
@ -5878,6 +5880,7 @@ namespace sm {
static constexpr int EDIT_INSIDE_WALLS = (1<<26); // mouseover targets inside walls
static constexpr int DIALOG_WIDE = (1<<27); // make dialogs wide
static constexpr int MOUSEAIM = (1<<28); // mouse aiming active here
static constexpr int DIALOG_OFFMAP = (1<<29); // try hard to keep dialogs off the map
}
#endif

View File

@ -1615,7 +1615,7 @@ EX namespace mapeditor {
EX void showMapEditor() {
cmode = sm::MAP | sm::PANNING;
if(show_menu) cmode |= sm::SIDE;
if(show_menu) cmode |= sm::DIALOG_OFFMAP;
if(building_mode) {
if(anyshiftclick) cmode |= sm::EDIT_INSIDE_WALLS;
else cmode |= sm::EDIT_BEFORE_WALLS;