1
1
import Client from './Client' ;
2
+ import EventType from './ui/scripting/EventType' ;
2
3
import { ModelFFX } from './ui/components' ;
3
4
import * as glueScriptFunctions from './ui/scripting/globals/glue' ;
4
5
@@ -19,11 +20,25 @@ client.ui.factories.register('ModelFFX', ModelFFX);
19
20
// await client.ui.load('Interface\\GlueXML\\GlueXML.toc');
20
21
// await client.ui.load('Interface\\FrameXML\\FrameXML.toc');
21
22
22
- console . timeLog ( 'Client load time' , client ) ;
23
+ console . timeLog ( 'Client load time' ) ;
23
24
24
25
// TODO: Should be handled by GlueMgr
25
- // client.ui.scripting.execute('SetGlueScreen("login")');
26
+ client . ui . scripting . signalEvent ( EventType . FRAMES_LOADED ) ;
27
+ client . ui . scripting . signalEvent ( EventType . SET_GLUE_SCREEN , '%s' , 'login' ) ;
28
+
29
+ let last = new Date ( ) ;
30
+ const updateAndRender = ( ) => {
31
+ const now = new Date ( ) ;
32
+ const diff = + now - + last ;
33
+
34
+ client . ui . root . onLayerUpdate ( diff ) ;
35
+ client . screen . render ( ) ;
36
+
37
+ last = now ;
38
+ } ;
26
39
27
40
// Postpone rendering to allow resources to load (for now)
28
- setTimeout ( client . screen . render , 1000 ) ;
41
+ setTimeout ( updateAndRender , 1000 ) ;
42
+
43
+ document . addEventListener ( 'click' , updateAndRender ) ;
29
44
} ) ( ) ;
0 commit comments