mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-27 10:30:36 +00:00
menu_item_name_modified to help with translation
This commit is contained in:
parent
ac33354358
commit
928ab73fff
17
config.cpp
17
config.cpp
@ -43,6 +43,7 @@ struct setting {
|
|||||||
string parameter_name;
|
string parameter_name;
|
||||||
string config_name;
|
string config_name;
|
||||||
string menu_item_name;
|
string menu_item_name;
|
||||||
|
bool menu_item_name_modified;
|
||||||
string help_text;
|
string help_text;
|
||||||
reaction_t reaction;
|
reaction_t reaction;
|
||||||
char default_key;
|
char default_key;
|
||||||
@ -110,6 +111,7 @@ struct list_setting : setting {
|
|||||||
is_editable = true;
|
is_editable = true;
|
||||||
options = o;
|
options = o;
|
||||||
this->menu_item_name = menu_item_name;
|
this->menu_item_name = menu_item_name;
|
||||||
|
menu_item_name_modified = true;
|
||||||
default_key = key;
|
default_key = key;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -222,6 +224,7 @@ struct float_setting : public val_setting<ld> {
|
|||||||
this->min_value = min_value;
|
this->min_value = min_value;
|
||||||
this->max_value = max_value;
|
this->max_value = max_value;
|
||||||
this->menu_item_name = menu_item_name;
|
this->menu_item_name = menu_item_name;
|
||||||
|
menu_item_name_modified = true;
|
||||||
this->help_text = help_text;
|
this->help_text = help_text;
|
||||||
this->step = step;
|
this->step = step;
|
||||||
default_key = key;
|
default_key = key;
|
||||||
@ -254,6 +257,7 @@ struct int_setting : public val_setting<int> {
|
|||||||
this->min_value = min_value;
|
this->min_value = min_value;
|
||||||
this->max_value = max_value;
|
this->max_value = max_value;
|
||||||
this->menu_item_name = menu_item_name;
|
this->menu_item_name = menu_item_name;
|
||||||
|
menu_item_name_modified = true;
|
||||||
this->help_text = help_text;
|
this->help_text = help_text;
|
||||||
this->step = step;
|
this->step = step;
|
||||||
default_key = key;
|
default_key = key;
|
||||||
@ -280,6 +284,7 @@ struct color_setting : public val_setting<color_t> {
|
|||||||
color_setting *editable(string menu_item_name, string help_text, char key) {
|
color_setting *editable(string menu_item_name, string help_text, char key) {
|
||||||
this->is_editable = true;
|
this->is_editable = true;
|
||||||
this->menu_item_name = menu_item_name;
|
this->menu_item_name = menu_item_name;
|
||||||
|
menu_item_name_modified = true;
|
||||||
this->help_text = help_text;
|
this->help_text = help_text;
|
||||||
default_key = key;
|
default_key = key;
|
||||||
return this;
|
return this;
|
||||||
@ -295,6 +300,7 @@ struct matrix_setting : public val_setting<matrix_eq> {
|
|||||||
matrix_setting *editable(string menu_item_name, string help_text, char key) {
|
matrix_setting *editable(string menu_item_name, string help_text, char key) {
|
||||||
this->is_editable = true;
|
this->is_editable = true;
|
||||||
this->menu_item_name = menu_item_name;
|
this->menu_item_name = menu_item_name;
|
||||||
|
menu_item_name_modified = true;
|
||||||
this->help_text = help_text;
|
this->help_text = help_text;
|
||||||
default_key = key;
|
default_key = key;
|
||||||
return this;
|
return this;
|
||||||
@ -318,7 +324,9 @@ struct bool_setting : public val_setting<bool> {
|
|||||||
reaction_t switcher;
|
reaction_t switcher;
|
||||||
bool_setting* editable(string cap, char key ) {
|
bool_setting* editable(string cap, char key ) {
|
||||||
is_editable = true;
|
is_editable = true;
|
||||||
menu_item_name = cap; default_key = key; return this;
|
menu_item_name = cap; default_key = key;
|
||||||
|
menu_item_name_modified = true;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
void show_edit_option(int key) override;
|
void show_edit_option(int key) override;
|
||||||
|
|
||||||
@ -682,6 +690,7 @@ EX int_setting *param_i(int& val, const string s, int dft) {
|
|||||||
u->parameter_name = param_esc(s);
|
u->parameter_name = param_esc(s);
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->value = &val;
|
u->value = &val;
|
||||||
u->last_value = dft;
|
u->last_value = dft;
|
||||||
u->dft = dft;
|
u->dft = dft;
|
||||||
@ -707,6 +716,7 @@ EX bool_setting *param_b(bool& val, const string s, bool dft) {
|
|||||||
u->parameter_name = param_esc(s);
|
u->parameter_name = param_esc(s);
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->value = &val;
|
u->value = &val;
|
||||||
u->last_value = dft;
|
u->last_value = dft;
|
||||||
u->dft = dft;
|
u->dft = dft;
|
||||||
@ -723,6 +733,7 @@ EX color_setting *param_color(color_t& val, const string s, bool has_alpha, colo
|
|||||||
u->parameter_name = param_esc(s);
|
u->parameter_name = param_esc(s);
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->value = &val;
|
u->value = &val;
|
||||||
u->last_value = dft;
|
u->last_value = dft;
|
||||||
u->dft = dft;
|
u->dft = dft;
|
||||||
@ -740,6 +751,7 @@ EX matrix_setting *param_matrix(transmatrix& val0, const string s, int dim) {
|
|||||||
u->parameter_name = param_esc(s);
|
u->parameter_name = param_esc(s);
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->value = &val;
|
u->value = &val;
|
||||||
u->last_value = val;
|
u->last_value = val;
|
||||||
u->dft = val;
|
u->dft = val;
|
||||||
@ -755,6 +767,7 @@ EX char_setting *param_char(char& val, const string s, char dft) {
|
|||||||
u->parameter_name = param_esc(s);
|
u->parameter_name = param_esc(s);
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->value = &val;
|
u->value = &val;
|
||||||
u->last_value = dft;
|
u->last_value = dft;
|
||||||
u->dft = dft;
|
u->dft = dft;
|
||||||
@ -782,6 +795,7 @@ template<class T> enum_setting<T> *param_enum(T& val, const string p, const stri
|
|||||||
u->parameter_name = p;
|
u->parameter_name = p;
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->value = &val;
|
u->value = &val;
|
||||||
u->dft = dft;
|
u->dft = dft;
|
||||||
val = dft;
|
val = dft;
|
||||||
@ -813,6 +827,7 @@ custom_setting* param_custom(T& val, const string& s, function<void(char)> menui
|
|||||||
u->parameter_name = param_esc(s);
|
u->parameter_name = param_esc(s);
|
||||||
u->config_name = s;
|
u->config_name = s;
|
||||||
u->menu_item_name = s;
|
u->menu_item_name = s;
|
||||||
|
u->menu_item_name_modified = false;
|
||||||
u->last_value = (int) val;
|
u->last_value = (int) val;
|
||||||
u->custom_viewer = menuitem;
|
u->custom_viewer = menuitem;
|
||||||
u->custom_value = [&val] () { return (int) val; };
|
u->custom_value = [&val] () { return (int) val; };
|
||||||
|
Loading…
Reference in New Issue
Block a user