@@ -112,6 +112,14 @@ pub fn write_script(ctx: &mut ScriptCtx, game: &Game) -> Result<()> {
112112 ) ) ?;
113113 }
114114 }
115+ ctx. write ( "transform midleft:" . to_string ( ) ) ?;
116+ ctx. indent ( ) ;
117+ ctx. write ( "xalign 0.1 yalign 0.5" . to_string ( ) ) ?;
118+ ctx. unindent ( ) ;
119+ ctx. write ( "transform midright:" . to_string ( ) ) ?;
120+ ctx. indent ( ) ;
121+ ctx. write ( "xalign 0.9 yalign 0.5" . to_string ( ) ) ?;
122+ ctx. unindent ( ) ;
115123
116124 ctx. write ( format ! ( "label start:" ) ) ?;
117125 for ( i, scene) in game. scenes . iter ( ) . enumerate ( ) {
@@ -132,6 +140,8 @@ fn gen_scene(ctx: &mut ScriptCtx, game: &Game, scene: &Scene, i: usize) -> Resul
132140 ctx. write ( format ! ( "zoom 2" ) ) ?;
133141 ctx. unindent ( ) ;
134142
143+ ctx. write ( "with dissolve" . to_string ( ) ) ?;
144+
135145 for d in scene. script . iter ( ) {
136146 if game
137147 . characters
@@ -142,18 +152,13 @@ fn gen_scene(ctx: &mut ScriptCtx, game: &Game, scene: &Scene, i: usize) -> Resul
142152 {
143153 if !char_pos. contains_key ( & d. speaker ) {
144154 let position = match char_pos. len ( ) {
145- 1 => "left " ,
146- 2 => "right " ,
155+ 0 => "midleft " ,
156+ 1 => "midright " ,
147157 _ => "center" ,
148158 } ;
149159
150160 char_pos. insert ( d. speaker . clone ( ) , position. to_string ( ) ) ;
151161 }
152- ctx. write ( format ! (
153- r#"{} "{}""# ,
154- d. speaker,
155- d. content. split( ": " ) . last( ) . unwrap_or( d. content. as_str( ) )
156- ) ) ?;
157162 let express: String = if EXPRESSIONS . contains ( & d. facial_expression . as_str ( ) ) {
158163 d. facial_expression . clone ( )
159164 } else {
@@ -163,6 +168,11 @@ fn gen_scene(ctx: &mut ScriptCtx, game: &Game, scene: &Scene, i: usize) -> Resul
163168 "show {}_img {} at {}" ,
164169 d. speaker, express, char_pos[ & d. speaker]
165170 ) ) ?;
171+ ctx. write ( format ! (
172+ r#"{} "{}""# ,
173+ d. speaker,
174+ d. content. split( ": " ) . last( ) . unwrap_or( d. content. as_str( ) )
175+ ) ) ?;
166176 } else {
167177 ctx. write ( format ! ( r#""{}""# , d. content) ) ?;
168178 }
0 commit comments