Skip to content
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

Refactor the tilemap menu #1355

Merged

Conversation

stilnat
Copy link
Contributor

@stilnat stilnat commented Nov 23, 2023

Summary

The tilemapcreator script keeps growing in size, and it's getting hard to manage. This PR splits the tilemapcreator script into a bunch of scripts with specific roles regarding handling the tilemap menu and it's functionnalities. There was some renaming and a lot of doc added as well. It should not change anything regarding the present functionnalities of the menu.

The tilemap creator script (renamed to tilemap menu) is divided into the following scripts :

  • Construction hologram : class representing a construction hologram and storing data about it.
  • ConstructionHologram manager : Class for managing ghost objects, that will be used for building or deleting by TileMapCreator. It handles creating construction holograms, replacing, adding or deleting tile objects and items upon placement, and placing the holograms in cool shapes like lines and squares.
  • TileMap menu : This scripts orchestrate a bunch of other scripts related to making the menu work.
  • TileMapMenuSaveAndLoadTabs : Handle the UI and logic related to saving and loading maps in the tilemap menu.
  • TileMapMenuBuildingTabs : Handle the UI and displaying everything related to the tilemap menu building part.

TileMapMenuSaveAndLoadTabs is pretty empty currently but not for long !

PR checklist

  • The game builds properly without errors.
  • No unrelated changes are present.
  • No "trash" files are committed.
  • Relevant code is documented.
  • Update the related GitBook document, or create a new one if needed.

Pictures/Videos)

Testing

Networking checklist

  • Works from host in host mode.
  • Works from server in server mode.
  • Works on server in client mode.
  • Works and is syncronized across different clients.
  • Is persistent.

Changes

I had to fix a bunch of stuff related to asset databases because of a few merges. It's throwing an exception regarding item id (with no gameplay consequences) , I got a fix for that but it's already in "add toolbelt PR". Sorry the PR is a bit messy but can't do more, I've no idea how the body part assets were working before, as they were somehow referenced by two addressable groups which should not be possible. As discussed in #1349 , solution is to have a unique asset database for game objects.

Related issues/PRs

TODO

  • rename build ghost to construction hologram
  • document construction hologram

@stilnat stilnat changed the title Refactor the tilemap menu [WIP] Refactor the tilemap menu Nov 23, 2023
@stilnat stilnat changed the title [WIP] Refactor the tilemap menu Refactor the tilemap menu Nov 24, 2023
@cosmiccoincidence cosmiccoincidence added the Tilemaps Tasks related to the tilemap system or its connectors. label Nov 24, 2023
iamteapot422
iamteapot422 previously approved these changes Nov 30, 2023
Copy link
Contributor

@iamteapot422 iamteapot422 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff
Closes #1358

@cosmiccoincidence cosmiccoincidence linked an issue Nov 30, 2023 that may be closed by this pull request
@iamteapot422 iamteapot422 merged commit 63eeeab into RE-SS3D:develop Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tilemaps Tasks related to the tilemap system or its connectors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tilemap hologram isn't updating upon rotation
3 participants