-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added way to add creation code in rooms and instances #1901
base: master
Are you sure you want to change the base?
Conversation
(Based on code from UnderminersTeam#1412)
Download the artifacts for this pull request here: GUI:
CLI: |
if (!IsPreCreate) | ||
{ | ||
ObjectReference = CreationCode(mainWindow.Data, "gml_RoomCC_" + Room.Name.Content + "_" + RoomGameObject.InstanceID.ToString() + "_Create"); | ||
} | ||
else | ||
{ | ||
ObjectReference = CreationCode(mainWindow.Data, "gml_RoomCC_" + Room.Name.Content + "_" + RoomGameObject.InstanceID.ToString() + "_PreCreate"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please condense these
@@ -173,6 +215,33 @@ private void Details_Click(object sender, RoutedEventArgs e) | |||
} | |||
} | |||
|
|||
// TODO move this to the models | |||
UndertaleCode CreationCode(UndertaleData data, string name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function name feels too generic.
This is adding a code entry, not creation code.
And I'm fairly certain we already have a function in the lib to do exactly that
…rmatted it a little
Note that this will need to be changed if #1937 is merged |
Description
Made so the little + icon on creation code in rooms and instances can actually create the script instead of giving an error. Fixes #1900. Based on code from #1412.
Caveats
I tried to make it in a way that it could be expanded with other stuff. Maybe you could create derived classes from UndertaleObjectReference instead, so it doesn't clutter it up with a bunch of properties. Also the part that actually creates the code should probably be in the room model, and the part that creates arguments be separated and merged with the one that does that for object events already.
Notes
None