@@ -47,74 +47,75 @@ public ActorPanel(Skin skin) {
47
47
faList = new SpriteList (skin );
48
48
// props = new ActorProps(skin);
49
49
50
-
51
50
setContent (tabPanel );
52
51
tabPanel .addTab ("Verbs" , verbList );
53
52
54
- Ctx .project .addPropertyChangeListener (Project .NOTIFY_ACTOR_SELECTED ,
55
- new PropertyChangeListener () {
56
- @ Override
57
- public void propertyChange (PropertyChangeEvent e ) {
58
- BaseActor a = (BaseActor ) e .getNewValue ();
53
+ Ctx .project .addPropertyChangeListener (Project .NOTIFY_ACTOR_SELECTED , new PropertyChangeListener () {
54
+ @ Override
55
+ public void propertyChange (PropertyChangeEvent e ) {
56
+ BaseActor a = (BaseActor ) e .getNewValue ();
59
57
60
- String selTitle = tabPanel .getSelectedIndex () == -1 ? null : tabPanel .getTitleAt (tabPanel .getSelectedIndex ());
61
- tabPanel .clear ();
62
-
63
- tabPanel .addTab ("Verbs" , verbList );
58
+ String selTitle = tabPanel .getSelectedIndex () == -1 ? null
59
+ : tabPanel .getTitleAt (tabPanel .getSelectedIndex ());
60
+ tabPanel .clear ();
64
61
65
- if (a != null ) {
66
-
67
- if (a instanceof SpriteActor && ((SpriteActor ) a ).getRenderer () instanceof AnimationRenderer )
68
- tabPanel .addTab ("Animations" , faList );
62
+ tabPanel .addTab ("Verbs" , verbList );
63
+
64
+ if (a != null ) {
65
+
66
+ if (a instanceof SpriteActor && ((SpriteActor ) a ).getRenderer () instanceof AnimationRenderer )
67
+ tabPanel .addTab ("Animations" , faList );
68
+
69
+ if (a instanceof CharacterActor ) {
70
+ tabPanel .addTab ("Simple Dialogs" , dialogList );
71
+ }
69
72
70
- if (a instanceof CharacterActor ) {
71
- tabPanel .addTab ("Dialogs" , dialogList );
72
- }
73
-
74
-
75
73
// tabPanel.addTab("Actor Props", props);
76
- setTile ("ACTOR " + a .getId ());
77
-
78
- // select previous selected tab
79
- if (selTitle != null ) {
80
- for (int i = 0 ; i < tabPanel .getTabCount (); i ++) {
81
- if (tabPanel .getTitleAt (i ).equals (selTitle )) {
82
- tabPanel .setTab (i );
83
- }
84
- }
74
+ setTile ("ACTOR " + a .getId ());
75
+
76
+ // select previous selected tab
77
+ if (selTitle != null ) {
78
+ for (int i = 0 ; i < tabPanel .getTabCount (); i ++) {
79
+ if (tabPanel .getTitleAt (i ).equals (selTitle )) {
80
+ tabPanel .setTab (i );
85
81
}
86
- } else {
87
- setTile ("ACTOR" );
88
- }
89
-
90
- if (a instanceof SpriteActor && ((SpriteActor ) a ).getRenderer () instanceof AnimationRenderer ) {
91
- HashMap <String , AnimationDesc > anims = ((AnimationRenderer )((SpriteActor ) a ).getRenderer ()).getAnimations ();
92
- if (anims != null )
93
- faList .addElements ((SpriteActor )a , Arrays .asList (anims .values ().toArray (new AnimationDesc [0 ])));
94
- else
95
- faList .addElements ((SpriteActor )a , null );
96
- } else {
97
- faList .addElements (null , null );
98
82
}
99
-
100
- verbList .changeActor ();
101
-
102
- if (a instanceof CharacterActor ) {
103
-
104
- HashMap <String , Dialog > dialogs = ((CharacterActor ) a ).getDialogs ();
105
- if (dialogs != null )
106
- dialogList .addElements ((CharacterActor )a , Arrays .asList (dialogs .values ().toArray (new Dialog [0 ])));
107
- else
108
- dialogList .addElements ((CharacterActor )a , null );
109
- } else {
110
- dialogList .addElements (null , null );
111
- }
112
-
113
- // props.setActorDocument(a);
114
-
115
83
}
84
+ } else {
85
+ setTile ("ACTOR" );
86
+ }
87
+
88
+ if (a instanceof SpriteActor && ((SpriteActor ) a ).getRenderer () instanceof AnimationRenderer ) {
89
+ HashMap <String , AnimationDesc > anims = ((AnimationRenderer ) ((SpriteActor ) a ).getRenderer ())
90
+ .getAnimations ();
91
+ if (anims != null )
92
+ faList .addElements ((SpriteActor ) a ,
93
+ Arrays .asList (anims .values ().toArray (new AnimationDesc [0 ])));
94
+ else
95
+ faList .addElements ((SpriteActor ) a , null );
96
+ } else {
97
+ faList .addElements (null , null );
98
+ }
99
+
100
+ verbList .changeActor ();
101
+
102
+ if (a instanceof CharacterActor ) {
103
+
104
+ HashMap <String , Dialog > dialogs = ((CharacterActor ) a ).getDialogs ();
105
+ if (dialogs != null )
106
+ dialogList .addElements ((CharacterActor ) a ,
107
+ Arrays .asList (dialogs .values ().toArray (new Dialog [0 ])));
108
+ else
109
+ dialogList .addElements ((CharacterActor ) a , null );
110
+ } else {
111
+ dialogList .addElements (null , null );
112
+ }
113
+
114
+ // props.setActorDocument(a);
115
+
116
+ }
117
+
118
+ });
116
119
117
- });
118
-
119
120
}
120
121
}
0 commit comments