mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 20:29:17 +00:00
when watching score from custom modes, show only the current custom mode
This commit is contained in:
parent
078d16a4e4
commit
c80b34140f
2
hyper.h
2
hyper.h
@ -800,7 +800,7 @@ string XLAT(string);
|
||||
#define DKEY (get_direction_key(sym, uni))
|
||||
#define DIRECTIONKEY (interpret_as_direction(sym, uni) ? uni : 0)
|
||||
|
||||
namespace scores { void load(); void load_only(); }
|
||||
namespace scores { void load(); void load_only(); extern int which_mode; }
|
||||
|
||||
#if ISMOBILE
|
||||
namespace leader { void showMenu(); void handleKey(int sym, int uni); }
|
||||
|
@ -16,6 +16,8 @@ score *currentgame;
|
||||
int scorefrom = 0;
|
||||
bool scorerev = false;
|
||||
|
||||
int which_mode;
|
||||
|
||||
string csub(const string& str, int q) {
|
||||
int i = 0;
|
||||
for(int j=0; j<q && i<isize(str); j++) getnext(str.c_str(), i);
|
||||
@ -66,6 +68,8 @@ int modediff(score *S) {
|
||||
}
|
||||
|
||||
string modedesc(score *S) {
|
||||
modecode_t mc = S->box[scores::MODECODE_BOX];
|
||||
if(mc && mode_description_of.count(mc)) return mode_description_of[mc];
|
||||
eGeometry g = (eGeometry) S->box[116];
|
||||
if(S->box[238]) g = gSphere;
|
||||
if(S->box[239]) g = gElliptic;
|
||||
@ -214,6 +218,8 @@ void show() {
|
||||
if(id >= isize(scores)) break;
|
||||
|
||||
score& S(scores[id]);
|
||||
|
||||
if(S.box[MODECODE_BOX] != which_mode && which_mode != -1) { id++; continue; }
|
||||
|
||||
if(omit) { omit--; rank++; id++; continue; }
|
||||
|
||||
@ -379,6 +385,7 @@ void load_only() {
|
||||
|
||||
void load() {
|
||||
load_only();
|
||||
which_mode = -1;
|
||||
|
||||
saved_modecode = modecode();
|
||||
saveBox();
|
||||
|
@ -1427,7 +1427,7 @@ void mode_screen_for_current() {
|
||||
dialog::addBreak(100);
|
||||
|
||||
dialog::addSelItem(XLAT("scores recorded"), its(qty_scores_for[mc]), 's');
|
||||
dialog::add_action([] { scores::load(); });
|
||||
dialog::add_action([mc] { scores::load(); scores::which_mode = mc; });
|
||||
|
||||
dialog::addSelItem(XLAT("Yendor Challenge"), its(yendor::compute_tscore(mc)), 'y');
|
||||
dialog::add_action([] {
|
||||
|
Loading…
Reference in New Issue
Block a user