mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
editor changes are distributed
This commit is contained in:
parent
dea5eaccfb
commit
4e8ac61955
@ -383,6 +383,11 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
||||
if __debug__:
|
||||
# level editing stuff
|
||||
def setAttribChange(self, entId, attribName, valueStr):
|
||||
entity = self.getEntity(entId)
|
||||
# the entity might be AI-only
|
||||
if entity is None:
|
||||
return
|
||||
|
||||
try:
|
||||
value = eval(valueStr)
|
||||
except Exception, e:
|
||||
@ -390,7 +395,6 @@ class DistributedLevel(DistributedObject.DistributedObject,
|
||||
(lineInfo()[2], entId, attribName, valueStr, e))
|
||||
raise e
|
||||
|
||||
entity = self.getEntity(entId)
|
||||
entity.handleAttribChange(attribName, value)
|
||||
|
||||
"""
|
||||
|
@ -77,13 +77,16 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI,
|
||||
if __debug__:
|
||||
# level editors should call this func to tweak attributes of level
|
||||
# entities
|
||||
def setAttribChange(self, entId, attribName, value):
|
||||
def setAttribChange(self, entId, attribName, valueStr):
|
||||
# send a copy to the client-side level obj
|
||||
self.sendUpdate('setAttribChange',
|
||||
[entId, attribName, repr(value)])
|
||||
[entId, attribName, valueStr])
|
||||
|
||||
entity = self.getEntity(entId)
|
||||
entity.handleAttribChange(attribName, value)
|
||||
# the entity might be client-side-only
|
||||
if entity is not None:
|
||||
value = eval(valueStr)
|
||||
entity.handleAttribChange(attribName, value)
|
||||
|
||||
# send a copy of the entire spec for any new users that
|
||||
# might come in
|
||||
|
@ -76,6 +76,13 @@ class LevelSpec:
|
||||
return self.specDict['scenarios'][scenario][0]
|
||||
|
||||
if __debug__:
|
||||
def setAttribEditEventName(self, event):
|
||||
self.attribEditEventName = event
|
||||
def setAttribEdit(self, entId, attrib, value):
|
||||
# broadcast the change to someone else that knows what to do
|
||||
# with it
|
||||
messenger.send(self.attribEditEventName, [entId, attrib, value])
|
||||
|
||||
def setAttribChange(self, entId, attrib, value):
|
||||
pass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user