Skip to content

Commit

Permalink
Merge pull request #164 from Next2D/main
Browse files Browse the repository at this point in the history
publish
  • Loading branch information
ienaga authored Nov 13, 2023
2 parents 9b361f8 + bdfe782 commit 2434b28
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion next2d.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next2d/player",
"version": "1.18.10",
"version": "1.18.11",
"description": "Experience the fast and beautiful anti-aliased rendering of WebGL. You can create rich, interactive graphics, cross-platform applications and games without worrying about browser or device compatibility.",
"author": "Toshiyuki Ienaga<[email protected]> (https://github.com/ienaga/)",
"license": "MIT",
Expand Down
27 changes: 27 additions & 0 deletions packages/ui/src/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export class Job extends EventDispatcher
private _$to: any;
private _$currentTime: number;
private _$timerId: number;
// eslint-disable-next-line no-use-before-define
private _$nextJob: Job | null;

/**
* @param {object} target
Expand Down Expand Up @@ -131,6 +133,13 @@ export class Job extends EventDispatcher
* @private
*/
this._$timerId = 0;

/**
* @type {Job}
* @default null
* @private
*/
this._$nextJob = null;
}

/**
Expand Down Expand Up @@ -271,6 +280,20 @@ export class Job extends EventDispatcher
return this._$target;
}

/**
* @description 指定したjobを次に開始します。nullで解消
* Starts the next specified job, resolved by null
*
* @member {Job | null}
* @default null
* @public
*/
chain (job: Job | null): Job | null
{
this._$nextJob = job;
return job;
}

/**
* @return {void}
* @method
Expand Down Expand Up @@ -392,6 +415,10 @@ export class Job extends EventDispatcher
if (this.hasEventListener(Event.COMPLETE)) {
this.dispatchEvent(new Event(Event.COMPLETE));
}

if (this._$nextJob) {
this._$nextJob.start();
}
} else {
this._$timerId = requestAnimationFrame(() => {
this._$update();
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Next2D } from "@next2d/core";

if (!("next2d" in window)) {

console.log("%c Next2D Player %c 1.18.10 %c https://next2d.app",
console.log("%c Next2D Player %c 1.18.11 %c https://next2d.app",
"color: #fff; background: #5f5f5f",
"color: #fff; background: #4bc729",
"");
Expand Down

0 comments on commit 2434b28

Please sign in to comment.