Town details picker for save event
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
<text top='98' left='59' width='261' height='41'>Number of event which prevents town death (if -1 or 0, none) - see chapter in documentation on time for more details.</text>
|
||||
<field name='key' top='101' left='327' width='43' height='16'/>
|
||||
<button name='choose-key' type='regular' relative='pos neg' rel-anchor='prev' top='4' left='4'>Choose</button>
|
||||
|
||||
<text top='216' left='50' width='234' height='42'>
|
||||
Maximum number of monsters:
|
||||
|
||||
@@ -716,6 +716,12 @@ void edit_town_details() {
|
||||
town_dlg["cancel"].attachClickHandler(std::bind(&cDialog::toast, &town_dlg, false));
|
||||
town_dlg["chop"].attachFocusHandler(std::bind(check_range_msg, _1, _2, _3, -1, 10000, "The day the town becomes abandoned", "-1 if it doesn't"));
|
||||
town_dlg["key"].attachFocusHandler(std::bind(check_range_msg, _1, _2, _3, -1, 10, "The event which prevents the town from becoming abandoned", "-1 or 0 for none"));
|
||||
town_dlg["choose-key"].attachClickHandler([](cDialog& me, std::string id, bool losing) -> bool {
|
||||
int value = me["key"].getTextAsNum();
|
||||
value = choose_text_editable(scenario.evt_names, value, &me, "Select an event:");
|
||||
me["key"].setTextToNum(value);
|
||||
return true;
|
||||
});
|
||||
town_dlg["difficulty"].attachFocusHandler(std::bind(check_range_msg, _1, _2, _3, 0, 10, "The town difficulty", "0 - easiest, 10 - hardest"));
|
||||
town_dlg["pick-cmt"].attachFocusHandler([](cDialog& me, std::string id, bool losing) -> bool {
|
||||
if(losing) return true;
|
||||
|
||||
Reference in New Issue
Block a user