-
Notifications
You must be signed in to change notification settings - Fork 108
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
[Fix #357] Update AreaEditor8a.cs to save AreaSettings #358
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good to me! Tho I do wonder if we need the additional function for writing the object. Can't we use one of the already available methods?
I'll approve it tho, I don't see any issues with it. Maybe @kwsch has a comment?
Thank you! My first idea was to simply use There are ways to get around that but I don't understand nearly enough of C# to understand the downsides to each of them. (I literally started learning it just to solve this problem.) So I decided to defer to someone else's knowledge. If I had to choose, I'd add an argument to the public sealed class ResidentArea(GFPack resident, AreaSettings settings, >> AreaSettingsTable? table = null <<)
{
public AreaSettingsTable? Table = table;
... Modify var area = new ResidentArea(Resident, Settings.Find(name), >> Settings <<); (Ideally I suppose you'd pass Then add to if(Table != null){
TryWrite("bin/field/resident/AreaSettings.bin", Table);
} I have tested this and it seems to work (I haven't tested the resulting file in-game yet). |
Ah sorry for the confusion. What I mean is that you can use Edit: Also
That's a great find, if you want you can rename it in the fbs file and where it's used so we can document it :D |
@drvictorvs If you can change that thing I mentioned I'll merge it in :) |
return; | ||
|
||
byte[] result = Write(obj); | ||
Resident[index] = result; |
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.
So this can be FlatBufferConverter.SerializeFrom(obj)
So, I think this did it. Well, I'm sure it works, the Field/Areas Settings tab will save as intended, I'm just not sure whether it creates other problems. So I did it in the most analogous way to SaveArea, without any code cleaning, in the wrong place, just so that it's very explicit what it's doing. So feel free to edit it.
By the way, I managed to find that Flag03 is essentially "Can Ride", i.e., if you enable it in Jubilife Village, you'll be able to ride Pokémon there.
Best regards.