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

Show machine and player variables in Text UI #1119

Closed
jabdoa2 opened this issue Mar 12, 2018 · 7 comments

Comments

@jabdoa2
Copy link
Collaborator

commented Mar 12, 2018

Show variables in the text UI. Show all by default. Make it configurable to always show certain vars on top (because space is limited)

@woosle1234

This comment has been minimized.

Copy link

commented Mar 14, 2019

I would like to try to implement this issue. Can you explain a bit more about what variables you want? and how do you want the configurable variables to work?

@jabdoa2

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 14, 2019

Hi Woosle,

The idea is to show all machine variables (https://github.com/missionpinball/mpf/blob/dev/mpf/core/machine.py#L792) and player variables (https://github.com/missionpinball/mpf/blob/dev/mpf/core/player.py). Machine vars are generally accessible via self.machine.machine_var. Player vars are accessible (during a game only) via self.machine.game.player.vars.

The text UI is rendered here: https://github.com/missionpinball/mpf/blob/dev/mpf/core/text_ui.py

@woosle1234

This comment has been minimized.

Copy link

commented Apr 10, 2019

So would that mean I would have to update the def _draw_player_header(self): in the text_ui.py and add in self.machine.machine_var and self.machine.game.player.vars. in there?

@jabdoa2

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 10, 2019

Either there or in _update_player. There should be some space left there.

@woosle1234

This comment has been minimized.

Copy link

commented Apr 10, 2019

Is there a way to get all the variables for machine and player? I'm thinking of using a for loop or would I have to declare each name? Also is the documentation on the player and machine variables correct in listing all the variables?

@jabdoa2

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 10, 2019

The documentation is mostly accurate but there might be more during running. I guess we could to add a getter for all machine variables and player vars. However, you could also loop over the variable i listed in my earlier post. That kind of bypasses the getter.

@jabdoa2

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 24, 2019

fixed by #1328

@jabdoa2 jabdoa2 closed this Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.