Skip to content

Commit

Permalink
fix - cant use self.speak_dialog for bundled resource files from ovos…
Browse files Browse the repository at this point in the history
…-workshop
  • Loading branch information
JarbasAl committed Dec 18, 2024
1 parent 127a0bf commit 2d52f5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ovos_workshop/skills/game_skill.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from ovos_workshop.decorators import ocp_featured_media, ocp_search
from ovos_workshop.skills.common_play import OVOSCommonPlaybackSkill
from ovos_workshop.skills.ovos import _get_dialog


class OVOSGameSkill(OVOSCommonPlaybackSkill):
Expand Down Expand Up @@ -141,27 +142,31 @@ class ConversationalGameSkill(OVOSGameSkill):

def on_save_game(self):
"""skills can override method to implement functioonality"""
self.speak_dialog("cant_save_game")
speech = _get_dialog("cant_save_game", self.lang)
self.speak(speech)

def on_load_game(self):
"""skills can override method to implement functioonality"""
self.speak_dialog("cant_load_game")
speech = _get_dialog("cant_load_game", self.lang)
self.speak(speech)

def on_pause_game(self):
"""called by ocp_pipeline on 'pause' if game is being played"""
self._paused.set()
self.acknowledge()
# individual skills can change default value if desired
if self.settings.get("pause_dialog", False):
self.speak_dialog("game_pause")
speech = _get_dialog("game_pause", self.lang)
self.speak(speech)

def on_resume_game(self):
"""called by ocp_pipeline on 'resume/unpause' if game is being played and paused"""
self._paused.clear()
self.acknowledge()
# individual skills can change default value if desired
if self.settings.get("pause_dialog", False):
self.speak_dialog("game_unpause")
speech = _get_dialog("game_unpause", self.lang)
self.speak(speech)

@abc.abstractmethod
def on_play_game(self):
Expand Down

0 comments on commit 2d52f5c

Please sign in to comment.