mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-01 09:22:51 +00:00
ap_changes no longer set if there was no actual change
This commit is contained in:
parent
cb9ad9d0c8
commit
b17b057890
@ -222,8 +222,9 @@ template<class T> struct enum_parameter : list_parameter {
|
|||||||
bool load_from_animation(const string& s) override {
|
bool load_from_animation(const string& s) override {
|
||||||
if(anim_value != *value) return false;
|
if(anim_value != *value) return false;
|
||||||
load(s);
|
load(s);
|
||||||
|
bool changed = anim_value != *value;
|
||||||
anim_value = *value;
|
anim_value = *value;
|
||||||
return true;
|
return changed;
|
||||||
}
|
}
|
||||||
void load_as_animation(const string& s) override {
|
void load_as_animation(const string& s) override {
|
||||||
load(s);
|
load(s);
|
||||||
@ -278,8 +279,9 @@ template<class T> struct val_parameter : public parameter {
|
|||||||
bool load_from_animation(const string& s) override {
|
bool load_from_animation(const string& s) override {
|
||||||
if(anim_value != *value) return false;
|
if(anim_value != *value) return false;
|
||||||
load(s);
|
load(s);
|
||||||
|
bool changed = anim_value != *value;
|
||||||
anim_value = *value;
|
anim_value = *value;
|
||||||
return true;
|
return changed;
|
||||||
}
|
}
|
||||||
void load_as_animation(const string& s) override {
|
void load_as_animation(const string& s) override {
|
||||||
load(s);
|
load(s);
|
||||||
@ -512,8 +514,9 @@ struct custom_parameter : public parameter {
|
|||||||
bool load_from_animation(const string& s) override {
|
bool load_from_animation(const string& s) override {
|
||||||
if(anim_value != get_cld()) return false;
|
if(anim_value != get_cld()) return false;
|
||||||
load(s);
|
load(s);
|
||||||
|
auto bak = anim_value;
|
||||||
anim_value = get_cld();
|
anim_value = get_cld();
|
||||||
return true;
|
return anim_value != bak;
|
||||||
}
|
}
|
||||||
void load_as_animation(const string& s) override {
|
void load_as_animation(const string& s) override {
|
||||||
load(s);
|
load(s);
|
||||||
|
@ -1220,7 +1220,7 @@ EX void animate_parameter(parameter *par, string f) {
|
|||||||
aps.emplace_back(animated_parameter{par, f});
|
aps.emplace_back(animated_parameter{par, f});
|
||||||
}
|
}
|
||||||
|
|
||||||
int ap_changes;
|
EX int ap_changes;
|
||||||
|
|
||||||
void apply_animated_parameters() {
|
void apply_animated_parameters() {
|
||||||
ap_changes = 0;
|
ap_changes = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user