From 3a354752e630435f3a79829672aceaad815959d0 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 22 Feb 2025 20:44:58 -0500 Subject: [PATCH] Implement a picker to select a sector in Relocate Outdoors --- src/scenedit/scen.keydlgs.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/scenedit/scen.keydlgs.cpp b/src/scenedit/scen.keydlgs.cpp index e3bfff48..c24bc9b6 100644 --- a/src/scenedit/scen.keydlgs.cpp +++ b/src/scenedit/scen.keydlgs.cpp @@ -977,9 +977,22 @@ static bool edit_spec_enc_value(cDialog& me, std::string item_hit, node_stack_t& case STRT_PATH: title = "What path shape?"; break; case STRT_SPELL_PAT_MODE: title = "What kind of booms?"; break; case STRT_LABEL_ALIGN: title = "Choose vertical alignment:"; break; + case STRT_SECTOR: title = "Which sector?"; break; default: title = "Title not set for this string type!!!"; break; } + if(fcn.str_type == STRT_SECTOR && fcn.continuation == eSpecField::NONE) { + store = val; + break; + } + auto otherField = get_control_for_field(fcn.continuation); + if(fcn.str_type == STRT_SECTOR) { + val = val * scenario.outdoors.height() + me[otherField].getTextAsNum(); + } store = choose_text(fcn.str_type, val + fcn.adjust, &me, title) - fcn.adjust; + if(fcn.str_type == STRT_SECTOR) { + me[otherField].setTextToNum(store % scenario.outdoors.height()); + store /= scenario.outdoors.height(); + } } break; case eSpecPicker::PICTURE: { ePicType type = fcn.pic_type;