Make getting scenario strings DRY

This commit is contained in:
2025-02-16 10:25:04 -06:00
parent 920fa0d27b
commit c4e1ff7f0d
4 changed files with 50 additions and 61 deletions

View File

@@ -639,12 +639,9 @@ void story_dialog(std::string title, str_num_t first, str_num_t last, eSpecCtxTy
} else if(clicked == "right") {
cur++;
}
if(which_str_type == eSpecCtxType::SCEN)
me["str"].setText(univ.scenario.spec_strs[cur]);
else if(which_str_type == eSpecCtxType::OUTDOOR)
me["str"].setText(univ.out->spec_strs[cur]);
else if(which_str_type == eSpecCtxType::TOWN)
me["str"].setText(univ.town->spec_strs[cur]);
std::string text;
get_str(text, which_str_type, cur);
me["str"].setText(text);
return true;
}, {"left", "right", "done"});
story_dlg["left"].triggerClickHandler(story_dlg, "left", eKeyMod());