std::vector<EffectBlueprint *> alternatives; // Must all have the same amount of inputs. Pointers to make things easier for Lua.
std::vector<Index> inputs; // One for each input of alternatives[0] (ie., typically 0 or 1, occasionally 2).
- std::vector<Index> disablers; // If any of these are disabled (IdentityEffect chosen), so should this one.
+
+ // If any of these effects are disabled (IdentityEffect chosen)
+ // or enabled (not chosen) as determined by <condition>, so should this one.
+ struct Disabler {
+ Index block_idx;
+ enum {
+ DISABLE_IF_OTHER_DISABLED,
+
+ // This a promise from the user; ie., we don't disable automatically
+ // (see comments in find_disabled_blocks()).
+ DISABLE_IF_OTHER_ENABLED
+ } condition;
+ std::string declaration_point; // For error messages.
+ };
+ std::vector<Disabler> disablers;
int currently_chosen_alternative = 0;
// What alternative to use if the block is disabled.
// Points to an alternative with IDENTITY_EFFECT if it exists
int Block_enable_if(lua_State *L);
int Block_disable(lua_State *L);
int Block_always_disable_if_disabled(lua_State *L);
+int Block_promise_to_disable_if_enabled(lua_State *L);
int Block_set_int(lua_State *L);
int Block_set_float(lua_State *L);
int Block_set_vec3(lua_State *L);