<commit_before># GuiGlobals.py : global info for the gui package

from ShowBaseGlobal import *
import GuiManager

guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(),
                                      base.render2d.node())

font = None
sndClick = None
sndRollover = None
panel = None
drawOrder = 100

def getDefaultFont():
    global font
    if font == None:
        font = loader.loadModelNode("models/fonts/Comic")
    return font

def setDefaultFont(newFont):
    global font
    font = newFont

def getDefaultPanel():
    return panel

def setDefaultPanel(newPanel):
    global panel
    panel = newPanel

def getDefaultDrawOrder():
    return drawOrder

def setDefaultDrawOrder(newDrawOrder):
    global drawOrder
    drawOrder = newDrawOrder

def getDefaultRolloverSound():
    global sndRollover
    if sndRollover == None:
        sndRollover = base.loadSfx("phase_3/audio/sfx/GUI_rollover.mp3")
    return sndRollover

def getDefaultClickSound():
    global sndClick
    if sndClick == None:
        sndClick = base.loadSfx("phase_3/audio/sfx/GUI_create_toon_fwd.mp3")
    return sndClick

def getNewRolloverFunctor(sound = None):
    val = None
    if sound:
        roll = sound
    else:
        roll = getDefaultRolloverSound()
    if roll:
        val = AudioGuiFunctor(roll)
    else:
        val = AudioGuiFunctor()
    return val

def getNewClickFunctor(sound = None):
    val = None
    if sound:
        click = sound
    else:
        click = getDefaultClickSound()
    if click:
        val = AudioGuiFunctor(click)
    else:
        val = AudioGuiFunctor()
    return val
<commit_msg>take turning on/off sfx into account<commit_after># GuiGlobals.py : global info for the gui package

from ShowBaseGlobal import *
import GuiManager

guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(),
                                      base.render2d.node())

font = None
sndClick = None
sndRollover = None
panel = None
drawOrder = 100

def getDefaultFont():
    global font
    if font == None:
        font = loader.loadModelNode("models/fonts/Comic")
    return font

def setDefaultFont(newFont):
    global font
    font = newFont

def getDefaultPanel():
    return panel

def setDefaultPanel(newPanel):
    global panel
    panel = newPanel

def getDefaultDrawOrder():
    return drawOrder

def setDefaultDrawOrder(newDrawOrder):
    global drawOrder
    drawOrder = newDrawOrder

def getDefaultRolloverSound():
    global sndRollover
    if sndRollover == None:
        sndRollover = base.loadSfx("phase_3/audio/sfx/GUI_rollover.mp3")
    if base.wantSfx:
        return sndRollover
    else:
        return None

def getDefaultClickSound():
    global sndClick
    if sndClick == None:
        sndClick = base.loadSfx("phase_3/audio/sfx/GUI_create_toon_fwd.mp3")
    if base.wantSfx:
        return sndClick
    else:
        return None

def getNewRolloverFunctor(sound = None):
    val = None
    if sound:
        roll = sound
    else:
        roll = getDefaultRolloverSound()
    if roll:
        val = AudioGuiFunctor(roll)
    else:
        val = AudioGuiFunctor()
    return val

def getNewClickFunctor(sound = None):
    val = None
    if sound:
        click = sound
    else:
        click = getDefaultClickSound()
    if click:
        val = AudioGuiFunctor(click)
    else:
        val = AudioGuiFunctor()
    return val

{'fraction_non_alphanumeric': 0.07901746078721515, 'fraction_numerical': 0.004735128736312519, 'mean_word_length': 2.654054054054054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7432918', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1034, 'n_words': 271}