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

Modular building rework #351

Merged
merged 9 commits into from
Sep 12, 2023
Merged

Modular building rework #351

merged 9 commits into from
Sep 12, 2023

Conversation

TecCheck
Copy link
Member

@TecCheck TecCheck commented Aug 31, 2023

This fixes a few issues that my old code had. It's almost a complete rewrite. Not sure if BuildBorderComponent is needed.

TODOs:

  • Implement pick up mechanic
  • Remove log statements
  • Remove BuildMode enum
  • Maybe remove BuildBorderComponent
  • Implement and use PushEquippedItemState and PopEquippedItemState
  • Heal player when popping item state
    Exit build session if player leaves server
  • Documentation
    • ModularBuildingHandler
    • ModularBuilderComponent

@TecCheck TecCheck marked this pull request as ready for review August 31, 2023 23:40
@EmosewaMC
Copy link

as a note, if its not already done, when you pop the equipped items, you need to heal the player to full stats.

@TecCheck
Copy link
Member Author

TecCheck commented Sep 1, 2023

I didn't know that. Thanks 👍

@TecCheck
Copy link
Member Author

TecCheck commented Sep 3, 2023

I just noticed, that I reformatted InventoryComponent.cs and InventoryHandler.cs. Is that OK or should I revert that?

@TecCheck TecCheck self-assigned this Sep 4, 2023
@TecCheck
Copy link
Member Author

TecCheck commented Sep 7, 2023

I think this is ready for review. If everything works, I'll remove all or most of the log statements

Copy link
Member

@enteryournamehere enteryournamehere left a comment

Choose a reason for hiding this comment

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

Works great! Just two questions 🙂

@enteryournamehere
Copy link
Member

Btw, not a new issue I think, just something to note & be fixed at some point, doesn't need to be now:

If you close your client while building (I did because mine froze, but I couldn't reproduce that) and restart, you can walk around with the thinking cap on & a rocket part in your arms. You can enter + leave the building area again to get rid of it. I think ideally it should call ModularBuilderComponent.ConfirmBuildExit() so that the player gets their original rocket back instead of the loose parts. Screenshot_20230910_163457

@TecCheck
Copy link
Member Author

TecCheck commented Sep 11, 2023

I think ideally it should call ModularBuilderComponent.ConfirmBuildExit() so that the player gets their original rocket back instead of the loose parts.

I think, I will implement this as well. It fits the PR.

EDIT: Btw you can just hit ALT F4 to close the game and it will end up in the same state as you described.

@TecCheck
Copy link
Member Author

Ok never mind. Currently it's not possible to revert the state of the player once they left because the server crashes when it tries to send messages to that player. For this to work, the server would need to catch null pointer and just not send anyting

@TecCheck TecCheck merged commit d0ccc63 into dev Sep 12, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants