mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-01-03 18:59:03 +00:00
fixed the bug with spatial embedding editing via config not working
This commit is contained in:
21
config.cpp
21
config.cpp
@@ -1415,10 +1415,13 @@ EX void initConfig() {
|
||||
-> editable("flat, not equidistant", 'F')
|
||||
-> set_reaction(geom3::apply_settings_full);
|
||||
|
||||
param_enum(geom3::spatial_embedding, "spatial_embedding", geom3::seDefault)
|
||||
->editable(geom3::spatial_embedding_options, "3D embedding method", 'E')
|
||||
->set_reaction(geom3::apply_settings_full);
|
||||
|
||||
param_custom_int(geom3::want_spatial_embedding, "spatial_embedding", menuitem_spatial_embedding, 'E')
|
||||
->set_reaction([] {
|
||||
if(geom3::want_spatial_embedding != shown_spatial_embedding())
|
||||
invoke_embed(geom3::want_spatial_embedding);
|
||||
})
|
||||
->help_text = "3D embedding method|3D style";
|
||||
|
||||
param_b(memory_saving_mode, "memory_saving_mode", (ISMOBILE || ISPANDORA || ISWEB) ? 1 : 0);
|
||||
param_i(reserve_limit, "memory_reserve", 128);
|
||||
param_b(show_memory_warning, "show_memory_warning");
|
||||
@@ -2864,7 +2867,7 @@ EX void edit_levellines(char c) {
|
||||
});
|
||||
}
|
||||
|
||||
geom3::eSpatialEmbedding shown_spatial_embedding() {
|
||||
EX geom3::eSpatialEmbedding shown_spatial_embedding() {
|
||||
if(GDIM == 2) return geom3::seNone;
|
||||
return geom3::spatial_embedding;
|
||||
}
|
||||
@@ -3000,6 +3003,11 @@ EX void show_spatial_embedding() {
|
||||
dialog::display();
|
||||
}
|
||||
|
||||
EX void menuitem_spatial_embedding(key_type key) {
|
||||
dialog::addSelItem(XLAT("3D style"), XLAT(geom3::spatial_embedding_options[shown_spatial_embedding()].first), key);
|
||||
dialog::add_action_push(show_spatial_embedding);
|
||||
}
|
||||
|
||||
EX void show3D_height_details() {
|
||||
cmode = sm::SIDE | sm::MAYDARK;
|
||||
gamescreen();
|
||||
@@ -3062,8 +3070,7 @@ EX void show3D() {
|
||||
|
||||
#if MAXMDIM >=4
|
||||
if(WDIM == 2) {
|
||||
dialog::addSelItem(XLAT("3D style"), XLAT(geom3::spatial_embedding_options[shown_spatial_embedding()].first), 'E');
|
||||
dialog::add_action_push(show_spatial_embedding);
|
||||
add_edit(geom3::want_spatial_embedding);
|
||||
|
||||
display_embedded_errors();
|
||||
dialog::addBreak(50);
|
||||
|
||||
@@ -96,6 +96,7 @@ EX namespace geom3 {
|
||||
}
|
||||
|
||||
EX eSpatialEmbedding spatial_embedding = seDefault;
|
||||
EX eSpatialEmbedding want_spatial_embedding = seNone;
|
||||
EX ld euclid_embed_scale = 1;
|
||||
EX ld euclid_embed_scale_y = 1;
|
||||
EX ld euclid_embed_rotate = 0;
|
||||
@@ -1369,7 +1370,7 @@ EX void invoke_embed(geom3::eSpatialEmbedding se) {
|
||||
if(GDIM == 3) { if(geom3::auto_configure) geom3::switch_fpp(); else geom3::switch_always3(); }
|
||||
if(in_tpp()) geom3::switch_tpp();
|
||||
if(se != geom3::seNone) {
|
||||
geom3::spatial_embedding = se;
|
||||
geom3::want_spatial_embedding = geom3::spatial_embedding = se;
|
||||
if(geom3::auto_configure) geom3::switch_fpp(); else geom3::switch_always3();
|
||||
delete_sky();
|
||||
if(vid.usingGL) resetGL();
|
||||
|
||||
Reference in New Issue
Block a user