Skip to content

Conversation

@Bit-Crust
Copy link
Contributor

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.

Causeless
Causeless previously approved these changes Nov 15, 2024
Copy link
Contributor

@Causeless Causeless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! Very, very nice.

@pawnishoovy can you make sure that refinery assault gets a required area set up for this?

@Causeless Causeless added this pull request to the merge queue Nov 15, 2024
Merged via the queue into development with commit 9d040b9 Nov 15, 2024
4 checks passed
@Causeless Causeless deleted the activity-scene-compatibility branch November 15, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants