mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
tweaks for intervals
This commit is contained in:
parent
e499b8ff2f
commit
87cd4d5901
@ -21,13 +21,23 @@
|
|||||||
|
|
||||||
def pause(self):
|
def pause(self):
|
||||||
self.interrupt()
|
self.interrupt()
|
||||||
# Kill task
|
# Kill old task(s), including those from a similarly-named but
|
||||||
taskMgr.remove(self.getName() + '-play')
|
# different interval.
|
||||||
|
taskName = self.getName() + '-play'
|
||||||
|
oldTasks = taskMgr.getTasksNamed(taskName)
|
||||||
|
for task in oldTasks:
|
||||||
|
if hasattr(task, "interval"):
|
||||||
|
task.interval.interrupt()
|
||||||
|
taskMgr.remove(task)
|
||||||
return self.getT()
|
return self.getT()
|
||||||
|
|
||||||
def resume(self):
|
def resume(self):
|
||||||
# Spawn task
|
# Spawn task
|
||||||
taskMgr.add(self.__playTask, self.getName() + '-play')
|
import Task
|
||||||
|
taskName = self.getName() + '-play'
|
||||||
|
task = Task.Task(self.__playTask)
|
||||||
|
task.interval = self
|
||||||
|
taskMgr.add(task, taskName)
|
||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
# Nowadays, finish() will implicitly set the interval to its
|
# Nowadays, finish() will implicitly set the interval to its
|
||||||
|
@ -143,7 +143,7 @@ recompute() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void CInterval::
|
INLINE void CInterval::
|
||||||
check_stopped(const char *method_name) const {
|
check_stopped(const char *method_name) const {
|
||||||
if (_state != S_initial && _state != S_final) {
|
if (_state == S_started) {
|
||||||
interval_cat.warning()
|
interval_cat.warning()
|
||||||
<< get_name() << "." << method_name << "() called in state "
|
<< get_name() << "." << method_name << "() called in state "
|
||||||
<< _state << ".\n";
|
<< _state << ".\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user