Current work

This commit is contained in:
John Cote 2015-06-24 13:19:10 -04:00
parent cadeff717d
commit 167c5c5736
8 changed files with 34 additions and 51 deletions

View file

@ -11,8 +11,8 @@ from otp.chat import ChatGarbler, TalkAssistant
from otp.distributed.TelemetryLimited import TelemetryLimited from otp.distributed.TelemetryLimited import TelemetryLimited
from otp.otpbase import OTPGlobals, OTPLocalizer from otp.otpbase import OTPGlobals, OTPLocalizer
from otp.speedchat import SCDecoders from otp.speedchat import SCDecoders
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.chat.WhisperPopup import WhisperPopup from otp.margins.WhisperPopup import WhisperPopup
class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBase, TelemetryLimited): class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBase, TelemetryLimited):
chatGarbler = ChatGarbler.ChatGarbler({'default': OTPLocalizer.ChatGarblerDefault}) chatGarbler = ChatGarbler.ChatGarbler({'default': OTPLocalizer.ChatGarblerDefault})
@ -114,7 +114,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
if self is localAvatar: if self is localAvatar:
return True return True
def setSystemMessage(self, aboutId, chatString, whisperType = WTSystem): def setSystemMessage(self, aboutId, chatString, whisperType = WhisperPopup.WTSystem):
self.displayWhisper(aboutId, chatString, whisperType) self.displayWhisper(aboutId, chatString, whisperType)
def displayWhisper(self, fromId, chatString, whisperType): def displayWhisper(self, fromId, chatString, whisperType):
@ -130,7 +130,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
return return
chatString = SCDecoders.decodeSCStaticTextMsg(msgIndex) chatString = SCDecoders.decodeSCStaticTextMsg(msgIndex)
if chatString: if chatString:
self.displayWhisper(fromId, chatString, WTNormal) self.displayWhisper(fromId, chatString, WhisperPopup.WTNormal)
return return
def whisperSCCustomTo(self, msgIndex, sendToId): def whisperSCCustomTo(self, msgIndex, sendToId):
@ -151,7 +151,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
return return
chatString = SCDecoders.decodeSCCustomMsg(msgIndex) chatString = SCDecoders.decodeSCCustomMsg(msgIndex)
if chatString: if chatString:
self.displayWhisper(fromId, chatString, WTNormal) self.displayWhisper(fromId, chatString, WhisperPopup.WTNormal)
def whisperSCEmoteTo(self, emoteId, sendToId): def whisperSCEmoteTo(self, emoteId, sendToId):
messenger.send('wakeup') messenger.send('wakeup')
@ -163,7 +163,7 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
return return
chatString = SCDecoders.decodeSCEmoteWhisperMsg(emoteId, handle.getName()) chatString = SCDecoders.decodeSCEmoteWhisperMsg(emoteId, handle.getName())
if chatString: if chatString:
self.displayWhisper(fromId, chatString, WTEmote) self.displayWhisper(fromId, chatString, WhisperPopup.WTEmote)
return return
def setChatAbsolute(self, chatString, chatFlags, dialogue = None, interrupt = 1, quiet = 0): def setChatAbsolute(self, chatString, chatFlags, dialogue = None, interrupt = 1, quiet = 0):

View file

@ -1,7 +1,7 @@
from direct.directnotify import DirectNotifyGlobal from direct.directnotify import DirectNotifyGlobal
from direct.showbase import DirectObject from direct.showbase import DirectObject
from otp.chat.ChatGlobals import * from otp.chat.ChatGlobals import *
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
import ChatUtil import ChatUtil
class TalkAssistant(DirectObject.DirectObject): class TalkAssistant(DirectObject.DirectObject):

View file

