Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Build Mode Test Scene
This pull request implements the features detailed below in service of a build mode test scene environment allowing basic construction.
Loading Lot Architecture
This scene is based on the pre-existing work of loading a lot from file, with the advantage of now being able to edit the
LotArchitecture
on the fly through using build tools.These changes are now in a new class called LotLoad.cs
LotLoad.cs allows for a lot to be loaded into the current scene as easily as:
Which will perform the behind the scenes tasks of:
ContentProvider
LotArchitecture
instance from the lot packageGameObjects
for that architecture instanceBuild Mode HUD
The Build Mode HUD has been implemented with a controller (LotBuildModeHUD.cs).
The Build Mode HUD currently has the ability to perform the following tasks:
Build Mode Server
Since all of the tools listed below make direct changes to the LotArchitecture instance supplied by
LotLoad
-- a build mode server has been added as a pipeline to modify the lot. The Build Mode Server has a constructor that takes the currentLotLoad
instance for modification.For clarity, each tool below has its relative function signature(s) on the
BuildModeServer
attached for reference.Wall Tool
walltool.mp4
This tool (mainly) uses the following functions:
This method creates walls by doing the following:
WallGraph
on the floor given (this also creates the layer ID)WallMap
WallLayer
with the wallpaper givenIt also uses functionality on the Build Mode Server such as:
(this is how foundations are made)
These functions utilize the same logic as above but in reverse.
Deleting walls can be done diagonally and also by Room as well (hold shift)
Invoke the delete function by holding Ctrl :)
Floor Tool
FLOORtool.mp4
This tool (mainly) uses the following functions:
This function will ensure the pattern is added to the
FloorMap
. You can also use this function for wallpaper as well.This function adds floors to the
FloorPatterns
on theLotArchitecture
.It will also do the following:
This is done using the original game's implementation, it will poll the elevation at the NE corner of the tile the cursor originates and levels the region of terrain under the floor you placed.
This function uses the
CreateFloors()
method, but sets theFloorPattern
to be empty.Foundation Tool
The foundation tool uses both of these functions above together.
It will do the following:
Terrain Tool
terraintool.mp4
The terrain tool has three sizes matching the original games. The sizes are found in the enum
TerrainBrushSizes
:It uses the following function:
This function supports the following: Raise, Lower, Water. In the future it can also support: Smooth and Terrain paint.
This function also supports the
constrainfloorelevation
cheat I added as well by using theIsFloorAt()
function.Note: This function will modify Elevation data for any floor provided, so walls, foundations, etc. can be modified.
The flatten lot function is also implemented, but should be revisited to remove all the stuff on the lot (there also is no confirmation message yet -- be careful)
Quick note on Cheats
Added the
SimpleProperty
, which can be used with theRegisterProperty
function in the Cheat System. I almost reimplemented the whole cheat system until I saw it already existed! Anyway, this can be used to create properties like CFE which are a simple toggle on/off.Final note
This is still proof of concept and help/feedback is welcome. If this pr is merged, I would highly recommend doing so to a dedicated branch as the features can be a little buggy right now.