Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yt
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
任建锋
yt
Commits
ae4bc527
Commit
ae4bc527
authored
Jul 03, 2018
by
任建锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update some code
parent
1f26f494
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
204 additions
and
1 deletion
+204
-1
Module_20180703102528.ts
.history/src/module/Module_20180703102528.ts
+197
-0
Module.js.map
dist/module/Module.js.map
+1
-1
Module.ts
src/module/Module.ts
+5
-0
Module.d.ts
types/module/Module.d.ts
+1
-0
No files found.
.history/src/module/Module_20180703102528.ts
0 → 100644
View file @
ae4bc527
import
{
AnimationGui
}
from
"../others/AnimationGui"
;
import
{
SceneManager
}
from
"../manager/SceneManager"
;
import
{
GuiCreate
}
from
"../others/GuiCreate"
;
import
{
YtLang
}
from
'../util/YtLang'
;
/**
*Created by cuiliqiang on 2018/3/1
* 组件基类
*/
import
{
GuiManager
}
from
"../manager/GuiManager"
;
export
class
Module
{
private
timeoutId
;
protected
view
:
any
;
protected
parent
:
any
;
//事件
protected
doEvents
=
[];
//面板隐藏显示实例
protected
panelsAn
=
new
AnimationGui
(
SceneManager
.
ins
.
scene
,
GuiManager
.
ins
.
fullscreenUI
)
//规则元素
protected
section
:
any
;
/**
* 显示对象(皮肤)
*/
protected
display
:
any
;
/**
* 是否初始化完成
*/
protected
isInit
:
boolean
;
/**
* 点击事件回调池
*/
private
clickCallbackBindPool
:
any
;
constructor
()
{
this
.
initModel
();
this
.
clickCallbackBindPool
=
{};
// var skinClass: any = eval(this.module.skinName);
// this.display = new skinClass();
// this.clickCallbackPool = {};
}
/**
* 初始化数据
*/
protected
initModel
():
void
{
}
/**
* 初始化UI
*/
protected
initUI
():
void
{
}
/**
* 显示
*/
protected
show
(...
args
):
void
{
this
.
removeEvent
();
this
.
updateData
(...
args
)
this
.
addEvent
();
GuiManager
.
ins
.
changeGui
(
this
.
parent
);
}
/**
* 隐藏
*/
protected
hide
():
void
{
this
.
removeEvent
();
GuiManager
.
ins
.
removeGui
(
this
.
parent
);
}
/**
* 添加事件
*/
protected
addEvent
():
void
{
}
/**
* 移除事件
*/
protected
removeEvent
():
void
{
}
/**
* 更新页面
* @param args
*/
public
updateData
(...
args
):
void
{
if
(
!
this
.
isInit
)
{
this
.
initUI
();
this
.
isInit
=
true
;
}
}
/**
* 添加点击事件
* @param display
*
* @param callback
*/
protected
addClick
(
display
:
any
,
callback
:
Function
)
{
this
.
doEvents
[
display
.
name
]
=
display
.
onPointerUpObservable
.
add
(
callback
);
}
/**
* 移除点击事件
* @param display
* @param callback
*/
protected
removeClick
(
display
:
any
):
void
{
display
.
onPointerUpObservable
.
remove
(
this
.
doEvents
[
display
.
name
]);
}
/**
* 延时启用点击事件
* @param display 显示对象
* @param {number} delay 延时事件
*/
protected
delayEnable
(
display
:
any
,
delay
?:
number
):
void
{
display
.
mouseEnable
=
display
.
mouseChildren
=
false
;
//如果已经禁用事件重新计算
if
(
this
.
timeoutId
)
{
clearTimeout
(
this
.
timeoutId
);
}
this
.
timeoutId
=
setTimeout
(
function
()
{
this
.
timeoutId
=
0
;
display
.
mouseEnable
=
display
.
mouseChildren
=
true
;
},
delay
?
delay
:
500
);
}
//dom模板
protected
viewNode
;
//页面HTML模板
protected
listTemplateHtml
(
data
,
config
){
}
//html页面对象
protected
htmlView
;
protected
htmlCreate
(
config
,
data
){
this
.
listTemplateHtml
(
data
,
config
)
document
.
body
.
appendChild
(
this
.
viewNode
);
GuiCreate
.
ins
.
preventDefault
(
this
.
viewNode
)
}
public
dispose
():
void
{
}
/**
* 鼠标事件
* @param enable
*/
protected
enableMouseEvt
(
enable
:
boolean
):
void
{
let
viewList
for
(
viewList
in
this
.
view
){
// console.log(viewList)
if
(
this
.
view
[
viewList
][
"mouseEnable"
]
==
1
||
this
.
view
[
viewList
][
"mouseEnable"
]
==
undefined
){
this
.
view
[
viewList
].
isHitTestVisible
=
enable
;
}
}
}
/**
* 单个元件鼠标事件
* @param enable
*/
protected
enableMouseEvtView
(
view
:
BABYLON
.
GUI
.
Control
,
enable
:
boolean
):
void
{
view
.
isHitTestVisible
=
enable
;
if
(
enable
==
true
){
view
[
"mouseEnable"
]
=
1
;
}
else
{
view
[
"mouseEnable"
]
=
2
;
}
}
}
\ No newline at end of file
dist/module/Module.js.map
View file @
ae4bc527
{"version":3,"file":"Module.js","sourceRoot":"","sources":["../../src/module/Module.ts"],"names":[],"mappings":";;AACA,uDAAoD;AACpD,wDAAqD;AACrD,iDAA8C;AAE9C;;;GAGG;AACH,oDAAiD;AAEjD;IAgCI;QAtBC,IAAI;QACM,aAAQ,GAAC,EAAE,CAAC;QAEpB,UAAU;QACH,aAAQ,GAAC,IAAI,2BAAY,CAAC,2BAAY,CAAC,GAAG,CAAC,KAAK,EAAC,uBAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAmBnF,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;QAClC,oDAAoD;QACnD,kCAAkC;QAClC,+BAA+B;IAClC,CAAC;IAEC;;KAEC;IACO,0BAAS,GAAnB;IAEA,CAAC;IAED;;OAEG;IACO,uBAAM,GAAhB;IAEA,CAAC;IAEJ;;aAES;IACI,qBAAI,GAAd;QAAe,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAClB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,OAAf,IA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,CAAC;SACzB;IACL,CAAC;IACL,aAAC;AAAD,CAAC,AApLD,IAoLC;AApLY,wBAAM"}
\ No newline at end of file
{"version":3,"file":"Module.js","sourceRoot":"","sources":["../../src/module/Module.ts"],"names":[],"mappings":";;AACA,uDAAoD;AACpD,wDAAqD;AACrD,iDAA8C;AAE9C;;;GAGG;AACH,oDAAiD;AAEjD;IAgCI;QAtBC,IAAI;QACM,aAAQ,GAAC,EAAE,CAAC;QAEpB,UAAU;QACH,aAAQ,GAAC,IAAI,2BAAY,CAAC,2BAAY,CAAC,GAAG,CAAC,KAAK,EAAC,uBAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAmBnF,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;QAClC,oDAAoD;QACnD,kCAAkC;QAClC,+BAA+B;IAClC,CAAC;IAEC;;KAEC;IACO,0BAAS,GAAnB;IAEA,CAAC;IAED;;OAEG;IACO,uBAAM,GAAhB;IAEA,CAAC;IAEJ;;aAES;IACI,qBAAI,GAAd;QAAe,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,yBAAO;;QAClB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,UAAU,OAAf,IAAI,EAAe,IAAI,EAAC;QACxB,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,uBAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAEF;;OAEG;IACO,qBAAI,GAAd;QACI,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,uBAAU,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAGA;;OAEG;IACO,yBAAQ,GAAlB;IAEA,CAAC;IAED;;OAEG;IACO,4BAAW,GAArB;IAEA,CAAC;IAED;;;OAGG;IACI,2BAAU,GAAjB;QAAkB,cAAO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,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzC,qBAAS,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC/C,CAAC;IAIM,wBAAO,GAAd;IAEA,CAAC;IAEC;;;KAGC;IACO,+BAAc,GAAxB,UAAyB,MAAe;QACpC,IAAI,QAAQ,CAAA;QACZ,KAAI,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAC;YACvB,wBAAwB;YACxB,IAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,IAAE,CAAC,IAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,IAAE,SAAS,EAAC;gBACrF,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,gBAAgB,GAAC,MAAM,CAAC;aAC9C;SACH;IACL,CAAC;IAGC;;;KAGC;IACO,mCAAkB,GAA5B,UAA6B,IAAwB,EAAC,MAAe;QACjE,IAAI,CAAC,gBAAgB,GAAC,MAAM,CAAC;QAC7B,IAAG,MAAM,IAAE,IAAI,EAAC;YACZ,IAAI,CAAC,aAAa,CAAC,GAAC,CAAC,CAAC;SACzB;aAAI;YACD,IAAI,CAAC,aAAa,CAAC,GAAC,CAAC,CAAC;SACzB;IACL,CAAC;IACL,aAAC;AAAD,CAAC,AAzLD,IAyLC;AAzLY,wBAAM"}
\ No newline at end of file
src/module/Module.ts
View file @
ae4bc527
...
...
@@ -152,12 +152,17 @@ export class Module {
}
//html页面对象
protected
htmlView
;
protected
htmlCreate
(
config
,
data
){
this
.
listTemplateHtml
(
data
,
config
)
document
.
body
.
appendChild
(
this
.
viewNode
);
GuiCreate
.
ins
.
preventDefault
(
this
.
viewNode
)
}
public
dispose
():
void
{
}
...
...
types/module/Module.d.ts
View file @
ae4bc527
...
...
@@ -69,6 +69,7 @@ export declare class Module {
protected
delayEnable
(
display
:
any
,
delay
?:
number
):
void
;
protected
viewNode
:
any
;
protected
listTemplateHtml
(
data
:
any
,
config
:
any
):
void
;
protected
htmlView
:
any
;
protected
htmlCreate
(
config
:
any
,
data
:
any
):
void
;
dispose
():
void
;
/**
...
...
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