Widget styles dmd_big, dmd_med and dmd_small not found

26 views
Skip to first unread message

Andrew B

unread,
Jan 25, 2020, 12:39:52 AM1/25/20
to MPF Users
Hey guys, 

Since updating to 0.53.1 today I'm seeing an issue when my game reaches high score entry mode.

I have a mode called "high_score" which basically the one shown in the documentation: http://docs.missionpinball.org/en/latest/game_logic/high_scores/index.html

When the game reaches the high score mode it encounters an exception.

MPF LOG 
---------------------
2020-01-25 16:28:48,727 : INFO : EventManager : Event: ======'player_turn_will_end'====== Args={'player': <Player 1>, 'number': 1}
2020-01-25 16:28:48,786 : INFO : EventManager : Event: ======'player_turn_ending'====== Args={'player': <Player 1>, 'number': 1}
2020-01-25 16:28:48,788 : INFO : EventManager : Event: ======'player_turn_ended'====== Args={'player': <Player 1>, 'number': 1}
2020-01-25 16:28:48,789 : INFO : EventManager : Event: ======'game_will_end'====== Args={}
2020-01-25 16:28:48,790 : INFO : EventManager : Event: ======'game_ending'====== Args={}
2020-01-25 16:28:48,791 : INFO : EventManager : Event: ======'mode_high_score_will_start'====== Args={'queue': <QueuedEvent>}
2020-01-25 16:28:48,793 : INFO : EventManager : Event: ======'mode_high_score_starting'====== Args={'queue': <QueuedEvent>}
2020-01-25 16:28:48,794 : INFO : Mode.high_score : Started. Priority: 500
2020-01-25 16:28:48,794 : INFO : EventManager : Event: ======'mode_high_score_started'====== Args={'queue': <QueuedEvent>}
2020-01-25 16:28:48,795 : INFO : Mode.high_score : New high score. Player: <Player 1>, award_label: HIGH SCORE 1, Value: 500440
2020-01-25 16:28:48,796 : INFO : EventManager : Event: ======'high_score_enter_initials'====== Args={'award': 'HIGH SCORE 1', 'player_num': 1, 'value': 500440}
2020-01-25 16:28:49,463 : INFO : Machine : Shutting down...



MC LOG
----------------------------
2020-01-25 16:28:49,036 : mpfmc : SlidePlayer: Play called with settings={'high_score_enter_initials': {'target': None, 'background_color': [0.0, 0.0, 0.0, 1.0], 'priority': None, 'show': True, 'force': False, 'expire': None, 'slide': None, 'tokens': {}, 'action': 'play'}}
2020-01-25 16:28:49,060 : kivy : Base: Leaving application in progress...
2020-01-25 16:28:49,060 : kivy : Exception while processing RegisteredHandler(callback=<bound method McConfigPlayer.play_from_trigger of McConfigPlayer.slides>, priority=1, kwargs={}, key=UUID('d7e74add-d4ac-492b-a081-4b59f5911f77'), condition=None, blocking_facility=None) for event slides_play
Traceback (most recent call last):
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\widget.py", line 389, in _apply_style
    styles
= [self.mc.machine_config['widget_styles'][s] for s in self.config['style']]
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\widget.py", line 389, in <listcomp>
    styles
= [self.mc.machine_config['widget_styles'][s] for s in self.config['style']]
KeyError: 'dmd_big'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpf\core\events.py", line 665, in _run_handlers
    result
= handler.callback(**merged_kwargs)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\core\mc_config_player.py", line 56, in play_from_trigger
   
self.play(settings=settings, context=context, calling_context=calling_context, priority=priority, **kwargs)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\config_players\slide_player.py", line 161, in play
    target
.show_slide(slide_name=slide, key=full_context, play_kwargs=s['tokens'], **s)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\display.py", line 349, in show_slide
    play_kwargs
=play_kwargs)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\display.py", line 309, in add_slide
    play_kwargs
=play_kwargs)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\slide.py", line 67, in __init__
    play_kwargs
=play_kwargs)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\widget.py", line 909, in create_widget_objects_from_config
    mc
=mc, config=widget, key=this_key, play_kwargs=play_kwargs)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\widgets\text.py", line 82, in __init__
   
super().__init__(mc=mc, config=config, key=key)
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\widget.py", line 102, in __init__
   
self._apply_style()
 
File "c:\users\andrew\appdata\local\programs\python\python36\lib\site-packages\mpfmc\uix\widget.py", line 397, in _apply_style
   
self, e))
ValueError: <Text Widget text=> has an invalid style name: 'dmd_big'

It can't find the dmd_big style. I'm guessing this is being referenced by the built in high_score mode? If I add a placeholder dmd_big style, I get the same error but for dmd_small and dmd_med.

If I add place holder styles for all 3, my high_score mode plays out without error.

Why would these 3 build in font styles not be found in my 0.53.1 update?

Cheers,

Andrew.



Kevin

unread,
Jan 25, 2020, 3:14:40 AM1/25/20
to MPF Users
Hi Andrew and fellow MPF'ers,

I just started out with 0.53 and followed the tutorials and I also encountered this issue.

I discovered that the style names seem to have been changed and created a pull request in mpf-docs to correct this change. Please let me know if this was not the correct procedure to follow.

the styles seem to have been renamed:
- from `dmd_big` to `big`
- from `dmd_med` to `med`
- from `dmd_small` to `small`

Kind regards,

Kevin

Op zaterdag 25 januari 2020 06:39:52 UTC+1 schreef Andrew B:

Andrew B

unread,
Jan 25, 2020, 7:04:11 AM1/25/20
to MPF Users
Hey Kevin,

Thanks for having a look. 

I did some digging too and found that the built in high_score.yaml config references styles named "small", "medium" and "big"


So I think your change of "dmd_med" references to "med" should be "medium".

Cheers,

Andrew.

jabdoa

unread,
Jan 25, 2020, 5:21:14 PM1/25/20
to MPF Users
Hey guys.

Thanks for reporting this and for the PR. And yes I renamed the default styles. The reason for that is that we want to be able to use the same modes for DMD and LCD machines by just changing the style definitions (to a certain extend). I missed those references in the docs because they are not tested (because they are incomplete configs). I will change that to make sure we do not break it again in the future. As you know: If it ain't tested consider it broken.

Anyways help in this area is welcome. I'm not so much of a visual guy or a good GUI/frontend developer. The default slides in those modes could use some love. If you are interested in that area there are a quite a few things to improve.

Jan

Andrew B

unread,
Jan 25, 2020, 5:35:12 PM1/25/20
to MPF Users
Thanks for the reply Jan.

As I get more familiar with the framework, I'll certainly look to help contribute with pull requests and perhaps some updates to some areas of MPF that need some love. Right though now I'm still very new to MPF, so better off looking but not touching :)

jabdoa

unread,
Feb 8, 2020, 9:06:08 AM2/8/20
to MPF Users
I merged your PR and added tests to all the examples. We should at least notice when we break those the next time. Found and fixed a few other examples along the way, too.

Jan
Reply all
Reply to author
Forward
0 new messages