mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
parent
3c3eee2295
commit
9455fb3f73
@ -67,13 +67,14 @@ class DirectFrame(DirectGuiWidget):
|
|||||||
"""Recreates the given component using the given keyword args."""
|
"""Recreates the given component using the given keyword args."""
|
||||||
assert name in ("geom", "image", "text")
|
assert name in ("geom", "image", "text")
|
||||||
|
|
||||||
if len(states) != self['numStates']:
|
|
||||||
raise ValueError
|
|
||||||
|
|
||||||
# constants should be local to or default arguments of constructors
|
# constants should be local to or default arguments of constructors
|
||||||
for c in range(self['numStates']):
|
for c in range(self['numStates']):
|
||||||
component_name = name + str(c)
|
component_name = name + str(c)
|
||||||
|
|
||||||
|
try:
|
||||||
state = states[c]
|
state = states[c]
|
||||||
|
except IndexError:
|
||||||
|
state = states[-1]
|
||||||
|
|
||||||
if self.hascomponent(component_name):
|
if self.hascomponent(component_name):
|
||||||
if state is None:
|
if state is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user