diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index ddf124ef..569878f0 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -295,7 +295,6 @@ from toontown.estate import DistributedEstate/AI from toontown.estate import DistributedHouse/AI from toontown.estate import DistributedHouseInterior/AI from toontown.estate import DistributedGarden/AI -from toontown.shtiker import DeleteManager/AI from toontown.groups import GroupManager/AI/UD from toontown.ai import NewsManager/AI from toontown.shtiker import PurchaseManager/AI @@ -303,7 +302,6 @@ from toontown.shtiker import NewbiePurchaseManager/AI from toontown.safezone import SafeZoneManager/AI from toontown.tutorial import TutorialManager/AI from toontown.catalog import CatalogManager/AI -from toontown.catalog import AccountDate/AI from toontown.safezone import DistributedTreasure/AI from toontown.coghq import DistributedCashbotBossTreasure/AI from toontown.building import DistributedTrophyMgr/AI @@ -1545,10 +1543,6 @@ dclass DistributedPartyTugOfWarActivity : DistributedPartyTeamActivity { updateToonPositions(int16/1000) broadcast; }; -dclass DeleteManager : DistributedObject { - setInventory(blob) airecv clsend; -}; - dclass GroupManager : DistributedObject { setChildId() clsend airecv; isPlayerGrouped(uint32); @@ -1659,11 +1653,6 @@ dclass CatalogManager : DistributedObject { startCatalog() airecv clsend; }; -dclass AccountDate : DistributedObject { - requestDate() airecv clsend; - requestDateResult(string); -}; - dclass DistributedTreasure : DistributedObject { setTreasureType(uint16) required broadcast ram; setPosition(int16/10, int16/10, int16/10) required broadcast ram; diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index bde65a54..2f066f2b 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 2005027427 +hashVal = 3860069384L from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot @@ -11,7 +11,7 @@ from toontown.building import DistributedAnimatedProp, DistributedTrophyMgr, Dis from toontown.uberdog.DistributedPartyManager import DistributedPartyManager from otp.friends import FriendManager from otp.level import DistributedLevel, DistributedEntity, DistributedInteractiveEntity -from toontown.shtiker import DeleteManager, PurchaseManager, NewbiePurchaseManager +from toontown.shtiker import PurchaseManager, NewbiePurchaseManager from toontown.groups import GroupManager from toontown.uberdog.ClientServicesManager import ClientServicesManager from toontown.ai import WelcomeValleyManager, NewsManager, DistributedAprilToonsMgr, DistributedBlackCatMgr, DistributedReportMgr, DistributedPolarPlaceEffectMgr, DistributedGreenToonEffectMgr, DistributedResistanceEmoteMgr, DistributedScavengerHuntTarget, DistributedTrickOrTreatTarget, DistributedWinterCarolingTarget, DistributedJorElCam @@ -25,7 +25,7 @@ from toontown.safezone import DistributedTrolley, DistributedPartyGate, Distribu from toontown.fishing import DistributedFishingPond, DistributedFishingTarget, DistributedPondBingoManager from toontown.minigame import DistributedMinigame, DistributedMinigameTemplate, DistributedRaceGame, DistributedCannonGame, DistributedPatternGame, DistributedRingGame, DistributedTagGame, DistributedMazeGame, DistributedTugOfWarGame, DistributedCatchGame, DistributedDivingGame, DistributedTargetGame, DistributedVineGame, DistributedIceGame, DistributedCogThiefGame, DistributedTwoDGame from toontown.racing import DistributedVehicle, DistributedStartingBlock, DistributedRace, DistributedKartPad, DistributedRacePad, DistributedViewPad, DistributedStartingBlock, DistributedLeaderBoard, DistributedGag, DistributedProjectile -from toontown.catalog import CatalogManager, AccountDate +from toontown.catalog import CatalogManager from toontown.parties import DistributedParty, DistributedPartyActivity, DistributedPartyTeamActivity, DistributedPartyCannon, DistributedPartyCannonActivity, DistributedPartyCatchActivity, DistributedPartyWinterCatchActivity, DistributedPartyCogActivity, DistributedPartyWinterCogActivity, DistributedPartyFireworksActivity, DistributedPartyDanceActivityBase, DistributedPartyDanceActivity, DistributedPartyDance20Activity, DistributedPartyValentineDanceActivity, DistributedPartyValentineDance20Activity, DistributedPartyTrampolineActivity, DistributedPartyValentineTrampolineActivity, DistributedPartyVictoryTrampolineActivity, DistributedPartyWinterTrampolineActivity, DistributedPartyTugOfWarActivity, DistributedPartyJukeboxActivityBase, DistributedPartyJukeboxActivity, DistributedPartyJukebox40Activity, DistributedPartyValentineJukeboxActivity, DistributedPartyValentineJukebox40Activity from toontown.pets.DistributedPet import * from toontown.friends import TTUFriendsManager diff --git a/toontown/ai/ToontownAIRepository.py b/toontown/ai/ToontownAIRepository.py index 77c1e344..5fc1715b 100644 --- a/toontown/ai/ToontownAIRepository.py +++ b/toontown/ai/ToontownAIRepository.py @@ -16,7 +16,6 @@ from toontown.ai.NewsManagerAI import NewsManagerAI from toontown.ai.QuestManagerAI import QuestManagerAI from toontown.ai.DistributedBlackCatMgrAI import DistributedBlackCatMgrAI from toontown.ai.DistributedReportMgrAI import DistributedReportMgrAI -from toontown.catalog.AccountDateAI import AccountDateAI from toontown.building.DistributedBuildingQueryMgrAI import DistributedBuildingQueryMgrAI from toontown.building.DistributedTrophyMgrAI import DistributedTrophyMgrAI from toontown.catalog.CatalogManagerAI import CatalogManagerAI @@ -121,8 +120,6 @@ class ToontownAIRepository(ToontownInternalRepository): self.holidayManager = HolidayManagerAI(self) self.codeRedemptionMgr = TTCodeRedemptionMgrAI(self) self.codeRedemptionMgr.generateWithRequired(2) - self.accountDateMgr = AccountDateAI(self) - self.accountDateMgr.generateWithRequired(2) self.buildingQueryMgr = DistributedBuildingQueryMgrAI(self) self.buildingQueryMgr.generateWithRequired(2) self.groupManager.generateWithRequired(2) diff --git a/toontown/catalog/AccountDate.py b/toontown/catalog/AccountDate.py deleted file mode 100644 index 610227e1..00000000 --- a/toontown/catalog/AccountDate.py +++ /dev/null @@ -1,39 +0,0 @@ -from direct.distributed.DistributedObject import DistributedObject -from direct.directnotify.DirectNotifyGlobal import directNotify -from datetime import datetime - -class AccountDate(DistributedObject): - neverDisable = 1 - notify = directNotify.newCategory('AccountDate') - - def __init__(self, cr): - DistributedObject.__init__(self, cr) - self.accountDays = 0 - - def announceGenerate(self): - DistributedObject.announceGenerate(self) - base.cr.accountDateMgr = self - taskMgr.doMethodLater(10, self.requestDate, 'request-task') - - def delete(self): - if hasattr(base.cr, 'accountDateMgr'): - if base.cr.accountDateMgr is self: - del base.cr.accountDateMgr - DistributedObject.delete(self) - - def getAccountDays(self): - return self.accountDays - - def requestDate(self, task=None): - self.sendUpdate('requestDate') - - if task is not None: - return task.done - - def requestDateResult(self, result): - if result is None: - notify.warning('Invalid response from server.') - self.accountDays = 0 - else: - date = datetime.strptime(result, "%a %b %d %H:%M:%S %Y") - self.accountDays = (datetime.now() - date).days \ No newline at end of file diff --git a/toontown/catalog/AccountDateAI.py b/toontown/catalog/AccountDateAI.py deleted file mode 100644 index 654048ea..00000000 --- a/toontown/catalog/AccountDateAI.py +++ /dev/null @@ -1,23 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectAI import DistributedObjectAI - -class AccountDateAI(DistributedObjectAI): - notify = DirectNotifyGlobal.directNotify.newCategory("AccountDateAI") - - def announceGenerate(self): - DistributedObjectAI.announceGenerate(self) - - def requestDate(self): - avId = self.air.getAvatarIdFromSender() - av = self.air.doId2do.get(avId) - - if not av: - return - - def callback(dclass, fields): - if dclass is not None and dclass == self.air.dclassesByName['AccountAI'] and fields.has_key('CREATED'): - self.sendUpdateToAvatarId(avId, 'requestDateResult', [fields.get('CREATED')]) - else: - self.sendUpdateToAvatarId(avId, 'requestDateResult', [None]) - - self.air.dbInterface.queryObject(self.air.dbId, av.DISLid, callback) \ No newline at end of file diff --git a/toontown/catalog/CatalogAccessoryItem.py b/toontown/catalog/CatalogAccessoryItem.py index 4f8f13f8..3b12563a 100644 --- a/toontown/catalog/CatalogAccessoryItem.py +++ b/toontown/catalog/CatalogAccessoryItem.py @@ -363,9 +363,6 @@ class CatalogAccessoryItem(CatalogItem.CatalogItem): dg.addUint16(self.accessoryType) dg.addBool(self.isSpecial) - def isGift(self): - return not self.getEmblemPrices() - def getAllAccessories(*accessoryTypes): list = [] for accessoryType in accessoryTypes: diff --git a/toontown/catalog/CatalogClothingItem.py b/toontown/catalog/CatalogClothingItem.py index 5124da5a..0f4865f0 100644 --- a/toontown/catalog/CatalogClothingItem.py +++ b/toontown/catalog/CatalogClothingItem.py @@ -548,9 +548,6 @@ class CatalogClothingItem(CatalogItem.CatalogItem): dg.addUint8(self.colorIndex) dg.addBool(self.isSpecial) - def isGift(self): - return not self.getEmblemPrices() - def getAllClothes(*clothingTypes): list = [] for clothingType in clothingTypes: diff --git a/toontown/catalog/CatalogEmoteItem.py b/toontown/catalog/CatalogEmoteItem.py index fa173bc6..a5c16f0a 100644 --- a/toontown/catalog/CatalogEmoteItem.py +++ b/toontown/catalog/CatalogEmoteItem.py @@ -121,7 +121,4 @@ class CatalogEmoteItem(CatalogItem.CatalogItem): def encodeDatagram(self, dg, store): CatalogItem.CatalogItem.encodeDatagram(self, dg, store) dg.addUint8(self.emoteIndex) - dg.addBool(self.isSpecial) - - def isGift(self): - return not self.getEmblemPrices() \ No newline at end of file + dg.addBool(self.isSpecial) \ No newline at end of file diff --git a/toontown/catalog/CatalogItem.py b/toontown/catalog/CatalogItem.py index bba97cda..efce112a 100644 --- a/toontown/catalog/CatalogItem.py +++ b/toontown/catalog/CatalogItem.py @@ -115,9 +115,7 @@ class CatalogItem: return self.saleItem def isGift(self): - if self.getEmblemPrices(): - return 0 - return 1 + return not self.getEmblemPrices() def isRental(self): return 0 diff --git a/toontown/catalog/CatalogScreen.py b/toontown/catalog/CatalogScreen.py index 36eb9d3c..449de623 100644 --- a/toontown/catalog/CatalogScreen.py +++ b/toontown/catalog/CatalogScreen.py @@ -45,11 +45,10 @@ class CatalogScreen(DirectFrame): DirectFrame.__init__(self, parent) self.friendGiftIndex = 0 self.friendGiftHandle = None - self.frienddoId = None + self.friendDoId = None self.receiverName = 'Error Nameless Toon' self.friends = {} - self.family = {} - self.ffList = [] + self.friendList = [] self.textRolloverColor = Vec4(1, 1, 0, 1) self.textDownColor = Vec4(0.5, 0.9, 1, 1) self.textDisabledColor = Vec4(0.4, 0.8, 0.4, 1) @@ -92,7 +91,7 @@ class CatalogScreen(DirectFrame): taskMgr.doMethodLater(12.0, clarabelleHelpText1, 'clarabelleHelpText1') if hasattr(self, 'giftToggle'): self.giftToggle['state'] = DGG.NORMAL - self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOn + self.giftToggle['text'] = TTLocalizer.CatalogGiftToggleOff def hide(self): self.ignore('CatalogItemPurchaseRequest') @@ -542,8 +541,8 @@ class CatalogScreen(DirectFrame): -2.0, -1.45), image_scale=(1.0, 1.0, smash), image_pos=(0.0, 0.0, -1.9 + lift), image=backDown, pressEffect=0, command=self.showEmblemItems, text=TTLocalizer.CatalogEmblem, text_font=ToontownGlobals.getSignFont(), text_pos=(1.75, 0.132), text_scale=0.065, text_fg=(0.353, 0.627, 0.627, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0)) self.emblemCatalogButton2.hide() - self.__makeFFlist() - if len(self.ffList) > 0: + self.__makeFriendList() + if len(self.friendList) > 0: if config.GetBool('want-gifting', True): self.giftToggle = DirectButton(self.base, relief=None, pressEffect=0, image=(giftToggleUp, giftToggleDown, giftToggleUp), image_scale=(1.0, 1, 0.7), command=self.__giftToggle, text=TTLocalizer.CatalogGiftToggleOff, text_font=ToontownGlobals.getSignFont(), text_pos=TTLocalizer.CSgiftTogglePos, text_scale=TTLocalizer.CSgiftToggle, text_fg=(0.353, 0.627, 0.627, 1.0), text3_fg=(0.15, 0.3, 0.3, 1.0), text2_fg=(0.353, 0.427, 0.427, 1.0), image_color=Vec4(1.0, 1.0, 0.2, 1.0), image1_color=Vec4(0.9, 0.85, 0.2, 1.0), image2_color=Vec4(0.9, 0.85, 0.2, 1.0), image3_color=Vec4(0.5, 0.45, 0.2, 1.0)) self.giftToggle.setPos(0.0, 0, -0.035) @@ -569,8 +568,8 @@ class CatalogScreen(DirectFrame): clipNP = self.scrollList.attachNewNode(clipper) self.scrollList.setClipPlane(clipNP) self.__makeScrollList() - friendId = self.ffList[0] - self.__chooseFriend(self.ffList[0][0], self.ffList[0][1]) + friendId = self.friendList[0] + self.__chooseFriend(self.friendList[0][0], self.friendList[0][1]) self.update() self.createdGiftGui = 1 for i in range(4): @@ -865,11 +864,7 @@ class CatalogScreen(DirectFrame): if self.responseDialog: self.responseDialog.cleanup() self.responseDialog = None - if self.giftAvatar: - if hasattr(self.giftAvatar, 'doId'): - self.giftAvatar.delete() - else: - self.giftAvatar = None + self.unloadFriend() return def unloadClarabelle(self): @@ -933,7 +928,7 @@ class CatalogScreen(DirectFrame): taskMgr.remove('clarabelleAskAnythingElse') def __handleGiftPurchaseRequest(self, item): - item.requestGiftPurchase(self['phone'], self.frienddoId, self.__handleGiftPurchaseResponse) + item.requestGiftPurchase(self['phone'], self.friendDoId, self.__handleGiftPurchaseResponse) taskMgr.remove('clarabelleAskAnythingElse') def __handlePurchaseResponse(self, retCode, item): @@ -1015,61 +1010,61 @@ class CatalogScreen(DirectFrame): self.silverLabel.hide() self.goldLabel.hide() - def checkFamily(self, doId): - test = 0 - for familyMember in base.cr.avList: - if familyMember.id == doId: - test = 1 - - return test - - def __makeFFlist(self): + def __makeFriendList(self): + for av in base.cr.avList: + if localAvatar.doId == av.id: + continue + self.friendList.append((av.id, av.name, NametagGlobals.CCNormal)) for id, handle in base.cr.friendsMap.items(): - self.ffList.append((id, handle.getName(), NametagGlobals.CCFreeChat)) + self.friendList.append((id, handle.getName(), NametagGlobals.getFriendColor(handle.commonChatFlags))) def __makeScrollList(self): - for ff in self.ffList: - ffbutton = self.makeFamilyButton(ff[0], ff[1], ff[2]) - if ffbutton: - self.scrollList.addItem(ffbutton, refresh=0) - self.friends[ff] = ffbutton + for friend in self.friendList: + friendButton = self.makeFriendButton(friend[0], friend[1], friend[2]) + if friendButton: + self.scrollList.addItem(friendButton, refresh=0) + self.friends[friend] = friendButton self.scrollList.refresh() - def makeFamilyButton(self, familyId, familyName, colorCode): - # fg = NametagGlobals.getNameFg(colorCode, PGButton.SInactive) + def makeFriendButton(self, avId, avName, colorCode): return DirectButton( relief=None, - text=familyName, + text=avName, text_scale=0.04, text_align=TextNode.ALeft, - # text_fg=fg, + text_fg=NametagGlobals.NametagColors[colorCode][0][0], text1_bg=self.textDownColor, text2_bg=self.textRolloverColor, text3_fg=self.textDisabledColor, textMayChange=0, command=self.__chooseFriend, - extraArgs=[familyId, familyName] - ) + extraArgs=[avId, avName] + ) def __chooseFriend(self, friendId, friendName): + if self.friendDoId and self.friendDoId == friendId: + return messenger.send('wakeup') - self.frienddoId = friendId + self.friendDoId = friendId self.receiverName = friendName self.friendLabel['text'] = TTLocalizer.CatalogGiftTo % self.receiverName self.__loadFriend() + def unloadFriend(self): + if self.giftAvatar: + if hasattr(self.giftAvatar, 'doId'): + self.giftAvatar.disable() + self.giftAvatar.delete() + self.giftAvatar = None + def __loadFriend(self): if self.allowGetDetails == 0: CatalogScreen.notify.warning('smashing requests') - if self.frienddoId and self.allowGetDetails: - if self.giftAvatar: - if hasattr(self.giftAvatar, 'doId'): - self.giftAvatar.disable() - self.giftAvatar.delete() - self.giftAvatar = None + if self.friendDoId and self.allowGetDetails: + self.unloadFriend() self.giftAvatar = DistributedToon.DistributedToon(base.cr) - self.giftAvatar.doId = self.frienddoId + self.giftAvatar.doId = self.friendDoId self.giftAvatar.forceAllowDelayDelete() self.giftAvatar.generate() base.cr.getAvatarDetails(self.giftAvatar, self.__handleAvatarDetails, 'DistributedToon') diff --git a/toontown/nametag/NametagGlobals.py b/toontown/nametag/NametagGlobals.py index b8b62a6c..a0b866d5 100644 --- a/toontown/nametag/NametagGlobals.py +++ b/toontown/nametag/NametagGlobals.py @@ -135,6 +135,8 @@ def getModelWidthHeight(model): height = maxPoint.getZ() - minPoint.getZ() return (width, height) +def getFriendColor(flag): + return CCNormal if flag == 1 and settings['trueFriends'] else CCFreeChat # Foreground, background: NametagColors = { diff --git a/toontown/shtiker/DeleteManager.py b/toontown/shtiker/DeleteManager.py deleted file mode 100644 index 46af28fe..00000000 --- a/toontown/shtiker/DeleteManager.py +++ /dev/null @@ -1,21 +0,0 @@ -from pandac.PandaModules import * -from direct.distributed import DistributedObject -from direct.directnotify import DirectNotifyGlobal - -class DeleteManager(DistributedObject.DistributedObject): - notify = DirectNotifyGlobal.directNotify.newCategory('DeleteManager') - neverDisable = 1 - - def __init__(self, cr): - DistributedObject.DistributedObject.__init__(self, cr) - - def generate(self): - DistributedObject.DistributedObject.generate(self) - self.accept('deleteItems', self.d_setInventory) - - def disable(self): - self.ignore('deleteItems') - DistributedObject.DistributedObject.disable(self) - - def d_setInventory(self, newInventoryString): - self.sendUpdate('setInventory', [newInventoryString]) diff --git a/toontown/shtiker/DeleteManagerAI.py b/toontown/shtiker/DeleteManagerAI.py deleted file mode 100644 index fcc249f2..00000000 --- a/toontown/shtiker/DeleteManagerAI.py +++ /dev/null @@ -1,9 +0,0 @@ -from direct.directnotify import DirectNotifyGlobal -from direct.distributed.DistributedObjectAI import DistributedObjectAI - -class DeleteManagerAI(DistributedObjectAI): - notify = DirectNotifyGlobal.directNotify.newCategory("DeleteManagerAI") - - def setInventory(self, todo0): - pass - diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index baee8074..b7e3f309 100644 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -1687,9 +1687,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): def setPinkSlips(self, pinkSlips): DistributedToon.DistributedToon.setPinkSlips(self, pinkSlips) self.inventory.updateTotalPropsText() - - def getAccountDays(self): - return base.cr.accountDateMgr.getAccountDays() def hasActiveBoardingGroup(self): if hasattr(localAvatar, 'boardingParty') and localAvatar.boardingParty: