preview for IF_NUM_RESPONSE node

This commit is contained in:
2025-08-26 14:05:01 -05:00
parent 408cdbfdd6
commit 087292f4b6
2 changed files with 8 additions and 3 deletions

View File

@@ -140,7 +140,6 @@ namespace {
.ex1b(STRT_ANY_SPELL)
.end()
.no_preview();
// TODO implement preview
node_properties_t S_NUM = node_builder_t(eSpecType::IF_NUM_RESPONSE)
.msg1(+eSpecPicker::MSG_SINGLE)
.pict(STRT_CMP_MODE)
@@ -152,8 +151,7 @@ namespace {
.ex1b(STRT_CMP)
.ex2a()
.ex2b(STRT_CMP)
.end()
.no_preview();
.end();
node_properties_t S_BOAT = node_builder_t(eSpecType::IF_IN_BOAT)
.ex1b(STRT_BOAT)
.ex1c(eSpecPicker::NODE)

View File

@@ -879,6 +879,13 @@ static bool preview_spec_enc_dlog(cDialog& me, std::string, cSpecial& special, s
cDialog::defaultBackground = cDialog::BG_DARK;
switch(special.type){
case eSpecType::IF_NUM_RESPONSE:{
int min = special.m2;
int max = special.m3;
if(min > max) std::swap(min,max);
univ.get_str(title,eSpecCtxType::SCEN,special.m1);
int i = get_num_response(min,max,title);
}break;
case eSpecType::IF_TEXT_RESPONSE:
univ.get_str(title,eSpecCtxType::SCEN,special.m1);
get_text_response(title);