@ -16,7 +16,7 @@ from otp.distributed.OtpDoGlobals import *
from otp.distributed.TelemetryLimiter import TelemetryLimiter from otp.distributed.TelemetryLimiter import TelemetryLimiter
from otp.otpbase import OTPGlobals, OTPLocalizer from otp.otpbase import OTPGlobals, OTPLocalizer
from otp.otpgui import OTPDialog from otp.otpgui import OTPDialog
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
import sys, time, types, random import sys, time, types, random
class OTPClientRepository(ClientRepositoryBase): class OTPClientRepository(ClientRepositoryBase):

View file

@ -5,7 +5,7 @@ from direct.showbase import DirectObject
from panda3d.core import * from panda3d.core import *
from toontown.effects import DistributedFireworkShow from toontown.effects import DistributedFireworkShow
from toontown.nametag import NametagGlobals from otp.nametag import NametagGlobals
from toontown.parties import DistributedPartyFireworksActivity from toontown.parties import DistributedPartyFireworksActivity
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
@ -63,9 +63,11 @@ class ShtikerBook(DirectFrame, StateData.StateData):
base.disableMouse() base.disableMouse()
base.render.hide() base.render.hide()
base.setBackgroundColor(0.05, 0.15, 0.4) base.setBackgroundColor(0.05, 0.15, 0.4)
base.setCellsActive([base.rightCells[0]], 0) base.setCellsAvailable([base.rightCells[0]], 0)
NametagGlobals.setForce2dNametags(True) self.oldMin2dAlpha = NametagGlobals.getMin2dAlpha()
NametagGlobals.setForceOnscreenChat(True) self.oldMax2dAlpha = NametagGlobals.getMax2dAlpha()
NametagGlobals.setMin2dAlpha(0.8)
NametagGlobals.setMax2dAlpha(1.0)
self.__isOpen = 1 self.__isOpen = 1
self.__setButtonVisibility() self.__setButtonVisibility()
self.show() self.show()
@ -97,9 +99,9 @@ class ShtikerBook(DirectFrame, StateData.StateData):
gsg = base.win.getGsg() gsg = base.win.getGsg()
if gsg: if gsg:
base.render.prepareScene(gsg) base.render.prepareScene(gsg)
base.setCellsActive([base.rightCells[0]], 1) NametagGlobals.setMin2dAlpha(self.oldMin2dAlpha)
NametagGlobals.setForce2dNametags(False) NametagGlobals.setMax2dAlpha(self.oldMax2dAlpha)
NametagGlobals.setForceOnscreenChat(False) base.setCellsAvailable([base.rightCells[0]], 1)
self.__isOpen = 0 self.__isOpen = 0
self.hide() self.hide()
self.hideButton() self.hideButton()

View file

@ -3,7 +3,7 @@ from direct.actor import Actor
from direct.task.Task import Task from direct.task.Task import Task
from otp.avatar import Avatar from otp.avatar import Avatar
from toontown.battle import BattleProps, SuitBattleGlobals from toontown.battle import BattleProps, SuitBattleGlobals
from toontown.nametag import NametagGlobals from otp.nametag.NametagGroup import NametagGroup
from toontown.toonbase import TTLocalizer, ToontownGlobals from toontown.toonbase import TTLocalizer, ToontownGlobals
from toontown.suit import SuitGlobals from toontown.suit import SuitGlobals
import SuitDNA, string import SuitDNA, string
@ -333,7 +333,8 @@ class Suit(Avatar.Avatar):
Avatar.Avatar.__init__(self) Avatar.Avatar.__init__(self)
self.setFont(ToontownGlobals.getSuitFont()) self.setFont(ToontownGlobals.getSuitFont())
self.setPlayerType(NametagGlobals.CCSuit) self.setSpeechFont(ToontownGlobals.getSuitFont())
self.setPlayerType(NametagGroup.CCSuit)
self.setPickable(1) self.setPickable(1)
self.leftHand = None self.leftHand = None
self.rightHand = None self.rightHand = None
@ -416,8 +417,6 @@ class Suit(Avatar.Avatar):
self.generateHead(head) self.generateHead(head)
self.setHeight(properties[SuitGlobals.HEIGHT_INDEX]) self.setHeight(properties[SuitGlobals.HEIGHT_INDEX])
if len(properties) > SuitGlobals.NAMETAG_WRAP_INDEX:
self.nametag.setWordWrap(properties[SuitGlobals.NAMETAG_WRAP_INDEX])
self.setName(SuitBattleGlobals.SuitAttributes[dna.name]['name']) self.setName(SuitBattleGlobals.SuitAttributes[dna.name]['name'])
self.getGeomNode().setScale(self.scale) self.getGeomNode().setScale(self.scale)

View file

@ -29,8 +29,8 @@ from toontown.catalog import CatalogItem
from toontown.catalog import CatalogItemList from toontown.catalog import CatalogItemList
from toontown.chat import ResistanceChat from toontown.chat import ResistanceChat
from toontown.chat import ToonChatGarbler from toontown.chat import ToonChatGarbler
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.chat.WhisperPopup import * from otp.margins.WhisperPopup import *
from toontown.coghq import CogDisguiseGlobals from toontown.coghq import CogDisguiseGlobals
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
@ -46,8 +46,8 @@ from toontown.fishing import FishTank
from toontown.friends import FriendHandle from toontown.friends import FriendHandle
from toontown.golf import GolfGlobals from toontown.golf import GolfGlobals
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
from toontown.nametag import NametagGlobals from otp.nametag import NametagGroup
from toontown.nametag.NametagGlobals import * from otp.nametag.NametagGroup import *
from toontown.parties import PartyGlobals from toontown.parties import PartyGlobals
from toontown.parties.InviteInfo import InviteInfo from toontown.parties.InviteInfo import InviteInfo
from toontown.parties.PartyGlobals import InviteStatus, PartyStatus from toontown.parties.PartyGlobals import InviteStatus, PartyStatus
@ -2064,36 +2064,15 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
DistributedAvatar.DistributedAvatar.setChatAbsolute(self, chatString, chatFlags, dialogue, interrupt) DistributedAvatar.DistributedAvatar.setChatAbsolute(self, chatString, chatFlags, dialogue, interrupt)
def setChatMuted(self, chatString, chatFlags, dialogue=None, interrupt=1, quiet=0): def setChatMuted(self, chatString, chatFlags, dialogue=None, interrupt=1, quiet=0):
if chatFlags & CFQuicktalker: self.nametag.setChat(chatString, chatFlags)
self.nametag.setChatType(NametagGlobals.SPEEDCHAT)
elif chatFlags & CFSpeech:
self.nametag.setChatType(NametagGlobals.CHAT)
if chatFlags & CFThought:
self.nametag.setChatBalloonType(NametagGlobals.THOUGHT_BALLOON)
else:
self.nametag.setChatBalloonType(NametagGlobals.CHAT_BALLOON)
if chatFlags & CFPageButton:
self.nametag.setChatButton(NametagGlobals.pageButton)
elif chatFlags & CFQuitButton:
self.nametag.setChatButton(NametagGlobals.quitButton)
else:
self.nametag.setChatButton(NametagGlobals.noButton)
self.nametag.setChatText(chatString, timeout=bool(chatFlags & CFTimeout))
self.playCurrentDialogue(dialogue, chatFlags - CFSpeech, interrupt) self.playCurrentDialogue(dialogue, chatFlags - CFSpeech, interrupt)
def displayTalk(self, chatString): def displayTalk(self, chatString):
flags = CFSpeech | CFTimeout flags = CFSpeech | CFTimeout
self.nametag.setChatType(NametagGlobals.CHAT)
if ChatUtil.isThought(chatString): if ChatUtil.isThought(chatString):
flags = CFThought flags = CFThought
self.nametag.setChatBalloonType(NametagGlobals.THOUGHT_BALLOON)
chatString = ChatUtil.removeThoughtPrefix(chatString) chatString = ChatUtil.removeThoughtPrefix(chatString)
else: self.nametag.setChat(chatString, flags)
self.nametag.setChatBalloonType(NametagGlobals.CHAT_BALLOON)
self.nametag.setChatText(chatString, timeout=(flags & CFTimeout))
if base.toonChatSounds: if base.toonChatSounds:
self.playCurrentDialogue(None, flags, interrupt=1) self.playCurrentDialogue(None, flags, interrupt=1)

