Poodletooth-iLand/toontown/nametag/NametagGlobals.py

248 lines
8.6 KiB
Python
Raw Normal View History

2015-03-03 16:10:12 -06:00
from pandac.PandaModules import VBase4
2015-05-30 11:09:41 -05:00
from otp.otpbase import OTPGlobals
2015-03-03 16:10:12 -06:00
CCNormal = 0
2015-05-30 11:09:41 -05:00
CCNonPlayer = 1
CCSuit = 2
CCToonBuilding = 3
CCSuitBuilding = 4
CCHouseBuilding = 5
CCSpeedChat = 6
2015-06-02 12:07:50 -05:00
CCAdmin = 7
2015-03-03 16:10:12 -06:00
CHAT = 0
SPEEDCHAT = 1
CHAT_BALLOON = 0
THOUGHT_BALLOON = 1
cardModel = None
arrowModel = None
chatBalloon3dModel = None
chatBalloon3dWidth = 0
chatBalloon3dHeight = 0
chatBalloon2dModel = None
chatBalloon2dWidth = 0
chatBalloon2dHeight = 0
thoughtBalloonModel = None
thoughtBalloonWidth = 0
thoughtBalloonHeight = 0
noButton = (None, None, None, None)
pageButton = (None, None, None, None)
quitButton = (None, None, None, None)
quitButtonWidth = 0
quitButtonHeight = 0
rolloverSound = None
clickSound = None
me = None
want2dNametags = True
forceOnscreenChat = False
force2dNametags = False
wantActiveNametags = True
def setCardModel(model):
global cardModel
cardModel = loader.loadModel(model)
def setArrowModel(model):
global arrowModel
arrowModel = loader.loadModel(model)
def setChatBalloon3dModel(model):
global chatBalloon3dModel
global chatBalloon3dWidth
global chatBalloon3dHeight
chatBalloon3dModel = loader.loadModel(model)
chatBalloon3dWidth, chatBalloon3dHeight = getModelWidthHeight(chatBalloon3dModel)
def setChatBalloon2dModel(model):
global chatBalloon2dModel
global chatBalloon2dWidth
global chatBalloon2dHeight
chatBalloon2dModel = loader.loadModel(model)
chatBalloon2dWidth, chatBalloon2dHeight = getModelWidthHeight(chatBalloon2dModel)
def setThoughtBalloonModel(model):
global thoughtBalloonModel
global thoughtBalloonWidth
global thoughtBalloonHeight
thoughtBalloonModel = loader.loadModel(model)
thoughtBalloonWidth, thoughtBalloonHeight = getModelWidthHeight(thoughtBalloonModel)
def setPageButton(normal, down, rollover, disabled):
global pageButton
pageButton = (normal, down, rollover, disabled)
def setQuitButton(normal, down, rollover, disabled):
global quitButton
global quitButtonWidth
global quitButtonHeight
quitButton = (normal, down, rollover, disabled)
quitButtonWidth, quitButtonHeight = getModelWidthHeight(normal)
def setRolloverSound(sound):
global rolloverSound
rolloverSound = sound
def setClickSound(sound):
global clickSound
clickSound = sound
def setMe(nodePath):
global me
me = nodePath
def setWant2dNametags(value):
global want2dNametags
want2dNametags = value
def setForceOnscreenChat(value):
global forceOnscreenChat
forceOnscreenChat = value
def setForce2dNametags(value):
global force2dNametags
force2dNametags = value
def setWantActiveNametags(value):
global wantActiveNametags
wantActiveNametags = value
def getModelWidthHeight(model):
tightBounds = model.getTightBounds()
if tightBounds is None:
return (0, 0)
minPoint, maxPoint = tightBounds
width = maxPoint.getX() - minPoint.getX()
height = maxPoint.getZ() - minPoint.getZ()
return (width, height)
2015-06-02 12:44:55 -05:00
def getFriendColor(handle):
if handle.isAdmin():
return CCAdmin
elif settings['trueFriends'] and base.localAvatar.isTrueFriends(handle.doId):
return CCNormal
return CCSpeedChat
2015-03-03 16:10:12 -06:00
# Foreground, background:
NametagColors = {
2015-05-30 11:09:41 -05:00
CCNormal: ( # Blue
2015-03-03 16:10:12 -06:00
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(1.0, 1.0, 1.0, 0.375)) # Disabled
),
2015-05-30 11:09:41 -05:00
CCNonPlayer: ( # Orange
2015-03-03 16:10:12 -06:00
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.1875)), # Down
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.5625)), # Rollover
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
),
CCSuit: (
2015-04-09 09:05:57 -05:00
(VBase4(0.2, 0.2, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.2, 0.2, 0.2, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
(VBase4(0.4, 0.4, 0.4, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
(VBase4(0.2, 0.2, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Disabled
VBase4(0.8, 0.4, 0.0, 1.0) # Arrow color
2015-03-03 16:10:12 -06:00
),
CCSuitBuilding: (
(VBase4(0.5, 0.5, 0.5, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.5, 0.5, 0.5, 1.0), VBase4(0.8, 0.8, 0.8, 0.1875)), # Down
(VBase4(0.5, 0.5, 0.5, 1.0), VBase4(0.8, 0.8, 0.8, 0.5625)), # Rollover
(VBase4(0.5, 0.5, 0.5, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
),
CCToonBuilding: (
(VBase4(0.2, 0.6, 0.9, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.2, 0.6, 0.9, 1.0), VBase4(0.8, 0.8, 0.8, 0.1875)), # Down
(VBase4(0.2, 0.6, 0.9, 1.0), VBase4(0.8, 0.8, 0.8, 0.5625)), # Rollover
(VBase4(0.2, 0.6, 0.9, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
),
CCHouseBuilding: (
(VBase4(0.2, 0.6, 0.9, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.2, 0.2, 0.5, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
),
2015-05-30 11:09:41 -05:00
CCSpeedChat: ( # Green
2015-03-03 16:10:12 -06:00
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.0, 0.5, 0.0, 1.0), VBase4(0.5, 0.5, 0.5, 0.1875)), # Down
(VBase4(0.0, 0.7, 0.2, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
2015-06-02 12:07:50 -05:00
),
CCAdmin: ( # Purple
(VBase4(0.7, 0.3, 0.7, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
(VBase4(0.7, 0.3, 0.7, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
(VBase4(1.0, 0.5, 0.9, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
(VBase4(0.7, 0.3, 0.7, 1.0), VBase4(1.0, 1.0, 1.0, 0.375)) # Disabled
2015-03-03 16:10:12 -06:00
)
}
# Foreground, background:
ChatColors = {
CCNormal: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
),
CCNonPlayer: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Click
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
),
CCSuit: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
),
CCSuitBuilding: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
),
CCToonBuilding: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
),
CCHouseBuilding: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
),
CCSpeedChat: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
2015-06-02 12:07:50 -05:00
),
CCAdmin: (
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
2015-03-03 16:10:12 -06:00
)
}