Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions pooltool/ani/modes/pick_ball.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def exit(self):
tasks.remove("pick_ball_task")

def pick_ball_task(self, task):
raise NotImplementedError("Woops, this is in a broken state, don't press that")

if not self.keymap[Action.pick_ball]:
Global.mode_mgr.change_mode(Mode.aim)
return task.done
Expand All @@ -55,19 +53,21 @@ def pick_ball_task(self, task):
if closest != self.closest_ball:
self.remove_ball_highlight()
self.closest_ball = closest
self.ball_highlight = self.closest_ball.get_node("pos")
self.add_ball_highlight()
if self.closest_ball is not None:
self.ball_highlight = self.closest_ball.get_node("pos")
self.add_ball_highlight()

if self.keymap["done"]:
self.remove_ball_highlight()
ball_id = self.closest_ball._ball.id
if ball_id is not None:
multisystem.active.cue.cue_ball_id = ball_id
visual.cue.init_focus(visual.balls[ball_id])
Global.game.log.add_msg(
f"Now cueing the {multisystem.active.cue.cue_ball_id} ball",
sentiment="neutral",
)
if self.closest_ball is not None:
self.remove_ball_highlight()
ball_id = self.closest_ball._ball.id
if ball_id is not None:
multisystem.active.cue.cue_ball_id = ball_id
visual.cue.init_focus(visual.balls[ball_id])
Global.game.log.add_msg(
f"Now cueing the {multisystem.active.cue.cue_ball_id} ball",
sentiment="neutral",
)
Global.mode_mgr.change_mode(Mode.aim)
return task.done

Expand Down