mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Parties will work now k
This commit is contained in:
parent
85b8923d35
commit
0d8319be38
5 changed files with 27 additions and 12 deletions
|
@ -120,7 +120,7 @@ class PartyEditor(DirectObject, FSM):
|
||||||
|
|
||||||
self.initPartyClock()
|
self.initPartyClock()
|
||||||
if self.currentElement:
|
if self.currentElement:
|
||||||
self.currentElement.checkSoldOutAndPaidStatusAndAffordability()
|
self.currentElement.checkSoldOutAndAffordability()
|
||||||
|
|
||||||
def buyCurrentElement(self):
|
def buyCurrentElement(self):
|
||||||
if self.currentElement:
|
if self.currentElement:
|
||||||
|
@ -151,7 +151,7 @@ class PartyEditor(DirectObject, FSM):
|
||||||
self.elementList.scrollTo(0)
|
self.elementList.scrollTo(0)
|
||||||
self.elementList['items'][0].elementSelectedFromList()
|
self.elementList['items'][0].elementSelectedFromList()
|
||||||
self.currentElement = self.elementList['items'][self.elementList.getSelectedIndex()]
|
self.currentElement = self.elementList['items'][self.elementList.getSelectedIndex()]
|
||||||
self.currentElement.checkSoldOutAndPaidStatusAndAffordability()
|
self.currentElement.checkSoldOutAndAffordability()
|
||||||
self.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsIdle
|
self.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsIdle
|
||||||
self.updateCostsAndBank()
|
self.updateCostsAndBank()
|
||||||
self.handleMutuallyExclusiveActivities()
|
self.handleMutuallyExclusiveActivities()
|
||||||
|
|
|
@ -13,11 +13,11 @@ from toontown.parties import PartyUtils
|
||||||
class PartyEditorGridElement(DirectButton):
|
class PartyEditorGridElement(DirectButton):
|
||||||
notify = directNotify.newCategory('PartyEditorGridElement')
|
notify = directNotify.newCategory('PartyEditorGridElement')
|
||||||
|
|
||||||
def __init__(self, partyEditor, id, isDecoration, checkSoldOutAndPaidStatusAndAffordability, **kw):
|
def __init__(self, partyEditor, id, isDecoration, checkSoldOutAndAffordability, **kw):
|
||||||
self.partyEditor = partyEditor
|
self.partyEditor = partyEditor
|
||||||
self.id = id
|
self.id = id
|
||||||
self.isDecoration = isDecoration
|
self.isDecoration = isDecoration
|
||||||
self.checkSoldOutAndPaidStatusAndAffordability = checkSoldOutAndPaidStatusAndAffordability
|
self.checkSoldOutAndAffordability = checkSoldOutAndAffordability
|
||||||
if self.isDecoration:
|
if self.isDecoration:
|
||||||
self.name = TTLocalizer.PartyDecorationNameDict[self.id]['editor']
|
self.name = TTLocalizer.PartyDecorationNameDict[self.id]['editor']
|
||||||
colorList = ((1.0, 1.0, 1.0, 1.0),
|
colorList = ((1.0, 1.0, 1.0, 1.0),
|
||||||
|
@ -218,7 +218,7 @@ class PartyEditorGridElement(DirectButton):
|
||||||
self.partyEditor.handleMutuallyExclusiveActivities()
|
self.partyEditor.handleMutuallyExclusiveActivities()
|
||||||
else:
|
else:
|
||||||
self.stash()
|
self.stash()
|
||||||
self.checkSoldOutAndPaidStatusAndAffordability()
|
self.checkSoldOutAndAffordability()
|
||||||
return
|
return
|
||||||
|
|
||||||
def placeInPartyGrounds(self, desiredXY = None):
|
def placeInPartyGrounds(self, desiredXY = None):
|
||||||
|
@ -230,7 +230,7 @@ class PartyEditorGridElement(DirectButton):
|
||||||
self.partyEditor.partyEditorGrid.registerNewElement(self, self.centerGridSquare, self.getGridSize())
|
self.partyEditor.partyEditorGrid.registerNewElement(self, self.centerGridSquare, self.getGridSize())
|
||||||
self.partyEditor.updateCostsAndBank()
|
self.partyEditor.updateCostsAndBank()
|
||||||
self.partyEditor.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsPartyGrounds
|
self.partyEditor.partyPlanner.instructionLabel['text'] = TTLocalizer.PartyPlannerEditorInstructionsPartyGrounds
|
||||||
self.checkSoldOutAndPaidStatusAndAffordability()
|
self.checkSoldOutAndAffordability()
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -73,11 +73,11 @@ class PartyEditorListElement(DirectButton):
|
||||||
self.partyEditorGridElements = []
|
self.partyEditorGridElements = []
|
||||||
if self.isDecoration:
|
if self.isDecoration:
|
||||||
for i in xrange(PartyGlobals.DecorationInformationDict[self.id]['limitPerParty']):
|
for i in xrange(PartyGlobals.DecorationInformationDict[self.id]['limitPerParty']):
|
||||||
self.partyEditorGridElements.append(PartyEditorGridElement(self.partyEditor, self.id, self.isDecoration, self.checkSoldOutAndPaidStatusAndAffordability))
|
self.partyEditorGridElements.append(PartyEditorGridElement(self.partyEditor, self.id, self.isDecoration, self.checkSoldOutAndAffordability))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for i in xrange(PartyGlobals.ActivityInformationDict[self.id]['limitPerParty']):
|
for i in xrange(PartyGlobals.ActivityInformationDict[self.id]['limitPerParty']):
|
||||||
self.partyEditorGridElements.append(PartyEditorGridElement(self.partyEditor, self.id, self.isDecoration, self.checkSoldOutAndPaidStatusAndAffordability))
|
self.partyEditorGridElements.append(PartyEditorGridElement(self.partyEditor, self.id, self.isDecoration, self.checkSoldOutAndAffordability))
|
||||||
|
|
||||||
self.activeGridElementIndex = -1
|
self.activeGridElementIndex = -1
|
||||||
self.adjustForUnreleased()
|
self.adjustForUnreleased()
|
||||||
|
@ -113,12 +113,12 @@ class PartyEditorListElement(DirectButton):
|
||||||
self.partyEditor.partyPlanner.elementDescriptionNode.setText(TTLocalizer.PartyActivityNameDict[self.id]['description'])
|
self.partyEditor.partyPlanner.elementDescriptionNode.setText(TTLocalizer.PartyActivityNameDict[self.id]['description'])
|
||||||
self.partyEditor.partyPlanner.elementPriceNode.setText('%d %s' % (PartyGlobals.ActivityInformationDict[self.id]['cost'], TTLocalizer.PartyPlannerBeans))
|
self.partyEditor.partyPlanner.elementPriceNode.setText('%d %s' % (PartyGlobals.ActivityInformationDict[self.id]['cost'], TTLocalizer.PartyPlannerBeans))
|
||||||
self.partyEditor.partyPlanner.elementTitleLabel['text'] = self.name
|
self.partyEditor.partyPlanner.elementTitleLabel['text'] = self.name
|
||||||
self.checkSoldOutAndPaidStatusAndAffordability()
|
self.checkSoldOutAndAffordability()
|
||||||
|
|
||||||
def checkSoldOutAndPaidStatusAndAffordability(self):
|
def checkSoldOutAndAffordability(self):
|
||||||
if self.partyEditor.currentElement != self:
|
if self.partyEditor.currentElement != self:
|
||||||
if self.partyEditor.currentElement is not None:
|
if self.partyEditor.currentElement is not None:
|
||||||
self.partyEditor.currentElement.checkSoldOutAndPaidStatusAndAffordability()
|
self.partyEditor.currentElement.checkSoldOutAndAffordability()
|
||||||
return
|
return
|
||||||
if self.isDecoration:
|
if self.isDecoration:
|
||||||
infoDict = PartyGlobals.DecorationInformationDict
|
infoDict = PartyGlobals.DecorationInformationDict
|
||||||
|
@ -178,7 +178,7 @@ class PartyEditorListElement(DirectButton):
|
||||||
self.activeGridElementIndex = i
|
self.activeGridElementIndex = i
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.checkSoldOutAndPaidStatusAndAffordability()
|
self.checkSoldOutAndAffordability()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def released(self, mouseEvent):
|
def released(self, mouseEvent):
|
||||||
|
|
|
@ -16,6 +16,7 @@ class DistributedPartyManager(DistributedObject):
|
||||||
def __init__(self, cr):
|
def __init__(self, cr):
|
||||||
DistributedObject.__init__(self, cr)
|
DistributedObject.__init__(self, cr)
|
||||||
base.cr.partyManager = self
|
base.cr.partyManager = self
|
||||||
|
self.allowUnreleased = False
|
||||||
self.partyPlannerStyle = None
|
self.partyPlannerStyle = None
|
||||||
self.partyPlannerName = None
|
self.partyPlannerName = None
|
||||||
self.showDoid = False
|
self.showDoid = False
|
||||||
|
@ -41,6 +42,16 @@ class DistributedPartyManager(DistributedObject):
|
||||||
def deallocateZoneIdFromPlannedParty(self, zoneId):
|
def deallocateZoneIdFromPlannedParty(self, zoneId):
|
||||||
self.sendUpdate('freeZoneIdFromPlannedParty', [base.localAvatar.doId, zoneId])
|
self.sendUpdate('freeZoneIdFromPlannedParty', [base.localAvatar.doId, zoneId])
|
||||||
|
|
||||||
|
def allowUnreleasedClient(self):
|
||||||
|
return self.allowUnreleased
|
||||||
|
|
||||||
|
def setAllowUnreleaseClient(self, newValue):
|
||||||
|
self.allowUnreleased = newValue
|
||||||
|
|
||||||
|
def toggleAllowUnreleasedClient(self):
|
||||||
|
self.allowUnreleased = not self.allowUnreleased
|
||||||
|
return self.allowUnreleased
|
||||||
|
|
||||||
def sendAddParty(self, hostId, startTime, endTime, isPrivate, inviteTheme, activities, decorations, inviteeIds):
|
def sendAddParty(self, hostId, startTime, endTime, isPrivate, inviteTheme, activities, decorations, inviteeIds):
|
||||||
self.sendUpdate('addPartyRequest', [hostId,
|
self.sendUpdate('addPartyRequest', [hostId,
|
||||||
startTime,
|
startTime,
|
||||||
|
|
|
@ -57,6 +57,10 @@ class DistributedPartyManagerAI(DistributedObjectAI):
|
||||||
# well fuck. ud died.
|
# well fuck. ud died.
|
||||||
self.notify.warning("uberdog lost!")
|
self.notify.warning("uberdog lost!")
|
||||||
|
|
||||||
|
def canBuyParties(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def addPartyRequest(self, hostId, startTime, endTime, isPrivate, inviteTheme, activities, decorations, inviteeIds):
|
def addPartyRequest(self, hostId, startTime, endTime, isPrivate, inviteTheme, activities, decorations, inviteeIds):
|
||||||
if hostId != simbase.air.getAvatarIdFromSender():
|
if hostId != simbase.air.getAvatarIdFromSender():
|
||||||
self.air.writeServerEvent('suspicious',simbase.air.getAvatarIdFromSender(),'Toon tried to create a party as someone else!')
|
self.air.writeServerEvent('suspicious',simbase.air.getAvatarIdFromSender(),'Toon tried to create a party as someone else!')
|
||||||
|
|
Loading…
Reference in a new issue