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

Buying fuel at space stations does not update the displayed balance #221

Open
BarthPaleologue opened this issue Dec 17, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@BarthPaleologue
Copy link
Owner

BarthPaleologue commented Dec 17, 2024

Describe the bug

The space station UI is not updated correctly after buying fuel.

To Reproduce

Steps to reproduce the behavior:

  1. Go to a space station
  2. Click on refuel
  3. The displayed balance is not updated

Expected behavior

The displayed balance should be updated to display less credits as fuel has been paid.

Additional context

Save file: Barth_1734473075025.json

@BarthPaleologue BarthPaleologue added bug Something isn't working good first issue Good for newcomers labels Dec 17, 2024
@Parkerrino
Copy link

Hey, I would like to look into it if thats fine with you ;)

@BarthPaleologue
Copy link
Owner Author

Hey there! Thanks for your interest :)

I can definitely assign the issue to you, all the help is welcomed!

I was about to write more details about the issue when I recieved your message so here they are:

  • make balance private in
    balance: number;
    (like name)
  • create onBalanceChangedObservable next to onNameChangedObservable in the same file for Player
  • create getBalance, setBalance, pay, earn methods in the same file for Player, make sure to trigger the observable in setBalance and use setBalance in pay and earn
  • fix errors caused by making balance private using the new methods
  • in SpaceStationLayer , use the observable newly created to call updatePlayerBalance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants