diff --git a/direct/src/gui/Button.py b/direct/src/gui/Button.py index 12bde2fc14..645e34532b 100644 --- a/direct/src/gui/Button.py +++ b/direct/src/gui/Button.py @@ -5,11 +5,10 @@ import GuiLabel import GuiButton guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.node()) -font = loader.loadModelNode("phase_3/models/fonts/ttf-comic") class Button(DirectObject): - def __init__(self, name, label=None): + def __init__(self, name, label=None, font=interfaceFont): self.name = name # if no label given, use the button name if (label == None): diff --git a/direct/src/gui/ScrollingLabel.py b/direct/src/gui/ScrollingLabel.py index ef706c661d..5837b66b78 100644 --- a/direct/src/gui/ScrollingLabel.py +++ b/direct/src/gui/ScrollingLabel.py @@ -6,12 +6,12 @@ import Button import GuiLabel import Sign -font = (loader.loadModelOnce("phase_3/models/fonts/ttf-comic")).node() + class ScrollingLabel(PandaObject.PandaObject): # special methods - def __init__(self, name, itemList): + def __init__(self, name, itemList, font=interfaceFont): self.name = name self.eventName = self.name diff --git a/direct/src/gui/Sign.py b/direct/src/gui/Sign.py index 8b942a9274..e4a9cbab45 100644 --- a/direct/src/gui/Sign.py +++ b/direct/src/gui/Sign.py @@ -6,11 +6,9 @@ import GuiLabel guiMgr = GuiManager.GuiManager.getPtr(base.win, base.mak.node(), base.renderGui.node()) -font = (loader.loadModelOnce("phase_3/models/fonts/ttf-comic")).node() - class Sign(DirectObject): - def __init__(self, name, label=None): + def __init__(self, name, label=None, font=interfaceFont): self.name = name # label in this case means GuiLabel if not label: diff --git a/direct/src/showbase/ShowBaseGlobal.py b/direct/src/showbase/ShowBaseGlobal.py index 8642fd7419..aea6e51a1a 100644 --- a/direct/src/showbase/ShowBaseGlobal.py +++ b/direct/src/showbase/ShowBaseGlobal.py @@ -18,3 +18,7 @@ __builtin__.taskMgr = base.taskMgr __builtin__.eventMgr = base.eventMgr __builtin__.messenger = base.messenger __builtin__.config = base.config + +# Pointer to interface font +import ToontownGlobals +__builtin__.interfaceFont = ToontownGlobals.getInterfaceFont()