Tool Ren'Py How to make TTS text invisible when it is enabled?

Rycharde's Realm

Well-Known Member
Game Developer
Jan 17, 2018
1,141
774
I'm looking for a way of making the TTS disable string (Self-voicing enabled. Press 'v' to disable.) when it is enabled invisible. Been looking through code, and Ren'Py online documents and tutorials, even here on F95, but no go. Here's hoping someone here knows. Thx.
 
  • Like
Reactions: LITE007

Bev_

Member
Nov 17, 2018
477
775
If I understood you correctly, what you'r looking for is in [gamefolder]/renpy/common/00preferences.rpy

Code:
init -1500:

    # The screen that we use to indicate that self-voicing is enabled.
    screen _self_voicing():
        zorder 1500

        if _preferences.self_voicing == "clipboard":
            $ message = _("Clipboard voicing enabled. Press 'shift+C' to disable.")
        elif _preferences.self_voicing == "debug":
            $ message = _("Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable.")
        else:
            $ message = _("Self-voicing enabled. Press 'v' to disable.")

        text message:
            alt ""

            xpos 10
            ypos 35
            color "#fff"
            outlines [ (1, "#0008", 0, 0)]
 
  • Like
Reactions: LITE007

Rycharde's Realm

Well-Known Member
Game Developer
Jan 17, 2018
1,141
774
Yes, you understood my meaning. So, if I understand Ren'Py enough, which I do not :LOL: , if I put in the screen _self_voicing() with $ message = _("") in place of those three $ message lines in a file like game/gui.rpy, that should remove the disable text?
 
  • Like
Reactions: LITE007

Bev_

Member
Nov 17, 2018
477
775
Yes, you understood my meaning. So, if I understand Ren'Py enough, which I do not :LOL: , if I put in the screen _self_voicing() with $ message = _("") in place of those three $ message lines in a file like game/gui.rpy, that should remove the disable text?
I'd just go to [gamefolder]/renpy/common/00preferences.rpy and edit that file, but I think copying this

Code:
init -1500:

    # The screen that we use to indicate that self-voicing is enabled.
    screen _self_voicing():
        zorder 1500

        if _preferences.self_voicing == "clipboard":
            $ message = _("Clipboard voicing enabled. Press 'shift+C' to disable.")
        elif _preferences.self_voicing == "debug":
            $ message = _("Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable.")
        else:
            $ message = _("")

        text message:
            alt ""

            xpos 10
            ypos 35
            color "#fff"
            outlines [ (1, "#0008", 0, 0)]
and pasting it in another file should work too.
 
  • Like
Reactions: LITE007

Rycharde's Realm

Well-Known Member
Game Developer
Jan 17, 2018
1,141
774
Yeah, the reason I am looking into putting the code into gui.rpy instead of changing 00preferences.rpy is because I am working on my own game and do not want to rewrite the Ren'Py code with every version I release.

BTW, I have copied a portion of the code to the game and it works fine.

Code:
# Removal of TTS disable text when it is enabled.
# For example, if using built-in TTS reader by pressing 'v', the text 'Self-voising enabled. Press 'v' to disable.' is removed from the screen.
# I REALLY hate this line. If you know how to enable the TTS reader or send text dialogue and such to the clipboard, you know how to disable it. SIGH!
screen _self_voicing():

    zorder 1500

    if _preferences.self_voicing == "clipboard":
        $ message = _("")
    elif _preferences.self_voicing == "debug":
        $ message = _("Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable.")
    else:
        $ message = _("")
Thank you for your help.