Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
renderingEngine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王剑峰
renderingEngine
Commits
aed88050
Commit
aed88050
authored
Nov 27, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加数据绑定的索引支持
parent
d0c4741f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
15 deletions
+33
-15
engine.js
debug/engine.js
+16
-7
engine.js.map
debug/engine.js.map
+1
-1
data-center.ts
src/zeroing/game-warpper/data-center.ts
+7
-2
Image.ts
src/zeroing/game-warpper/nodes/Image.ts
+4
-2
Label.ts
src/zeroing/game-warpper/nodes/Label.ts
+4
-2
utils.ts
src/zeroing/utils/utils.ts
+1
-1
No files found.
debug/engine.js
View file @
aed88050
...
@@ -1762,7 +1762,7 @@
...
@@ -1762,7 +1762,7 @@
return
!
isNaN
(
v
)
&&
v
!==
null
&&
v
!==
undefined
;
return
!
isNaN
(
v
)
&&
v
!==
null
&&
v
!==
undefined
;
}
}
var
ESCAPE_REG_EXP
=
/
\$\{[\u
4e00-
\u
9fa5_a-zA-Z0-9
]
+
\}
/g
;
var
ESCAPE_REG_EXP
=
/
\$\{[\u
4e00-
\u
9fa5_a-zA-Z0-9
\|
]
+
\}
/g
;
var
linkedFlag
=
'$_linked_$'
;
var
linkedFlag
=
'$_linked_$'
;
var
nodeScheme
=
'node://'
;
var
nodeScheme
=
'node://'
;
function
arrayFind
(
arr
,
callback
)
{
function
arrayFind
(
arr
,
callback
)
{
...
@@ -2109,10 +2109,15 @@
...
@@ -2109,10 +2109,15 @@
var
result
=
str
;
var
result
=
str
;
for
(
var
_i
=
0
,
escapes_1
=
escapes
;
_i
<
escapes_1
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
escapes_1
=
escapes
;
_i
<
escapes_1
.
length
;
_i
++
)
{
var
escape
=
escapes_1
[
_i
];
var
escape
=
escapes_1
[
_i
];
var
watcher
=
this
.
getWatcher
(
escape
);
var
args
=
escape
.
split
(
'|'
);
var
name
=
args
[
0
];
var
watcher
=
this
.
getWatcher
(
name
);
try
{
try
{
var
data
=
this
.
getDataByPath
(
watcher
.
path
,
true
);
var
data
=
this
.
getDataByPath
(
watcher
.
path
,
true
);
result
=
result
.
replace
(
new
RegExp
(
'
\\
$
\\
{'
+
escape
+
'
\\
}'
,
'g'
),
data
);
if
(
args
[
1
]
!==
undefined
)
{
data
=
data
[
args
[
1
]];
}
result
=
result
.
replace
(
new
RegExp
(
'
\\
$
\\
{'
+
escape
.
replace
(
/
\|
/g
,
'
\\
|'
)
+
'
\\
}'
,
'g'
),
data
);
}
}
catch
(
e
)
{
catch
(
e
)
{
}
}
...
@@ -12163,8 +12168,10 @@
...
@@ -12163,8 +12168,10 @@
this
.
_escapes
.
splice
(
0
);
this
.
_escapes
.
splice
(
0
);
for
(
var
_i
=
0
,
matchResult_1
=
matchResult
;
_i
<
matchResult_1
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
matchResult_1
=
matchResult
;
_i
<
matchResult_1
.
length
;
_i
++
)
{
var
item
=
matchResult_1
[
_i
];
var
item
=
matchResult_1
[
_i
];
var
eventName
=
item
.
substr
(
2
,
item
.
length
-
3
);
var
escape
=
item
.
substr
(
2
,
item
.
length
-
3
);
this
.
_escapes
.
push
(
eventName
);
var
args
=
escape
.
split
(
'|'
);
var
eventName
=
args
[
0
];
this
.
_escapes
.
push
(
escape
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
this
.
_registeredEvents
.
push
(
eventName
);
this
.
_registeredEvents
.
push
(
eventName
);
}
}
...
@@ -12203,8 +12210,10 @@
...
@@ -12203,8 +12210,10 @@
this
.
_escapes
.
splice
(
0
);
this
.
_escapes
.
splice
(
0
);
for
(
var
_i
=
0
,
matchResult_1
=
matchResult
;
_i
<
matchResult_1
.
length
;
_i
++
)
{
for
(
var
_i
=
0
,
matchResult_1
=
matchResult
;
_i
<
matchResult_1
.
length
;
_i
++
)
{
var
item
=
matchResult_1
[
_i
];
var
item
=
matchResult_1
[
_i
];
var
eventName
=
item
.
substr
(
2
,
item
.
length
-
3
);
var
escape
=
item
.
substr
(
2
,
item
.
length
-
3
);
this
.
_escapes
.
push
(
eventName
);
var
args
=
escape
.
split
(
'|'
);
var
eventName
=
args
[
0
];
this
.
_escapes
.
push
(
escape
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
this
.
_registeredEvents
.
push
(
eventName
);
this
.
_registeredEvents
.
push
(
eventName
);
}
}
...
...
debug/engine.js.map
View file @
aed88050
This diff is collapsed.
Click to expand it.
src/zeroing/game-warpper/data-center.ts
View file @
aed88050
...
@@ -72,10 +72,15 @@ export class DataCenter extends EventDispatcher {
...
@@ -72,10 +72,15 @@ export class DataCenter extends EventDispatcher {
formatString
(
str
,
escapes
)
{
formatString
(
str
,
escapes
)
{
let
result
=
str
;
let
result
=
str
;
for
(
let
escape
of
escapes
)
{
for
(
let
escape
of
escapes
)
{
let
watcher
=
this
.
getWatcher
(
escape
);
let
args
=
escape
.
split
(
'|'
);
let
name
=
args
[
0
];
let
watcher
=
this
.
getWatcher
(
name
);
try
{
try
{
let
data
=
this
.
getDataByPath
(
watcher
.
path
,
true
);
let
data
=
this
.
getDataByPath
(
watcher
.
path
,
true
);
result
=
result
.
replace
(
new
RegExp
(
'
\\
$
\\
{'
+
escape
+
'
\\
}'
,
'g'
),
data
);
if
(
args
[
1
]
!==
undefined
){
data
=
data
[
args
[
1
]];
}
result
=
result
.
replace
(
new
RegExp
(
'
\\
$
\\
{'
+
escape
.
replace
(
/
\|
/g
,
'
\\
|'
)
+
'
\\
}'
,
'g'
),
data
);
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
...
...
src/zeroing/game-warpper/nodes/Image.ts
View file @
aed88050
...
@@ -56,8 +56,10 @@ export class Image extends Sprite {
...
@@ -56,8 +56,10 @@ export class Image extends Sprite {
this
.
_originText
=
value
;
this
.
_originText
=
value
;
this
.
_escapes
.
splice
(
0
);
this
.
_escapes
.
splice
(
0
);
for
(
let
item
of
matchResult
)
{
for
(
let
item
of
matchResult
)
{
let
eventName
=
item
.
substr
(
2
,
item
.
length
-
3
);
let
escape
=
item
.
substr
(
2
,
item
.
length
-
3
);
this
.
_escapes
.
push
(
eventName
);
let
args
=
escape
.
split
(
'|'
);
let
eventName
=
args
[
0
];
this
.
_escapes
.
push
(
escape
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
this
.
_registeredEvents
.
push
(
eventName
);
this
.
_registeredEvents
.
push
(
eventName
);
}
}
...
...
src/zeroing/game-warpper/nodes/Label.ts
View file @
aed88050
...
@@ -26,8 +26,10 @@ export class Label extends TextField {
...
@@ -26,8 +26,10 @@ export class Label extends TextField {
this
.
_originText
=
value
;
this
.
_originText
=
value
;
this
.
_escapes
.
splice
(
0
);
this
.
_escapes
.
splice
(
0
);
for
(
let
item
of
matchResult
)
{
for
(
let
item
of
matchResult
)
{
let
eventName
=
item
.
substr
(
2
,
item
.
length
-
3
);
let
escape
=
item
.
substr
(
2
,
item
.
length
-
3
);
this
.
_escapes
.
push
(
eventName
);
let
args
=
escape
.
split
(
'|'
);
let
eventName
=
args
[
0
];
this
.
_escapes
.
push
(
escape
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
dataCenter
.
addEventListener
(
eventName
,
this
.
onDataMutated
,
this
);
this
.
_registeredEvents
.
push
(
eventName
);
this
.
_registeredEvents
.
push
(
eventName
);
}
}
...
...
src/zeroing/utils/utils.ts
View file @
aed88050
...
@@ -4,7 +4,7 @@ import {registerScriptDef} from "..";
...
@@ -4,7 +4,7 @@ import {registerScriptDef} from "..";
* Created by rockyl on 2019-11-08.
* Created by rockyl on 2019-11-08.
*/
*/
export
const
ESCAPE_REG_EXP
=
/
\$\{[\u
4e00-
\u
9fa5_a-zA-Z0-9
]
+
\}
/g
;
export
const
ESCAPE_REG_EXP
=
/
\$\{[\u
4e00-
\u
9fa5_a-zA-Z0-9
\|
]
+
\}
/g
;
export
const
linkedFlag
=
'$_linked_$'
;
export
const
linkedFlag
=
'$_linked_$'
;
export
const
nodeScheme
=
'node://'
;
export
const
nodeScheme
=
'node://'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment