Open JDrocks450 opened 8 months ago
https://github.com/LazyDuchess/OpenTS2/assets/16988651/d095cbcc-32ba-4d1d-a6f0-a039317019ba
Fixed bug mentioned in initial comment.
My apologies I will have that cleaned up in the next commit and respond back. Thanks!
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
https://github.com/LazyDuchess/OpenTS2/assets/16988651/130ef00c-e093-402b-8615-8e124d4eaa60
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 given It also uses functionality on the Build Mode Server such as: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
https://github.com/LazyDuchess/OpenTS2/assets/16988651/3a818386-41bf-411d-8d04-dd6dde228e46
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 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
https://github.com/LazyDuchess/OpenTS2/assets/16988651/98deb9fa-6721-4f4b-aeba-7d53ca03a4fa
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.