Merge branch 'feature/two-story-houses' into 'feature/deployment'

Add 2nd floor houses.



See merge request !5
This commit is contained in:
Alexander Behrhof 2015-08-19 16:43:16 -04:00
commit 02a7981d04
5 changed files with 34 additions and 34 deletions

@ -1 +1 @@
Subproject commit aacdc95eac2459a4af7234f2b8ad7b36eab5d516
Subproject commit 8e276dce36ce41ecdc9d3182174edc7116610591

View file

@ -317,7 +317,7 @@ class DistributedFurnitureManagerAI(DistributedObjectAI):
self.air.writeServerEvent('suspicious', avId=self.air.getAvatarIdFromSender(), issue='Invalid wallpaper at index %s' % index)
return ToontownGlobals.FM_InvalidIndex
if room > 1:
if room > 3:
self.air.writeServerEvent('suspicious', avId=self.air.getAvatarIdFromSender(), issue='Tried to apply a wallpaper in an invalid room %d!' % room)
return ToontownGlobals.FM_InvalidItem
interiorIndex = room*4
@ -354,7 +354,7 @@ class DistributedFurnitureManagerAI(DistributedObjectAI):
def moveWindowFromAttic(self, index, slot):
retcode = ToontownGlobals.FM_MovedItem
window = self.getAtticFurniture(self.atticWindows, index)
if slot > 5:
if slot > 7:
self.air.writeServerEvent('suspicious', avId=self.air.getAvatarIdFromSender(),
issue='Tried to move window to invalid slot %d!' % slot)
return ToontownGlobals.FM_HouseFull
@ -373,7 +373,7 @@ class DistributedFurnitureManagerAI(DistributedObjectAI):
window = self.getWindow(fromSlot)
if window is None:
return ToontownGlobals.FM_InvalidIndex
if toSlot > 5:
if toSlot > 7:
self.air.writeServerEvent('suspicious', avId=self.air.getAvatarIdFromSender(),
issue='DistributedfTried to move window to invalid slot %d!' % toSlot)
return ToontownGlobals.FM_HouseFull

View file

