mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-03-01 11:19:43 +00:00
number editor now accepts hex numbers, and uses hex as default when editing Tortoises
This commit is contained in:
10
dialogs.cpp
10
dialogs.cpp
@@ -600,7 +600,10 @@ namespace dialog {
|
||||
else return int(x-.5);
|
||||
}
|
||||
|
||||
string disp(ld x) { if(ne.intval) return its(ldtoint(x)); else if(ne.vmax-ne.vmin < 1) return fts4(x); else return fts(x); }
|
||||
string disp(ld x) {
|
||||
if(dialogflags & sm::HEXEDIT) return "0x" + itsh(x);
|
||||
else if(ne.intval) return its(ldtoint(x));
|
||||
else if(ne.vmax-ne.vmin < 1) return fts4(x); else return fts(x); }
|
||||
|
||||
reaction_t reaction;
|
||||
reaction_t reaction_final;
|
||||
@@ -615,6 +618,11 @@ namespace dialog {
|
||||
anims::deanimate(*ne.editwhat);
|
||||
}
|
||||
|
||||
void use_hexeditor() {
|
||||
dialogflags |= sm::HEXEDIT;
|
||||
ne.s = disp(*ne.editwhat);
|
||||
}
|
||||
|
||||
void apply_edit() {
|
||||
exp_parser ep;
|
||||
ep.s = ne.s;
|
||||
|
||||
Reference in New Issue
Block a user