0.3.1 hotfix: doesnt throw the stick back when action key is changed

This commit is contained in:
DESKTOP-JVKHS7I\Adam 2020-05-12 11:46:36 +05:30
parent bb83a33b82
commit 66eeb9d6f8
3 changed files with 6 additions and 3 deletions

View File

@ -1,2 +1,2 @@
from fishy.__main__ import main
__version__ = "0.3.0"
__version__ = "0.3.1"

View File

@ -50,7 +50,7 @@ class Fishy:
# initializes fishing modes and their callbacks
FishingMode("hook", 0, HookEvent(action_key, collect_r))
FishingMode("stick", 1, StickEvent())
FishingMode("look", 2, LookEvent())
FishingMode("look", 2, LookEvent(action_key))
FishingMode("idle", 3, IdleEvent(self.config.get("uid")))
self.fishPixWindow = Window(color=cv2.COLOR_RGB2HSV)

View File

@ -58,12 +58,15 @@ class LookEvent(FishEvent):
state when looking on a fishing hole
"""
def __init__(self, action_key: str):
self.action_key = action_key
def onEnterCallback(self, previousMode):
"""
presses e to throw the fishing rod
:param previousMode: previous mode in the state machine
"""
pyautogui.press('e')
pyautogui.press(self.action_key)
def onExitCallback(self, currentMode):
pass