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

Progress Bar Causes HUD to hang when attempting to start development mode #27

Open
tararoys opened this issue Jun 2, 2022 · 1 comment

Comments

@tararoys
Copy link

tararoys commented Jun 2, 2022

The Problem

In development mode, when you make a change to a talon hud walkthrough (either a markdown or a json walkthrough, it doesn't matter which) Talon HUD walkthrough widgit freezes, loses all text, is unresponsive to mouse clicks and drags, and forces a complete restart of Talon.

Expected behavior is to update the walkthrough step with the change.

The temporary fix:

commenting out the progress bar code, and specifically, lines 418 to line 422, in walkthroughpanel.py makes it so that any changes to a walkthrough appear immediately after saving the change.

            # Draw the progress bar
            #paint.color = self.theme.get_colour("spoken_voice_command_background_colour", "6CC653")
            #rect = ui.Rect(dimensions["rect"].x + progress_bar_offset, dimensions["rect"].y, \
            #    min(dimensions["rect"].width - progress_bar_offset * 2, (dimensions["rect"].width  - progress_bar_offset * 2) * ( current_walkthrough_step.progress.percent * 0.01 )), progress_bar_height)
            #canvas.draw_rect(rect)

This makes everything function normally at the cost of disabling the progress bar. Progress bar can be re-enabled when you are not in development mode.

Bug reproduction

On windows 10:

  1. after saying head up develompent start
  2. open any walkthrough
  3. Open any walkthrough in vscode
  4. make a change to the walkthrough file in vscode
  5. The walkthrough panel will turn blank, become unresponsive, and refuse voice commands and mouse clicks

The following error appears in the log

AttributeError: 'NoneType' object has no attribute 'percent'
2022-06-02 10:21:49 ERROR cb error topic="draw" cb=<bound method BaseWidget.draw_cycle of <user.talon_hud.widgets.walkthroughpanel.HeadUpWalkthroughPanel object at 0x00000000300E69A0>>
    9:                            talon\canvas.py:17 | 
    8:                            talon\canvas.py:164| 
    7:                talon\scripting\dispatch.py:144| 
    6:                talon\scripting\dispatch.py:135| 
    5: ----------------------------------------------# [stack splice]
    4:                    talon\scripting\rctx.py:233| # 'draw' user.talon_hud.reloader:draw_cycle()
    3:              user\talon_hud\base_widget.py:217| continue_drawing = self.draw(canvas)
    2:            user\talon_hud\layout_widget.py:168| continue_drawing = self.draw_content(c..
    1: user\talon_hud\widgets\walkthroughpanel.py:421| min(dimensions["rect"].width - progress_bar_offset * 2, (dimensions["rect"].width  - progress_bar_offset * 2) * ( current_walkthrough_step.progress.percent * ..
AttributeError: 'NoneType' object has no attribute 'percent'
2022-06-02 10:21:49 ERROR cb error topic="draw" cb=<bound method BaseWidget.draw_cycle of <user.talon_hud.widgets.walkthroughpanel.HeadUpWalkthroughPanel object at 0x00000000300E69A0>>
    9:                            talon\canvas.py:17 | 
    8:                            talon\canvas.py:164| 
    7:                talon\scripting\dispatch.py:144| 
    6:                talon\scripting\dispatch.py:135| 
    5: ----------------------------------------------# [stack splice]
    4:                    talon\scripting\rctx.py:233| # 'draw' user.talon_hud.reloader:draw_cycle()
    3:              user\talon_hud\base_widget.py:217| continue_drawing = self.draw(canvas)
    2:            user\talon_hud\layout_widget.py:168| continue_drawing = self.draw_content(c..
    1: user\talon_hud\widgets\walkthroughpanel.py:421| min(dimensions["rect"].width - progress_bar_offset * 2, (dimensions["rect"].width  - progress_bar_offset * 2) * ( current_walkthrough_step.progress.percent * ..
AttributeError: 'NoneType' object has no attribute 'percent'
@chaosparrot
Copy link
Owner

Just leaving a few links to your commits here so I can implement them later:
ttps://github.com/tararoys/talon_hud/commit/bb2c74156c0c01e0a5a771b2719a89c341c74c37

tararoys@ca3d3d6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants