mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-09-10 06:16:00 +00:00
rogueviz:: bringris:: in the highscore list, you can now see highscores for other geometries/max sizes
This commit is contained in:
@@ -1283,19 +1283,27 @@ void draw_screen(int xstart, bool show_next) {
|
|||||||
|
|
||||||
void create_game();
|
void create_game();
|
||||||
|
|
||||||
void geometry_menu() {
|
int score_bgeom, score_max_piece;
|
||||||
|
|
||||||
|
void geometry_menu(bool for_scores) {
|
||||||
|
auto& c_geom = for_scores ? score_bgeom : bgeom;
|
||||||
|
auto& c_max = for_scores ? score_max_piece : bgeom;
|
||||||
clearMessages();
|
clearMessages();
|
||||||
cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
|
cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
|
||||||
dialog::init("Bringris geometries");
|
dialog::init(for_scores ? "highscores for..." : "Bringris geometries");
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
int total_stars = 0;
|
int total_stars = 0;
|
||||||
for(int i=0; i<isize(bgeoms); i++) total_stars += bgeoms[i].stars;
|
for(int i=0; i<isize(bgeoms); i++) total_stars += bgeoms[i].stars;
|
||||||
for(int i=0; i<isize(bgeoms); i++) {
|
for(int i=0; i<isize(bgeoms); i++) {
|
||||||
if(total_stars >= bgeoms[i].stars_needed || !stars_enabled) {
|
if(total_stars >= bgeoms[i].stars_needed || !stars_enabled) {
|
||||||
dialog::addTitle(bgeoms[i].name, i == bgeom ? 0xFF00 : 0xFF0000, 150);
|
dialog::addTitle(bgeoms[i].name, i == c_geom ? 0xFF00 : 0xFF0000, 150);
|
||||||
dialog::items.back().key = 'a' + i;
|
dialog::items.back().key = 'a' + i;
|
||||||
dialog::add_action([i] {
|
dialog::add_action([i, for_scores] {
|
||||||
enable_bgeom(i);
|
if(for_scores) {
|
||||||
|
score_bgeom = i;
|
||||||
|
score_max_piece = bgeoms[score_bgeom].default_max_piece;
|
||||||
|
}
|
||||||
|
else enable_bgeom(i);
|
||||||
});
|
});
|
||||||
dialog::addInfo(bgeoms[i].cap);
|
dialog::addInfo(bgeoms[i].cap);
|
||||||
dialog::items.back().key = 'a' + i;
|
dialog::items.back().key = 'a' + i;
|
||||||
@@ -1317,10 +1325,11 @@ void geometry_menu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
dialog::addSelItem("max piece", its(cur.max_piece), 'M');
|
dialog::addSelItem("max piece", its(c_max), 'M');
|
||||||
dialog::add_action([] {
|
dialog::add_action([&c_max, for_scores] {
|
||||||
cur.max_piece++;
|
c_max++;
|
||||||
if(cur.max_piece == 6) cur.max_piece = 2;
|
if(c_max == 6) c_max = 2;
|
||||||
|
if(for_scores) return;
|
||||||
create_game();
|
create_game();
|
||||||
state = tsPreGame;
|
state = tsPreGame;
|
||||||
});
|
});
|
||||||
@@ -1331,15 +1340,18 @@ void geometry_menu() {
|
|||||||
else
|
else
|
||||||
dialog::addBreak(100);
|
dialog::addBreak(100);
|
||||||
|
|
||||||
dialog::addBreak(100);
|
if(!for_scores) {
|
||||||
if(stars_enabled) {
|
dialog::addBreak(100);
|
||||||
if(total_stars < 6000)
|
if(stars_enabled) {
|
||||||
dialog::addHelp("Collect stars to unlock more spaces!\n\n"
|
if(total_stars < 6000)
|
||||||
"training mode: 1 block removed = 1 star\n\n"
|
dialog::addHelp("Collect stars to unlock more spaces!\n\n"
|
||||||
"expert mode: 1 block removed = 5 stars\n\n"
|
"training mode: 1 block removed = 1 star\n\n"
|
||||||
"only best score per space counts");
|
"expert mode: 1 block removed = 5 stars\n\n"
|
||||||
dialog::addInfo("currently " + its(total_stars) + " stars");
|
"only best score per space counts");
|
||||||
|
dialog::addInfo("currently " + its(total_stars) + " stars");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog::addBack();
|
dialog::addBack();
|
||||||
dialog::display();
|
dialog::display();
|
||||||
}
|
}
|
||||||
@@ -1405,7 +1417,7 @@ void settings_menu() {
|
|||||||
cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
|
cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
|
||||||
dialog::init("Bringris settings");
|
dialog::init("Bringris settings");
|
||||||
dialog::addItem("alternative geometry", 'g');
|
dialog::addItem("alternative geometry", 'g');
|
||||||
dialog::add_action_push(geometry_menu);
|
dialog::add_action_push([] { geometry_menu(false); });
|
||||||
dialog::addItem("visuals & Virtual Reality", 'v');
|
dialog::addItem("visuals & Virtual Reality", 'v');
|
||||||
dialog::add_action_push(visual_menu);
|
dialog::add_action_push(visual_menu);
|
||||||
dialog::addItem("configure keys", 'k');
|
dialog::addItem("configure keys", 'k');
|
||||||
@@ -1435,14 +1447,15 @@ bool hi_pro;
|
|||||||
void hiscore_menu() {
|
void hiscore_menu() {
|
||||||
cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
|
cmode = sm::VR_MENU | sm::NOSCR; gamescreen();
|
||||||
dialog::init("High scores");
|
dialog::init("High scores");
|
||||||
string s = bgeoms[bgeom].name;
|
string s = bgeoms[score_bgeom].name;
|
||||||
if(cur.max_piece != bgeoms[bgeom].default_max_piece) s = s + " (block " + its(cur.max_piece) + ")";
|
if(score_max_piece != bgeoms[score_bgeom].default_max_piece) s = s + " (block " + its(score_max_piece) + ")";
|
||||||
dialog::addInfo(s);
|
dialog::addItem(s, 'g');
|
||||||
|
dialog::add_action_push([] { geometry_menu(true); });
|
||||||
dialog::addItem(hi_pro ? "expert mode" : "training mode", 'm');
|
dialog::addItem(hi_pro ? "expert mode" : "training mode", 'm');
|
||||||
dialog::add_action([] { hi_pro = !hi_pro; });
|
dialog::add_action([] { hi_pro = !hi_pro; });
|
||||||
vector<gamedata*> v;
|
vector<gamedata*> v;
|
||||||
for(auto& ad: allsaves)
|
for(auto& ad: allsaves)
|
||||||
if(ad.bgeom_name == bgeoms[bgeom].name && ad.max_piece == cur.max_piece && ad.pro_game == hi_pro)
|
if(ad.bgeom_name == bgeoms[score_bgeom].name && ad.max_piece == score_max_piece && ad.pro_game == hi_pro)
|
||||||
v.push_back(&ad);
|
v.push_back(&ad);
|
||||||
sort(v.begin(), v.end(), [] (gamedata* g1, gamedata* g2) { return g1->sorter() > g2->sorter(); });
|
sort(v.begin(), v.end(), [] (gamedata* g1, gamedata* g2) { return g1->sorter() > g2->sorter(); });
|
||||||
dialog::start_list(900, 900, '1');
|
dialog::start_list(900, 900, '1');
|
||||||
@@ -1868,6 +1881,7 @@ void run() {
|
|||||||
pushScreen(settings_menu);
|
pushScreen(settings_menu);
|
||||||
}
|
}
|
||||||
if(in_menu && sym == 'h') {
|
if(in_menu && sym == 'h') {
|
||||||
|
score_bgeom = bgeom; score_max_piece = cur.max_piece;
|
||||||
pushScreen(hiscore_menu);
|
pushScreen(hiscore_menu);
|
||||||
}
|
}
|
||||||
if(in_menu && sym == 'x') {
|
if(in_menu && sym == 'x') {
|
||||||
|
Reference in New Issue
Block a user