[Fix #357] Update AreaEditor8a.cs to save AreaSettings#358
[Fix #357] Update AreaEditor8a.cs to save AreaSettings#358drvictorvs wants to merge 2 commits intokwsch:masterfrom
Conversation
duckdoom4
left a comment
There was a problem hiding this comment.
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.
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.