@ -14,8 +14,8 @@ from toontown.catalog import CatalogFlooringItem
from toontown.catalog import CatalogMouldingItem
from toontown.catalog import CatalogWainscotingItem
from toontown.dna.DNAParser import *
WindowPlugNames = ('**/windowcut_a*', '**/windowcut_b*', '**/windowcut_c*', '**/windowcut_d*', '**/windowcut_e*', '**/windowcut_f*')
RoomNames = ('**/group2', '**/group1')
WindowPlugNames = ['**/windowcut_%s*' % x for x in ('b', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i')]
RoomNames = ['**/group%s' % x for x in ( 4, 3, 2, 1)]
WallNames = ('ceiling*', 'wall_side_middle*', 'wall_front_middle*', 'windowcut_*')
MouldingNames = ('wall_side_top*', 'wall_front_top*')
FloorNames = ('floor*',)
@ -35,7 +35,6 @@ class DistributedHouseInterior(DistributedObject.DistributedObject):
self.houseIndex = 0
self.interior = None
self.exteriorWindowsHidden = 0
return
def generate(self):
DistributedObject.DistributedObject.generate(self)
@ -83,8 +82,9 @@ class DistributedHouseInterior(DistributedObject.DistributedObject):
plug.flattenLight()
self.windowSlots.append((plug, viewBase))
self.windowSlots[2][1].setPosHpr(16.0, -12.0, 5.51, -90, 0, 0)
self.windowSlots[4][1].setPosHpr(-12.0, 26.0, 5.51, 0, 0, 0)
self.windowSlots[2][1].setPosHpr(-21.28, -37.15, 16.25, -90.4, 0, 0)
self.windowSlots[6][1].setPosHpr(-12.0, 26.0, 5.51, 0, 0, 0)
self.windowSlots[4][1].setPosHpr(16.0, -12.0, 5.51, -90, 0, 0)
self.__colorWalls()
self.__setupWindows()
messenger.send('houseInteriorLoaded-%d' % self.zoneId)
@ -185,19 +185,3 @@ class DistributedHouseInterior(DistributedObject.DistributedObject):
self.windows = CatalogItemList.CatalogItemList(items, store=CatalogItem.Customization | CatalogItem.WindowPlacement)
if self.interior:
self.__setupWindows()
def testWallpaperCombo(self, wallpaperType, wallpaperColorIndex, borderIndex, borderColorIndex, mouldingType, mouldingColorIndex, flooringType, flooringColorIndex, wainscotingType, wainscotingColorIndex):
wallpaperItem = CatalogWallpaperItem.CatalogWallpaperItem(wallpaperType, wallpaperColorIndex, borderIndex, borderColorIndex)
mouldingItem = CatalogMouldingItem.CatalogMouldingItem(mouldingType, mouldingColorIndex)
flooringItem = CatalogFlooringItem.CatalogFlooringItem(flooringType, flooringColorIndex)
wainscotingItem = CatalogWainscotingItem.CatalogWainscotingItem(wainscotingType, wainscotingColorIndex)
self.wallpaper = CatalogItemList.CatalogItemList([wallpaperItem,
mouldingItem,
flooringItem,
wainscotingItem,
wallpaperItem,
mouldingItem,
flooringItem,
wainscotingItem], store=CatalogItem.Customization)
if self.interior:
self.__colorWalls()

View file

@ -22,7 +22,7 @@ houseInteriors = [
]
defaultWindows = [
CatalogWindowItem(20, placement=2), CatalogWindowItem(20, placement=4)
CatalogWindowItem(20, placement=2), CatalogWindowItem(20, placement=4), CatalogWindowItem(20, placement=6)
]
defaultWallpaper = [
@ -34,6 +34,14 @@ defaultWallpaper = [
CatalogMouldingItem(1000, 2),
CatalogFlooringItem(1000, 4),
CatalogWainscotingItem(1010, 4),
CatalogWallpaperItem(1110, 0, 1010, 0),
CatalogMouldingItem(1000, 2),
CatalogFlooringItem(1000, 4),
CatalogWainscotingItem(1010, 4),
CatalogWallpaperItem(1110, 0, 1010, 0),
CatalogMouldingItem(1000, 2),
CatalogFlooringItem(1000, 4),
CatalogWainscotingItem(1010, 4),
]

View file

@ -1328,12 +1328,20 @@ class ObjectManager(NodePath, DirectObject):
if self.deleteMode:
self.requestDelete(item, itemIndex, self.deleteWallpaperFromAttic)
return
if base.localAvatar.getY() < 2.3:
room = 0
else:
room = 1
room = self.getRoom()
self.furnitureManager.moveWallpaperFromAttic(itemIndex, room, self.__bringWallpaperFromAtticCallback)
def getRoom(self):
x, y, z = base.localAvatar.getPos()
if (x <= -13.5 and y <= -7.6 and y >= 0.0) or (z >= 4.5 and z <= 10):
return 0
elif base.localAvatar.getZ() > 5.0:
return 1
elif base.localAvatar.getY() < 2.3:
return 2
return 3
def __bringWallpaperFromAtticCallback(self, retcode, itemIndex, room):
self.__enableItemButtons(1)
if retcode < 0:
@ -1367,10 +1375,10 @@ class ObjectManager(NodePath, DirectObject):
if self.deleteMode:
self.requestDelete(item, itemIndex, self.deleteWindowFromAttic)
return
if base.localAvatar.getY() < 2.3:
slot = 2
else:
slot = 4
room = self.getRoom()
if room == 0:
room = 1
slot = room * 2
self.furnitureManager.moveWindowFromAttic(itemIndex, slot, self.__bringWindowFromAtticCallback)
def __bringWindowFromAtticCallback(self, retcode, itemIndex, slot):