Activity Scene Compatibility #151
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Activities need to somehow determine whether they are compatible with any given scene in the scenario menu. Until now this has been decided by two checks, one check for which areas are strictly required by the activity, determined by reading the script source file for every instance of
Scene::GetArea, and another check where the Lua is allowed to arbitrarily determine which are compatible, communicated by the invalidation or failure to invalidate a Lua global.The branch preserves both functions but changes their implementations. The strict areas are enumerated by any number of .ini properties "AddRequiredArea," each with the required area name specified, while the activity script method needs only to return true or false as to whether the given scene passes the test.
Internally, this is enabled by
LuaStateWrapper::RunScriptConditionalTestFunctionObject, which does exactly the same thing as the function it was copied from, however it takes reference to a Boolean value as return parameter for the actual output of the conditional test. GetOptionalArea is also removed as well as all reference to it.I think that's it, TL;DR please review the new function in LuaMan.cpp and tell me if there's anything odd about it.