View file

@ -8,8 +8,8 @@ import types
import Toon, ToonDNA import Toon, ToonDNA
from otp.avatar import Emote from otp.avatar import Emote
from otp.otpbase import OTPLocalizer from otp.otpbase import OTPLocalizer
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.nametag.NametagGlobals import * from otp.nametag.NametagGroup import *
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer

View file

@ -20,12 +20,12 @@ from otp.avatar.Avatar import teleportNotify
from otp.otpbase import OTPGlobals from otp.otpbase import OTPGlobals
from otp.otpbase import OTPLocalizer from otp.otpbase import OTPLocalizer
from toontown.battle import SuitBattleGlobals from toontown.battle import SuitBattleGlobals
from toontown.chat.ChatGlobals import * from otp.nametag.NametagConstants import *
from toontown.distributed import DelayDelete from toontown.distributed import DelayDelete
from toontown.effects import DustCloud from toontown.effects import DustCloud
from toontown.effects import Wake from toontown.effects import Wake
from toontown.hood import ZoneUtil from toontown.hood import ZoneUtil
from toontown.nametag.NametagGlobals import * from otp.nametag.NametagGroup import *
from toontown.suit import SuitDNA from toontown.suit import SuitDNA
from toontown.toonbase import TTLocalizer from toontown.toonbase import TTLocalizer
from toontown.toonbase import ToontownGlobals from toontown.toonbase import ToontownGlobals
@ -454,6 +454,7 @@ class Toon(Avatar.Avatar, ToonHead):
self.partyHat = None self.partyHat = None
self.setTag('pieCode', str(ToontownGlobals.PieCodeToon)) self.setTag('pieCode', str(ToontownGlobals.PieCodeToon))
self.setFont(ToontownGlobals.getToonFont()) self.setFont(ToontownGlobals.getToonFont())
self.setSpeechFont(ToontownGlobals.getToonFont())
self.soundChatBubble = base.loadSfx('phase_3/audio/sfx/GUI_balloon_popup.ogg') self.soundChatBubble = base.loadSfx('phase_3/audio/sfx/GUI_balloon_popup.ogg')
self.animFSM = ClassicFSM('Toon', [State('off', self.enterOff, self.exitOff), self.animFSM = ClassicFSM('Toon', [State('off', self.enterOff, self.exitOff),
State('neutral', self.enterNeutral, self.exitNeutral), State('neutral', self.enterNeutral, self.exitNeutral),
@ -2732,6 +2733,7 @@ class Toon(Avatar.Avatar, ToonHead):
self.suit.loop('neutral') self.suit.loop('neutral')
self.isDisguised = 1 self.isDisguised = 1
self.setFont(ToontownGlobals.getSuitFont()) self.setFont(ToontownGlobals.getSuitFont())
self.setSpeechFont(ToontownGlobals.getSuitFont())
if setDisplayName: if setDisplayName:
if hasattr(base, 'idTags') and base.idTags: if hasattr(base, 'idTags') and base.idTags:
name = self.getAvIdName() name = self.getAvIdName()
@ -2765,7 +2767,8 @@ class Toon(Avatar.Avatar, ToonHead):
Emote.globalEmote.releaseAll(self) Emote.globalEmote.releaseAll(self)
self.isDisguised = 0 self.isDisguised = 0
self.setFont(ToontownGlobals.getToonFont()) self.setFont(ToontownGlobals.getToonFont())
self.nametag.setWordWrap(None) self.setSpeechFont(ToontownGlobals.getToonFont())
self.nametag.setWordwrap(None)
if hasattr(base, 'idTags') and base.idTags: if hasattr(base, 'idTags') and base.idTags:
name = self.getAvIdName() name = self.getAvIdName()
else: else: