mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
fixed string_parameter editors forgetting the edited text
This commit is contained in:
parent
43d1fd3db8
commit
ba44e111ca
@ -578,21 +578,24 @@ void string_parameter::show_edit_option(int key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string_parameter* string_parameter::set_standard_editor() {
|
string_parameter* string_parameter::set_standard_editor() {
|
||||||
shared_ptr<string> bak = make_shared<string>(*value);
|
shared_ptr<string> bak = make_shared<string>();
|
||||||
editor = [this, bak] {
|
editor = [this, bak] {
|
||||||
|
*bak = *value;
|
||||||
dialog::edit_string(*bak, menu_item_name, help_text);
|
dialog::edit_string(*bak, menu_item_name, help_text);
|
||||||
dialog::get_di().reaction = [this, bak] {
|
dialog::get_di().reaction = [this, bak] {
|
||||||
if(pre_reaction) pre_reaction();
|
if(pre_reaction) pre_reaction();
|
||||||
*value = *bak;
|
*value = *bak;
|
||||||
if(reaction) reaction();
|
if(reaction) reaction();
|
||||||
};
|
};
|
||||||
|
if(sets) sets();
|
||||||
};
|
};
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
string_parameter* string_parameter::set_file_editor(string ext) {
|
string_parameter* string_parameter::set_file_editor(string ext) {
|
||||||
shared_ptr<string> bak = make_shared<string>(*value);
|
shared_ptr<string> bak = make_shared<string>();
|
||||||
editor = [this, bak, ext] {
|
editor = [this, bak, ext] {
|
||||||
|
*bak = *value;
|
||||||
dialog::openFileDialog(*bak, menu_item_name, ext, [this, bak] {
|
dialog::openFileDialog(*bak, menu_item_name, ext, [this, bak] {
|
||||||
if(pre_reaction) pre_reaction();
|
if(pre_reaction) pre_reaction();
|
||||||
*value = *bak;
|
*value = *bak;
|
||||||
|
Loading…
Reference in New Issue
Block a user