Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
12 stars 5 forks source link

Map data class #246

Closed snipercup closed 2 months ago

snipercup commented 2 months ago

Requires #245

The initial motivation was a hack I made in #244 where maps were loaded in a hacky way. The current Gamedata structure didn't really support actually support loading the contents of the mapfiles. So I took this opportunity to implement a suggestion made by VectorOfInt in discord. Instead of directly messing with the JSON, it's now handled trough a proper class. It replaces Gamedata.data.maps with Gamedata.maps. This new class is specifically made to handle data, that's why I put a D in front of it. It's not fully implemented in some areas. In Chunk.gd it's still working off json extracted from the map. There are also two subclasses in DMap that have no use now but could be implemented later.

maybe this is going to cause some bugs. I did some testing but it's very integrated so I didn't test all of it. You can edit and save maps, references work and the game can be played. This pr also introduces more hacks, specifically in the content_lists.