Some cleanup

This commit is contained in:
John 2015-07-31 01:26:06 +03:00
parent ffd8f1f001
commit 42f79c3957
3 changed files with 11 additions and 19 deletions

View file

@ -96,9 +96,6 @@ ChairToPosHpr = {
720: ((0, -2.7, 0.2), (180, 0, 0), (0, -3.7, 0), -3.0)
}
def getChairCollOffset(furnitureId):
return ChairToPosHpr[furnitureId][3]
FurnitureTypes = {
100: ('phase_5.5/models/estate/chairA', # Model
None, # Color

View file

@ -1,24 +1,21 @@
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import *
from toontown.effects import DustCloud
from toontown.catalog import CatalogFurnitureItem
from toontown.toonbase import ToontownGlobals, TTLocalizer
from toontown.toontowngui import TTDialog
from toontown.quest import Quests
import DistributedFurnitureItem
from toontown.catalog import CatalogFurnitureItem
from DistributedFurnitureItem import DistributedFurnitureItem
class DistributedChair(DistributedFurnitureItem.DistributedFurnitureItem):
class DistributedChair(DistributedFurnitureItem):
def __init__(self, cr):
DistributedFurnitureItem.DistributedFurnitureItem.__init__(self, cr)
DistributedFurnitureItem.__init__(self, cr)
self.dialog = None
self.exitButton = None
self.locked = False
self.avId = ToontownGlobals.CHAIR_NONE
def loadModel(self):
model = DistributedFurnitureItem.DistributedFurnitureItem.loadModel(self)
cSphere = CollisionSphere(0.0, CatalogFurnitureItem.getChairCollOffset(self.item.furnitureType), 1.0, 1.575)
model = DistributedFurnitureItem.loadModel(self)
cSphere = CollisionSphere(0.0, self.getChair()[3], 1.0, 1.575)
cSphere.setTangible(0)
colNode = CollisionNode('Chair-%s' % self.doId)
colNode.addSolid(cSphere)
@ -29,10 +26,12 @@ class DistributedChair(DistributedFurnitureItem.DistributedFurnitureItem):
def disable(self):
av = base.cr.doId2do.get(self.avId)
if av:
self.resetAvatar(av)
self.ignoreAll()
DistributedFurnitureItem.DistributedFurnitureItem.disable(self)
DistributedFurnitureItem.disable(self)
def getChair(self):
return CatalogFurnitureItem.ChairToPosHpr[self.item.furnitureType]
@ -96,9 +95,6 @@ class DistributedChair(DistributedFurnitureItem.DistributedFurnitureItem):
if not av:
return
if status == ToontownGlobals.CHAIR_LOCKED:
self.locked = True
if status == ToontownGlobals.CHAIR_UNEXPECTED_EXIT:
self.resetAvatar(av)
@ -120,7 +116,7 @@ class DistributedChair(DistributedFurnitureItem.DistributedFurnitureItem):
self.destroyGui()
def __enterSphere(self, collisionEntry):
if self.locked or self.avId in base.cr.doId2do:
if self.avId in base.cr.doId2do:
return
base.cr.playGame.getPlace().setState('stopped')

View file

@ -1671,5 +1671,4 @@ CHAIR_START = 0
CHAIR_STOP = 1
CHAIR_NONE = 0
CHAIR_EXIT = 1
CHAIR_LOCKED = 2
CHAIR_UNEXPECTED_EXIT = 3
CHAIR_UNEXPECTED_EXIT = 2