From 2da7e11fd8948811367c2e4948e3d39443778af4 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 8 Mar 2025 11:07:01 +0100 Subject: [PATCH] geometry selection and better startup --- rogueviz/seuphorica.cpp | 96 +++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 22 deletions(-) diff --git a/rogueviz/seuphorica.cpp b/rogueviz/seuphorica.cpp index 8879cb11..27dcbce6 100644 --- a/rogueviz/seuphorica.cpp +++ b/rogueviz/seuphorica.cpp @@ -977,6 +977,8 @@ struct seuphgeom { reaction_t launcher; }; +int current_seuphgeom = -1; + vector seuphgeoms = { {"Infinite Board", []{ set_geometry(gEuclidSquare); @@ -1070,6 +1072,44 @@ vector seuphgeoms = { }}, }; +void reset_seuphorica_screen() { + popScreenAll(); + pushScreen(seuphorica_screen); + centermap(); + clearMessages(); + addMessage("Welcome to Seuphorica!"); + } + +void enable(); + +void seuphorica_setgeom() { + cmode = sm::DARKEN; + gamescreen(); + stillscreen = !anims::any_on(); + dialog::init("Seuphorica geometries", 0xFFFF80); + char let = 'a'; + for(int i=0; iname, 'l'); lang_to_edit = &next_language; dialog::add_action_push(pick_language); + + dialog::addSelItem("geometry", current_seuphgeom == -1 ? "custom" : seuphgeoms[current_seuphgeom].name, 'g'); + dialog::add_action_push(seuphorica_setgeom); + dialog::addItem("start new standard game", 's'); dialog::add_action([] { reset_rv(); restart("", "", ""); - popScreen(); popScreen(); + reset_seuphorica_screen(); }); if(!is_daily) { check_daily_time(); @@ -1090,7 +1134,7 @@ void seuphorica_newgame() { dialog::add_action([] { reset_rv(); restart((its(daily) + "9").c_str(), "D", "8"); - popScreen(); popScreen(); + reset_seuphorica_screen(); }); } dialog::addBreak(100); @@ -1164,7 +1208,7 @@ void seuphorica_newgame() { is_daily = false; game_restricted = false; for(int i=0; i= '0' && s[0] <= '9') which = atoi(s.c_str()); if(which == -1) throw hr_exception("unknown seuphorica-geo geometry"); + current_seuphgeom = which; seuphgeoms[which].launcher(); - launch(); enable(); pushScreen(seuphorica_screen); + launch(); }); }