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

gamescreen updated in rogueviz

This commit is contained in:
Zeno Rogue 2022-07-05 16:03:12 +02:00
parent 80cc89f6eb
commit b2fb02f863
26 changed files with 39 additions and 37 deletions

View File

@ -216,7 +216,7 @@ bool draw_ply() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("Ascending & Descending"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("Ascending & Descending"), 0xFFFFFFFF, 150, 0);
dialog::addSelItem("advance", fts(advance), 'a'); dialog::addSelItem("advance", fts(advance), 'a');

View File

@ -199,7 +199,8 @@ bool hide_random = false;
int last_seed = 0; int last_seed = 0;
EX void show_menu() { EX void show_menu() {
gamescreen(1); cmode = sm::DARKEN;
gamescreen();
dialog::init(XLAT("dual geometry puzzles")); dialog::init(XLAT("dual geometry puzzles"));
dialog::addHelp(XLAT("move both characters to marked squares at once!")); dialog::addHelp(XLAT("move both characters to marked squares at once!"));
dialog::addBreak(100); dialog::addBreak(100);

View File

@ -164,7 +164,7 @@ void edit_fifteen() {
auto ss = mapstream::save_start(); auto ss = mapstream::save_start();
ss->item = itGold; ss->item = itGold;
gamescreen(0); gamescreen();
ss->item = itNone; ss->item = itNone;
dialog::init("Fifteen Puzzle", iinf[itPalace].color, 150, 100); dialog::init("Fifteen Puzzle", iinf[itPalace].color, 150, 100);

View File

@ -388,7 +388,7 @@ namespace flocking {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("flocking"), iinf[itPalace].color, 150, 0); dialog::init(XLAT("flocking"), iinf[itPalace].color, 150, 0);
dialog::addSelItem("initial speed", fts(ini_speed), 'i'); dialog::addSelItem("initial speed", fts(ini_speed), 'i');

View File

@ -87,7 +87,7 @@ int editwhich = -1;
void show_graph() { void show_graph() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("graph")); dialog::init(XLAT("graph"));
for(int i=0; i<isize(formula); i++) { for(int i=0; i<isize(formula); i++) {
if(editwhich == i) { if(editwhich == i) {

View File

@ -516,9 +516,8 @@ void go_discord() {
void go_menu() { void go_menu() {
getcstat = '-'; getcstat = '-';
cmode = 0;
cmode = sm::SIDE | sm::DIALOG_STRICT_X; cmode = sm::SIDE | sm::DIALOG_STRICT_X;
gamescreen(0); gamescreen();
dialog::init("HyperGo", iinf[itPalace].color, 150, 100); dialog::init("HyperGo", iinf[itPalace].color, 150, 100);

View File

@ -122,7 +122,7 @@ void advance_heat_wave() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("heat transfer simulation"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("heat transfer simulation"), 0xFFFFFFFF, 150, 0);
add_edit(delta); add_edit(delta);
add_edit(qsteps); add_edit(qsteps);

View File

@ -331,7 +331,7 @@ int current_index = -1;
void choose_projection() { void choose_projection() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("choose projection"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("choose projection"), 0xFFFFFFFF, 150, 0);
for(int i=0; i<isize(models_to_use); i++) { for(int i=0; i<isize(models_to_use); i++) {
hypername = ""; hypername = "";
@ -355,7 +355,7 @@ void choose_projection() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("hyperbolic analogs"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("hyperbolic analogs"), 0xFFFFFFFF, 150, 0);
add_edit(prec); add_edit(prec);
dialog::addItem("choose a projection", 'p'); dialog::addItem("choose a projection", 'p');

View File

@ -230,7 +230,7 @@ void shift() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("inner maps"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("inner maps"), 0xFFFFFFFF, 150, 0);
add_edit(texture_alpha); add_edit(texture_alpha);
add_edit(inner_alpha); add_edit(inner_alpha);

View File

@ -472,7 +472,7 @@ void pick_algorithm() {
dialog::addItem("visualize (fast)", 'b'); dialog::addItem("visualize (fast)", 'b');
dialog::add_action([] { nconf_prepare(true); popScreen(); }); dialog::add_action([] { nconf_prepare(true); popScreen(); });
dialog::addSelItem("visualization speed", its(algo_speed), 'v'); dialog::addSelItem("visualization speed", its(algo_speed), 'v');
dialog::add_action([] { dialog::editNumber(algo_speed, 100, 1000000, 0.1, 10000, "", ""), dialog::scaleLog(), dialog::dialogflags = 0, dialog::numberdark = dialog::DONT_SHOW; }); dialog::add_action([] { dialog::editNumber(algo_speed, 100, 1000000, 0.1, 10000, "", ""), dialog::scaleLog(), dialog::dialogflags = sm::NOSCR; });
dialog::addBreak(50); dialog::addBreak(50);
dialog::addBoolItem_action("pretty corners", pretty, 'p'); dialog::addBoolItem_action("pretty corners", pretty, 'p');
dialog::addBreak(50); dialog::addBreak(50);
@ -824,7 +824,7 @@ void ncee_work() {
calcparam(); calcparam();
if(ncee_map_prepared < 5) { cmode = sm::NORMAL; ncee_map_prepared++; if(ncee_map_prepared == 5) prepare_ncee_map(); gamescreen(2); return; } if(ncee_map_prepared < 5) { cmode = sm::NORMAL | sm::DARKEN; ncee_map_prepared++; if(ncee_map_prepared == 5) prepare_ncee_map(); gamescreen(); return; }
#if CAP_NCONF #if CAP_NCONF
if(in_visualization) if(in_visualization)
@ -907,7 +907,7 @@ void ncee() {
if(uni == 's') show_mapping = !show_mapping; if(uni == 's') show_mapping = !show_mapping;
if(uni == 'g') show_mgrid = !show_mgrid; if(uni == 'g') show_mgrid = !show_mgrid;
if(uni == 't') pushScreen(conf_shapes); if(uni == 't') pushScreen(conf_shapes);
if(uni == 'y') dialog::editNumber(mapping_split, 0, 1, 0.05, 0.75, "", ""), dialog::dialogflags = 0, dialog::numberdark = dialog::DONT_SHOW; if(uni == 'y') dialog::editNumber(mapping_split, 0, 1, 0.05, 0.75, "", ""), dialog::dialogflags = sm::NOSCR;
if(uni == '-') { if(uni == '-') {
int x = (mousex - cd->xcenter - xc - x0) / siz; int x = (mousex - cd->xcenter - xc - x0) / siz;
int y = (mousey - cd->ycenter - yc - y0) / siz; int y = (mousey - cd->ycenter - yc - y0) / siz;

View File

@ -184,7 +184,7 @@ void run() {
cmode |= sm::SHOWCURSOR; cmode |= sm::SHOWCURSOR;
if(aimspeed_mouse_x == 0 && aimspeed_mouse_y == 0) if(aimspeed_mouse_x == 0 && aimspeed_mouse_y == 0)
cmode |= sm::SHOWCURSOR; cmode |= sm::SHOWCURSOR;
gamescreen(0); gamescreen();
if(planning_mode && !view_replay) { if(planning_mode && !view_replay) {
curlev->draw_planning_screen(); curlev->draw_planning_screen();
if(!holdmouse) { if(!holdmouse) {

View File

@ -1271,13 +1271,13 @@ void launch_solv() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("notknot"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("notknot"), 0xFFFFFFFF, 150, 0);
dialog::addItem("available scenes", 'a'); dialog::addItem("available scenes", 'a');
dialog::add_action_push([] { dialog::add_action_push([] {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("notknot scenes"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("notknot scenes"), 0xFFFFFFFF, 150, 0);

View File

@ -314,7 +314,7 @@ void add_model_settings() {
auto cf = addHook(hooks_configfile, 100, [] { auto cf = addHook(hooks_configfile, 100, [] {
param_f(prec, "obj_prec") param_f(prec, "obj_prec")
->editable(1, 100, 1, "3D model precision", "higher-precision models take more time to load and to render.", 'p') ->editable(1, 100, 1, "3D model precision", "higher-precision models take more time to load and to render.", 'p')
->set_sets([] { dialog::numberdark = dialog::DONT_SHOW; }) ->set_sets([] { cmode = sm::NOSCR; })
; ;
param_b(shift_to_ctr, "shift_to_ctr"); param_b(shift_to_ctr, "shift_to_ctr");
}); });

View File

@ -290,7 +290,7 @@ void rugframe() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init("Pentagonal Exploration"); dialog::init("Pentagonal Exploration");
auto add_key = [] (char c, int a, int b) { auto add_key = [] (char c, int a, int b) {
dialog::addBoolItem(lalign(0, "based on {",a,",",b,"}"), global_v == a && global_w == b, c); dialog::addBoolItem(lalign(0, "based on {",a,",",b,"}"), global_v == a && global_w == b, c);

View File

@ -433,7 +433,7 @@ EX void compare() {
void choose_projection() { void choose_projection() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("choose projection"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("choose projection"), 0xFFFFFFFF, 150, 0);
dynamicval<int> di(index); dynamicval<int> di(index);
for(int i=0; i<8; i++) { for(int i=0; i<8; i++) {
@ -450,7 +450,7 @@ void choose_projection() {
void choose_planet(texture::texture_data *& t) { void choose_planet(texture::texture_data *& t) {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("choose the planet"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("choose the planet"), 0xFFFFFFFF, 150, 0);
for(auto opt: {&earth, &moon, &sun, &mars, &neptune}) { for(auto opt: {&earth, &moon, &sun, &mars, &neptune}) {
dialog::addSelItem(pname[opt], its(radius[opt]) + " km", key[opt]); dialog::addSelItem(pname[opt], its(radius[opt]) + " km", key[opt]);
@ -462,7 +462,7 @@ void choose_planet(texture::texture_data *& t) {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("projections between planets"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("projections between planets"), 0xFFFFFFFF, 150, 0);
add_edit(alpha); add_edit(alpha);
add_edit(latit); add_edit(latit);

View File

@ -694,7 +694,7 @@ void run() {
sprite_vertices.tvertices.clear(); sprite_vertices.tvertices.clear();
if(map_on) { if(map_on) {
render_room(current_room); render_room(current_room);
gamescreen(0); gamescreen();
} }
else { else {
draw_room(); draw_room();

View File

@ -608,7 +608,8 @@ slide dmv_slides[] = {
empty_screen(mode); empty_screen(mode);
show_picture(mode, "rogueviz/nil/penrose-triangle.png"); show_picture(mode, "rogueviz/nil/penrose-triangle.png");
add_stat(mode, [] { add_stat(mode, [] {
gamescreen(2); cmode |= sm::DARKEN;
gamescreen();
dialog::init(); dialog::init();
dialog::addBreak(400); dialog::addBreak(400);
dialog::addTitle("playing with impossibility", dialog::dialogcolor, 150); dialog::addTitle("playing with impossibility", dialog::dialogcolor, 150);

View File

@ -323,7 +323,8 @@ void show_animation(presmode mode, string s, int sx, int sy, int frames, int fps
} }
void choose_presentation() { void choose_presentation() {
gamescreen(2); cmode = sm::NOSCR;
gamescreen();
getcstat = ' '; getcstat = ' ';

View File

@ -111,7 +111,7 @@ int args() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("random walk"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("random walk"), 0xFFFFFFFF, 150, 0);
dialog::addSelItem("step size", fts(step_size), 'd'); dialog::addSelItem("step size", fts(step_size), 'd');

View File

@ -1062,7 +1062,7 @@ int readArgs() {
void configure_edge_display() { void configure_edge_display() {
cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X;
static int mode = 0; static int mode = 0;
gamescreen(0); gamescreen();
dialog::init(XLAT("rogueviz edges")); dialog::init(XLAT("rogueviz edges"));
for(int i=0; i<isize(edgetypes); i++) { for(int i=0; i<isize(edgetypes); i++) {
auto t = edgetypes[i]; auto t = edgetypes[i];
@ -1122,7 +1122,7 @@ void search_marker() {
void showVertexSearch() { void showVertexSearch() {
cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X;
gamescreen(0); search_for = -1; gamescreen(); search_for = -1;
dialog::init(XLAT("vertex search")); dialog::init(XLAT("vertex search"));
dialog::v.clear(); dialog::v.clear();
@ -1156,7 +1156,7 @@ void showVertexSearch() {
void showMenu() { void showMenu() {
if(callhandlers(false, hooks_rvmenu_replace)) return; if(callhandlers(false, hooks_rvmenu_replace)) return;
cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X; cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X;
gamescreen(0); gamescreen();
dialog::init(XLAT("rogueviz configuration")); dialog::init(XLAT("rogueviz configuration"));

View File

@ -141,7 +141,7 @@ transmatrix try_harder_relative_matrix(cell *at, cell *from) {
void edit_segment(int aid) { void edit_segment(int aid) {
cmode = sm::PANNING; cmode = sm::PANNING;
gamescreen(0); gamescreen();
dialog::init(XLAT("animation segment"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("animation segment"), 0xFFFFFFFF, 150, 0);
dialog::addSelItem("interval", fts(anims[aid].start_interval), 'i'); dialog::addSelItem("interval", fts(anims[aid].start_interval), 'i');
edit_interval(anims[aid].start_interval); edit_interval(anims[aid].start_interval);
@ -181,7 +181,7 @@ void generate_trace();
void edit_step(animation& anim, int id) { void edit_step(animation& anim, int id) {
cmode = 0; cmode = 0;
gamescreen(0); gamescreen();
dialog::init(XLAT("animation step"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("animation step"), 0xFFFFFFFF, 150, 0);
auto& f = anim.frames[id]; auto& f = anim.frames[id];
dialog::addSelItem("title", f.title, 't'); dialog::addSelItem("title", f.title, 't');
@ -268,7 +268,7 @@ void handle_animation(ld t);
void show() { void show() {
cmode = 0; cmode = 0;
gamescreen(0); gamescreen();
draw_crosshair(); draw_crosshair();
dialog::init(XLAT("smooth camera"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("smooth camera"), 0xFFFFFFFF, 150, 0);
char key = 'A'; char key = 'A';

View File

@ -207,7 +207,7 @@ void snow_slide(vector<tour::slide>& v, string title, string desc, reaction_t t)
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("snowballs"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("snowballs"), 0xFFFFFFFF, 150, 0);
dialog::addSelItem("lambda", fts(snow_lambda), 'l'); dialog::addSelItem("lambda", fts(snow_lambda), 'l');

View File

@ -1041,8 +1041,8 @@ namespace levelline {
void show() { void show() {
if(levellines.size() == 0) create(); if(levellines.size() == 0) create();
gamescreen(0);
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen();
dialog::init("level lines"); dialog::init("level lines");
char nx = 'a'; char nx = 'a';
for(auto &l : levellines) { for(auto &l : levellines) {

View File

@ -191,7 +191,7 @@ void make_staircase() {
void showMenu() { void showMenu() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("Spiral Staircase"), iinf[itPalace].color, 150, 0); dialog::init(XLAT("Spiral Staircase"), iinf[itPalace].color, 150, 0);
add_edit(scurvature); add_edit(scurvature);

View File

@ -49,7 +49,7 @@ void sumotron_puzzle() {
cmode = 0; cmode = 0;
if(dialog_shown) cmode = sm::SIDE | sm::DIALOG_STRICT_X | sm::MAYDARK; if(dialog_shown) cmode = sm::SIDE | sm::DIALOG_STRICT_X | sm::MAYDARK;
dynamicval<bool> dp(mapeditor::drawplayer, false); dynamicval<bool> dp(mapeditor::drawplayer, false);
gamescreen(0); gamescreen();
initquickqueue(); initquickqueue();
for(auto p: value) { for(auto p: value) {

View File

@ -244,7 +244,7 @@ int readArgs() {
void show() { void show() {
cmode = sm::SIDE | sm::MAYDARK; cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0); gamescreen();
dialog::init(XLAT("sunflower spirals"), 0xFFFFFFFF, 150, 0); dialog::init(XLAT("sunflower spirals"), 0xFFFFFFFF, 150, 0);
dialog::addSelItem("density", fts(zdensity), 'd'); dialog::addSelItem("density", fts(zdensity), 'd');