Instructions in polyline tools were moved to the status bar.

Previously the instructions were shown on screen with decorators. Now it is handled by the modal function of the polyline tools.
This commit is contained in:
Bruno Perdigão
2024-09-09 22:27:24 -03:00
parent c06929e1c7
commit 794154f6f5
4 changed files with 38 additions and 40 deletions
@@ -2283,18 +2283,22 @@ class MeasureTool(bpy.types.Operator, PolylineOperator):
self.input_ui = tool.Polyline.create_input_ui(init_z=True)
self.input_options = ["D", "A", "X", "Y", "Z"]
self.instructions = """TAB: Cycle Input
M: Modify Snap Point
C: Close
Backspace: Remove
X Y Z: Axis
S-(X Y Z): Plane
Shift: Lock axis
"""
D: Distance Input
A: Angle Input
M: Modify Snap Point
C: Close Polyline
BACKSPACE: Remove Point
X, Y, Z: Choose Axis
S-X, S-Y, S-Z: Choose Plane
SHIFT: Lock axis
"""
def modal(self, context, event):
if event.type in {"MIDDLEMOUSE", "WHEELUPMOUSE", "WHEELDOWNMOUSE"}:
return {"PASS_THROUGH"}
self.handle_instructions(context)
self.handle_mouse_move(context, event)
self.choose_axis(event, z=True)
@@ -2304,6 +2308,7 @@ class MeasureTool(bpy.types.Operator, PolylineOperator):
self.handle_snap_selection(context, event)
if not self.tool_state.is_input_on and event.value == "RELEASE" and event.type in {"RET", "NUMPAD_ENTER", "RIGHTMOUSE"}:
context.workspace.status_text_set(text=None)
PolylineDecorator.uninstall()
tool.Snap.clear_polyline()
tool.Blender.update_viewport()