mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Made selected order maintained
This commit is contained in:
parent
c4144a12ad
commit
e80cd79f6b
@ -60,6 +60,7 @@ class SelectedNodePaths(DirectObject):
|
|||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self.selectedDict = {}
|
self.selectedDict = {}
|
||||||
|
self.selectedList = [] # [gjeon] to maintain selected order
|
||||||
self.deselectedDict = {}
|
self.deselectedDict = {}
|
||||||
__builtins__["last"] = self.last = None
|
__builtins__["last"] = self.last = None
|
||||||
|
|
||||||
@ -101,6 +102,7 @@ class SelectedNodePaths(DirectObject):
|
|||||||
dnp.highlight(fRecompute = 0)
|
dnp.highlight(fRecompute = 0)
|
||||||
# Add it to the selected dictionary
|
# Add it to the selected dictionary
|
||||||
self.selectedDict[dnp.id()] = dnp
|
self.selectedDict[dnp.id()] = dnp
|
||||||
|
self.selectedList.append(dnp) # [gjeon]
|
||||||
# And update last
|
# And update last
|
||||||
__builtins__["last"] = self.last = dnp
|
__builtins__["last"] = self.last = dnp
|
||||||
# Update cluster servers if this is a cluster client
|
# Update cluster servers if this is a cluster client
|
||||||
@ -120,6 +122,8 @@ class SelectedNodePaths(DirectObject):
|
|||||||
dnp.dehighlight()
|
dnp.dehighlight()
|
||||||
# Remove it from the selected dictionary
|
# Remove it from the selected dictionary
|
||||||
del(self.selectedDict[id])
|
del(self.selectedDict[id])
|
||||||
|
if dnp in self.selectedList: # [gjeon]
|
||||||
|
self.selectedList.remove(dnp)
|
||||||
# And keep track of it in the deselected dictionary
|
# And keep track of it in the deselected dictionary
|
||||||
self.deselectedDict[id] = dnp
|
self.deselectedDict[id] = dnp
|
||||||
# Send a message
|
# Send a message
|
||||||
@ -134,7 +138,8 @@ class SelectedNodePaths(DirectObject):
|
|||||||
Return a list of all selected node paths. No verification of
|
Return a list of all selected node paths. No verification of
|
||||||
connectivity is performed on the members of the list
|
connectivity is performed on the members of the list
|
||||||
"""
|
"""
|
||||||
return self.selectedDict.values()[:]
|
#return self.selectedDict.values()[:]
|
||||||
|
return self.selectedList # [gjeon] now return the list with selected order
|
||||||
|
|
||||||
def __getitem__(self, index):
|
def __getitem__(self, index):
|
||||||
return self.getSelectedAsList()[index]
|
return self.getSelectedAsList()[index]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user