67
80
cMoving_Platform *cMoving_Platform :: Copy( void )
69
82
cMoving_Platform *moving_platform = new cMoving_Platform( startposx, startposy );
70
moving_platform->Set_Massivetype( massivetype );
71
moving_platform->Set_Direction( start_direction );
83
moving_platform->Set_Massive_Type( massivetype );
84
moving_platform->Set_Direction( start_direction, 1 );
72
85
moving_platform->Set_Max_Distance( max_distance );
73
86
moving_platform->Set_Speed( speed );
87
moving_platform->Set_Touch_Time( touch_time );
88
moving_platform->Set_Shake_Time( shake_time );
89
moving_platform->Set_Touch_Move_Time( touch_move_time );
74
90
moving_platform->Set_Middle_Count( middle_count );
75
moving_platform->Set_image_top_left( images[0] );
76
moving_platform->Set_image_top_middle( images[1] );
77
moving_platform->Set_image_top_right( images[2] );
91
moving_platform->Set_Image_Top_Left( images[0] );
92
moving_platform->Set_Image_Top_Middle( images[1] );
93
moving_platform->Set_Image_Top_Right( images[2] );
79
95
return moving_platform;
82
void cMoving_Platform :: Create_from_Stream( XMLAttributes &attributes )
98
void cMoving_Platform :: Create_from_Stream( CEGUI::XMLAttributes &attributes )
85
101
Set_Pos( static_cast<float>(attributes.getValueAsInteger( "posx" )), static_cast<float>(attributes.getValueAsInteger( "posy" )), 1 );
87
Set_Massivetype( Get_Massivetype_id( attributes.getValueAsString( "massive_type", Get_Massivetype_name( massivetype ) ).c_str() ) );
103
Set_Massive_Type( Get_Massive_Type_Id( attributes.getValueAsString( "massive_type", Get_Massive_Type_Name( massivetype ) ).c_str() ) );
89
Set_Direction( Get_Direction_id( attributes.getValueAsString( "direction", Get_Direction_name( start_direction ) ).c_str() ) );
105
Set_Direction( Get_Direction_Id( attributes.getValueAsString( "direction", Get_Direction_Name( start_direction ) ).c_str() ), 1 );
91
107
Set_Max_Distance( attributes.getValueAsInteger( "max_distance", max_distance ) );
93
109
Set_Speed( attributes.getValueAsFloat( "speed", speed ) );
111
Set_Touch_Time( attributes.getValueAsFloat( "touch_time", touch_time ) );
113
Set_Shake_Time( attributes.getValueAsFloat( "shake_time", shake_time ) );
115
Set_Touch_Move_Time( attributes.getValueAsFloat( "touch_move_time", touch_move_time ) );
94
116
// middle image count
95
117
Set_Middle_Count( attributes.getValueAsInteger( "middle_img_count", middle_count ) );
97
Set_image_top_left( pVideo->Get_Surface( attributes.getValueAsString( "image_top_left", images[0]->Get_filename() ).c_str() ) );
99
Set_image_top_middle( pVideo->Get_Surface( attributes.getValueAsString( "image_top_middle", images[1]->Get_filename() ).c_str() ) );
101
Set_image_top_right( pVideo->Get_Surface( attributes.getValueAsString( "image_top_right", images[2]->Get_filename() ).c_str() ) );
119
Set_Image_Top_Left( pVideo->Get_Surface( attributes.getValueAsString( "image_top_left", images[0]->Get_Filename() ).c_str() ) );
121
Set_Image_Top_Middle( pVideo->Get_Surface( attributes.getValueAsString( "image_top_middle", images[1]->Get_Filename() ).c_str() ) );
123
Set_Image_Top_Right( pVideo->Get_Surface( attributes.getValueAsString( "image_top_right", images[2]->Get_Filename() ).c_str() ) );
104
126
void cMoving_Platform :: Save_to_Stream( ofstream &file )
110
132
file << "\t\t<Property name=\"posx\" value=\"" << static_cast<int>(startposx) << "\" />" << std::endl;
111
133
file << "\t\t<Property name=\"posy\" value=\"" << static_cast<int>(startposy) << "\" />" << std::endl;
113
file << "\t\t<Property name=\"massive_type\" value=\"" << Get_Massivetype_name( massivetype ) << "\" />" << std::endl;
135
file << "\t\t<Property name=\"massive_type\" value=\"" << Get_Massive_Type_Name( massivetype ) << "\" />" << std::endl;
115
file << "\t\t<Property name=\"direction\" value=\"" << Get_Direction_name( start_direction ) << "\" />" << std::endl;
137
file << "\t\t<Property name=\"direction\" value=\"" << Get_Direction_Name( start_direction ) << "\" />" << std::endl;
117
139
file << "\t\t<Property name=\"max_distance\" value=\"" << max_distance << "\" />" << std::endl;
119
141
file << "\t\t<Property name=\"speed\" value=\"" << speed << "\" />" << std::endl;
143
file << "\t\t<Property name=\"touch_time\" value=\"" << touch_time << "\" />" << std::endl;
145
file << "\t\t<Property name=\"shake_time\" value=\"" << shake_time << "\" />" << std::endl;
147
file << "\t\t<Property name=\"touch_move_time\" value=\"" << touch_move_time << "\" />" << std::endl;
120
148
// middle image count
121
149
file << "\t\t<Property name=\"middle_img_count\" value=\"" << middle_count << "\" />" << std::endl;
122
150
// image top left
123
file << "\t\t<Property name=\"image_top_left\" value=\"" << images[0]->Get_filename( 1 ) << "\" />" << std::endl;
151
file << "\t\t<Property name=\"image_top_left\" value=\"" << images[0]->Get_Filename( 1 ) << "\" />" << std::endl;
124
152
// image top middle
125
file << "\t\t<Property name=\"image_top_middle\" value=\"" << images[1]->Get_filename( 1 ) << "\" />" << std::endl;
153
file << "\t\t<Property name=\"image_top_middle\" value=\"" << images[1]->Get_Filename( 1 ) << "\" />" << std::endl;
126
154
// image top right
127
file << "\t\t<Property name=\"image_top_right\" value=\"" << images[2]->Get_filename( 1 ) << "\" />" << std::endl;
155
file << "\t\t<Property name=\"image_top_right\" value=\"" << images[2]->Get_Filename( 1 ) << "\" />" << std::endl;
129
157
// end moving_platform
130
158
file << "\t</moving_platform>" << std::endl;
133
void cMoving_Platform :: Set_Massivetype( MassiveType mtype )
161
void cMoving_Platform :: Load_from_Savegame( cSave_Level_Object *save_object )
164
if( save_object->exists( "direction" ) )
166
direction = static_cast<ObjectDirection>(string_to_int( save_object->Get_Value( "direction" ) ));
170
if( save_object->exists( "platform_state" ) )
172
platform_state = static_cast<Moving_Platform_State>(string_to_int( save_object->Get_Value( "platform_state" ) ));
176
if( save_object->exists( "new_posx" ) )
178
Set_Pos_X( string_to_float( save_object->Get_Value( "new_posx" ) ) );
182
if( save_object->exists( "new_posy" ) )
184
Set_Pos_Y( string_to_float( save_object->Get_Value( "new_posy" ) ) );
188
if( save_object->exists( "velx" ) )
190
velx = string_to_float( save_object->Get_Value( "velx" ) );
194
if( save_object->exists( "vely" ) )
196
vely = string_to_float( save_object->Get_Value( "vely" ) );
200
if( save_object->exists( "visible" ) )
202
Set_Visible( string_to_int( save_object->Get_Value( "visible" ) ) > 0 );
206
cSave_Level_Object *cMoving_Platform :: Save_to_Savegame( void )
208
cSave_Level_Object *save_object = new cSave_Level_Object();
211
save_object->type = type;
212
save_object->properties.push_back( cSave_Level_Object_Property( "posx", int_to_string( static_cast<int>(startposx) ) ) );
213
save_object->properties.push_back( cSave_Level_Object_Property( "posy", int_to_string( static_cast<int>(startposy) ) ) );
216
save_object->properties.push_back( cSave_Level_Object_Property( "direction", int_to_string( direction ) ) );
219
save_object->properties.push_back( cSave_Level_Object_Property( "platform_state", int_to_string( platform_state ) ) );
221
// new position ( only save if needed )
222
if( startposx != posx || startposy != posy )
224
save_object->properties.push_back( cSave_Level_Object_Property( "new_posx", int_to_string( static_cast<int>(posx) ) ) );
225
save_object->properties.push_back( cSave_Level_Object_Property( "new_posy", int_to_string( static_cast<int>(posy) ) ) );
229
save_object->properties.push_back( cSave_Level_Object_Property( "velx", float_to_string( velx ) ) );
230
save_object->properties.push_back( cSave_Level_Object_Property( "vely", float_to_string( vely ) ) );
232
// visible ( only save if needed )
235
save_object->properties.push_back( cSave_Level_Object_Property( "visible", int_to_string( visible ) ) );
241
void cMoving_Platform :: Set_Massive_Type( MassiveType mtype )
135
243
massivetype = mtype;
239
if( direction == DIR_UP )
244
if( posy - startposy < 0 )
246
direction = DIR_DOWN;
249
else if( direction == DIR_DOWN )
254
if( posy - startposy > max_distance )
259
else if( direction == DIR_LEFT )
264
if( posx - startposx < 0 )
266
direction = DIR_RIGHT;
269
else if( direction == DIR_RIGHT )
274
if( posx - startposx > max_distance )
276
direction = DIR_LEFT;
401
// move time should be smaller than touch time because it should
402
// start moving (if it is moving) before shaking starts.
403
// if larger than touch time then the platform state will change
404
// and touch_counter will never be more than move_time
405
if( touch_time || touch_move_time )
407
if( platform_state == PLATFORM_TOUCHED )
409
touch_counter += pFramerate->speedfactor;
416
if( platform_state == PLATFORM_TOUCHED && touch_counter > touch_time )
418
platform_state = PLATFORM_SHAKE;
420
else if( platform_state == PLATFORM_SHAKE )
422
shake_dir_counter += pFramerate->speedfactor;
424
// move into opposite direction
425
if( shake_dir_counter > 0.8f )
428
if( posx > startposx )
439
Move( move_x, 0, 1 );
441
shake_dir_counter = 0;
444
shake_counter += pFramerate->speedfactor;
446
if( shake_counter > shake_time )
448
platform_state = PLATFORM_FALL;
451
else if( platform_state == PLATFORM_FALL )
455
vely += 2.1f * pFramerate->speedfactor;
457
// limit falling velocity
464
// drop objects when falling fast
465
if( can_be_ground && vely > 15 )
470
if( posx > startposx )
472
Add_Rotation_Z( 1.5f );
476
Add_Rotation_Z( -1.5f );
480
if( col_rect.y + col_rect.h > pActive_Camera->limit_rect.y + game_res_h )
482
platform_state = PLATFORM_STAY;
489
if( speed && platform_state != PLATFORM_FALL && ( !touch_move_time || touch_counter > touch_move_time ) )
491
// distance to final position
492
float dist_to_final_pos = 0;
494
if( direction == DIR_LEFT )
496
dist_to_final_pos = 0 - ( startposx - posx );
498
else if( direction == DIR_RIGHT )
500
dist_to_final_pos = max_distance + ( startposx - posx );
502
else if( direction == DIR_UP )
504
dist_to_final_pos = 0 - ( startposy - posy );
506
else if( direction == DIR_DOWN )
508
dist_to_final_pos = max_distance + ( startposy - posy );
511
// reached final position
512
if( dist_to_final_pos <= 0 )
515
Set_Velocity( 0, 0 );
517
Set_Direction( Get_Opposite_Direction( direction ) );
519
// slow down near final position
520
else if( dist_to_final_pos < max_distance * 0.2f )
522
if( direction == DIR_DOWN )
527
if( vely > speed * 0.3f )
529
vely *= 1 - ( 0.05f * pFramerate->speedfactor );
531
// reached lowest value
532
if( vely <= speed * 0.3f )
544
else if( direction == DIR_UP )
549
if( vely < -speed * 0.3f )
551
vely *= 1 - ( 0.05f * pFramerate->speedfactor );
553
// reached lowest value
554
if( vely >= -speed * 0.3f )
556
vely = -speed * 0.3f;
563
vely = -speed * 0.3f;
566
else if( direction == DIR_LEFT )
571
if( velx < -speed * 0.3f )
573
velx *= 1 - ( 0.05f * pFramerate->speedfactor );
575
// reached lowest value
576
if( velx >= -speed * 0.3f )
578
velx = -speed * 0.3f;
585
velx = -speed * 0.3f;
588
else if( direction == DIR_RIGHT )
593
if( velx > speed * 0.3f )
595
velx *= 1 - ( 0.05f * pFramerate->speedfactor );
597
// reached lowest value
598
if( velx <= speed * 0.3f )
611
// not near final position
288
// todo : update & optimize
290
float startx = startposx;
293
Set_Image( 0, 1, 0 );
294
cImageObjectSprite::Draw( request );
295
posx += Get_Image( 0 )->w;
296
startposx += Get_Image( 0 )->w;
297
Update_Position_Rect();
300
Set_Image( 1, 1, 0 );
301
for( unsigned int i = 0; i < middle_count; i++ )
303
cImageObjectSprite::Draw();
304
posx += Get_Image( 1 )->w;
305
startposx += Get_Image( 1 )->w;
306
Update_Position_Rect();
310
Set_Image( 2, 1, 0 );
311
cImageObjectSprite::Draw();
626
cSurfaceRequest *surface_request;
634
start_image = images[0];
637
surface_request = new cSurfaceRequest();
638
// draw only first image complete
639
cImageObjectSprite::Draw( surface_request );
640
surface_request->pos_x += x;
643
pRenderer->Add( surface_request );
651
start_image = images[1];
652
for( unsigned int i = 0; i < middle_count; i++ )
655
surface_request = new cSurfaceRequest();
656
cImageObjectSprite::Draw_Image( surface_request);
657
surface_request->pos_x += x;
660
pRenderer->Add( surface_request );
669
start_image = images[2];
671
surface_request = new cSurfaceRequest();
672
cImageObjectSprite::Draw_Image( surface_request );
673
surface_request->pos_x += x;
676
pRenderer->Add( surface_request );
317
680
Update_Position_Rect();
319
682
// draw distance rect
320
if( editor_level_enabled )
683
if( editor_level_enabled && speed )
322
if( direction == DIR_RIGHT || direction == DIR_LEFT )
324
pVideo->Draw_Rect( startposx - pCamera->x, startposy - pCamera->y, max_distance + col_rect.w, 15, posz - 0.000001f, &whitealpha128 );
326
else if( direction == DIR_DOWN || direction == DIR_UP )
328
pVideo->Draw_Rect( startposx - pCamera->x, startposy - pCamera->y, 15, max_distance + col_rect.h, posz - 0.000001f, &whitealpha128 );
685
if( start_direction == DIR_RIGHT || start_direction == DIR_LEFT )
687
pVideo->Draw_Rect( startposx - pActive_Camera->x, startposy - pActive_Camera->y, max_distance + col_rect.w, 15, posz - 0.000001f, &whitealpha128 );
689
else if( start_direction == DIR_DOWN || start_direction == DIR_UP )
691
pVideo->Draw_Rect( startposx - pActive_Camera->x, startposy - pActive_Camera->y, 15, max_distance + col_rect.h, posz - 0.000001f, &whitealpha128 );
333
void cMoving_Platform :: Update_rect( void )
696
void cMoving_Platform :: Update_Rect( void )
339
col_rect.w += images[0]->col_w;
340
705
rect.w += images[0]->w;
344
col_rect.w += images[1]->col_w * middle_count;
345
709
rect.w += images[1]->w * middle_count;
349
col_rect.w += images[2]->col_w;
350
713
rect.w += images[2]->w;
353
718
start_rect.w = rect.w;
356
bool cMoving_Platform :: is_Update_valid( void )
721
void cMoving_Platform :: Update_Velocity( void )
724
if( speed > 0 && ( !touch_move_time || touch_counter > touch_move_time ) )
726
if( direction == DIR_UP )
730
vely += -speed * 0.1f * pFramerate->speedfactor;
733
else if( direction == DIR_DOWN )
737
vely += speed * 0.1f * pFramerate->speedfactor;
740
else if( direction == DIR_LEFT )
744
velx += -speed * 0.1f * pFramerate->speedfactor;
747
else if( direction == DIR_RIGHT )
751
velx += speed * 0.1f * pFramerate->speedfactor;
758
Set_Velocity( 0, 0 );
762
bool cMoving_Platform :: Is_Update_Valid( void )
404
824
// send collision
405
825
Send_Collision( collision );
828
if( collision->direction == DIR_TOP )
830
if( ( touch_time || touch_move_time ) && platform_state == PLATFORM_STAY )
832
platform_state = PLATFORM_TOUCHED;
409
838
void cMoving_Platform :: Editor_Activate( void )
411
WindowManager &wmgr = WindowManager::getSingleton();
840
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
414
Editbox *editbox = static_cast<Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_max_distance" ));
843
CEGUI::Editbox *editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_max_distance" ));
844
Editor_Add( UTF8_("Distance"), UTF8_("Movable distance into its direction"), editbox, 120 );
416
Editor_Add( editbox, 120 );
417
editbox->setTooltipText( "Max Distance" );
418
846
editbox->setText( int_to_string( max_distance ) );
419
editbox->subscribeEvent( Editbox::EventTextChanged, Event::Subscriber( &cMoving_Platform::Editor_Max_Distance_Key, this ) );
847
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Max_Distance_Key, this ) );
422
editbox = static_cast<Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_speed" ));
423
editbox->setTooltipText( "Speed" );
424
Editor_Add( editbox, 120 );
850
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_speed" ));
851
Editor_Add( UTF8_("Speed"), UTF8_("Maximum speed"), editbox, 120 );
426
853
editbox->setText( float_to_string( speed ) );
427
editbox->subscribeEvent( Editbox::EventTextChanged, Event::Subscriber( &cMoving_Platform::Editor_Speed_Key, this ) );
854
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Speed_Key, this ) );
857
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_touch_time" ));
858
Editor_Add( UTF8_("Touch time"), UTF8_("Time when touched until shaking starts"), editbox, 120 );
860
editbox->setText( float_to_string( touch_time ) );
861
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Touch_Time_Key, this ) );
864
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_shake_time" ));
865
Editor_Add( UTF8_("Shake time"), UTF8_("Time it's shaking until falling"), editbox, 120 );
867
editbox->setText( float_to_string( shake_time ) );
868
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Shake_Time_Key, this ) );
871
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_move_time" ));
872
Editor_Add( UTF8_("Touch move time"), UTF8_("If set does not move until this time has elapsed after touched"), editbox, 120 );
874
editbox->setText( float_to_string( touch_move_time ) );
875
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Touch_Move_Time_Key, this ) );
429
877
// horizontal middle image count
430
editbox = static_cast<Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_hor_middle_count" ));
431
editbox->setTooltipText( "Horizontal Middle Image Count" );
432
Editor_Add( editbox, 120 );
878
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_hor_middle_count" ));
879
Editor_Add( UTF8_("Hor image count"), UTF8_("Horizontal middle image count"), editbox, 120 );
434
881
editbox->setText( int_to_string( middle_count ) );
435
editbox->subscribeEvent( Editbox::EventTextChanged, Event::Subscriber( &cMoving_Platform::Editor_Hor_Middle_Count_Key, this ) );
882
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Hor_Middle_Count_Key, this ) );
437
884
// image top left
438
editbox = static_cast<Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_image_top_left" ));
439
editbox->setTooltipText( "Image Top Left" );
440
Editor_Add( editbox, 200 );
885
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_image_top_left" ));
886
Editor_Add( UTF8_("Image top left"), UTF8_("Image top left"), editbox, 200 );
442
editbox->setText( images[0]->Get_filename( 1 ) );
443
editbox->subscribeEvent( Editbox::EventTextChanged, Event::Subscriber( &cMoving_Platform::Editor_Image_Top_Left_Key, this ) );
888
editbox->setText( images[0]->Get_Filename( 1 ) );
889
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Image_Top_Left_Key, this ) );
445
891
// image top middle
446
editbox = static_cast<Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_image_top_middle" ));
447
editbox->setTooltipText( "Image Top Middle" );
448
Editor_Add( editbox, 200 );
892
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_image_top_middle" ));
893
Editor_Add( UTF8_("Image top middle"), UTF8_("Image top middle"), editbox, 200 );
450
editbox->setText( images[1]->Get_filename( 1 ) );
451
editbox->subscribeEvent( Editbox::EventTextChanged, Event::Subscriber( &cMoving_Platform::Editor_Image_Top_Middle_Key, this ) );
895
editbox->setText( images[1]->Get_Filename( 1 ) );
896
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Image_Top_Middle_Key, this ) );
453
898
// image top right
454
editbox = static_cast<Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_image_top_right" ));
455
editbox->setTooltipText( "Image Top Right" );
456
Editor_Add( editbox, 200 );
458
editbox->setText( images[2]->Get_filename( 1 ) );
459
editbox->subscribeEvent( Editbox::EventTextChanged, Event::Subscriber( &cMoving_Platform::Editor_Image_Top_Right_Key, this ) );
899
editbox = static_cast<CEGUI::Editbox *>(wmgr.createWindow( "TaharezLook/Editbox", "editor_moving_platform_image_top_right" ));
900
Editor_Add( UTF8_("Image top right"), UTF8_("Image top right"), editbox, 200 );
902
editbox->setText( images[2]->Get_Filename( 1 ) );
903
editbox->subscribeEvent( CEGUI::Editbox::EventTextChanged, CEGUI::Event::Subscriber( &cMoving_Platform::Editor_Image_Top_Right_Key, this ) );
466
bool cMoving_Platform :: Editor_Max_Distance_Key( const EventArgs &event )
909
bool cMoving_Platform :: Editor_Max_Distance_Key( const CEGUI::EventArgs &event )
468
const WindowEventArgs &windowEventArgs = static_cast<const WindowEventArgs&>( event );
469
string str_text = static_cast<Editbox *>( windowEventArgs.window )->getText().c_str();
911
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
912
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
471
914
Set_Max_Distance( string_to_int( str_text ) );
476
bool cMoving_Platform :: Editor_Speed_Key( const EventArgs &event )
919
bool cMoving_Platform :: Editor_Speed_Key( const CEGUI::EventArgs &event )
478
const WindowEventArgs &windowEventArgs = static_cast<const WindowEventArgs&>( event );
479
string str_text = static_cast<Editbox *>( windowEventArgs.window )->getText().c_str();
921
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
922
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
481
924
Set_Speed( string_to_float( str_text ) );
486
bool cMoving_Platform :: Editor_Hor_Middle_Count_Key( const EventArgs &event )
488
const WindowEventArgs &windowEventArgs = static_cast<const WindowEventArgs&>( event );
489
string str_text = static_cast<Editbox *>( windowEventArgs.window )->getText().c_str();
929
bool cMoving_Platform :: Editor_Touch_Time_Key( const CEGUI::EventArgs &event )
931
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
932
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
934
Set_Touch_Time( string_to_float( str_text ) );
939
bool cMoving_Platform :: Editor_Shake_Time_Key( const CEGUI::EventArgs &event )
941
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
942
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
944
Set_Shake_Time( string_to_float( str_text ) );
949
bool cMoving_Platform :: Editor_Touch_Move_Time_Key( const CEGUI::EventArgs &event )
951
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
952
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
954
Set_Touch_Move_Time( string_to_float( str_text ) );
959
bool cMoving_Platform :: Editor_Hor_Middle_Count_Key( const CEGUI::EventArgs &event )
961
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
962
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
491
964
Set_Middle_Count( string_to_int( str_text ) );
496
bool cMoving_Platform :: Editor_Image_Top_Left_Key( const EventArgs &event )
498
const WindowEventArgs &windowEventArgs = static_cast<const WindowEventArgs&>( event );
499
string str_text = static_cast<Editbox *>( windowEventArgs.window )->getText().c_str();
501
Set_image_top_left( pVideo->Get_Surface( str_text ) );
506
bool cMoving_Platform :: Editor_Image_Top_Middle_Key( const EventArgs &event )
508
const WindowEventArgs &windowEventArgs = static_cast<const WindowEventArgs&>( event );
509
string str_text = static_cast<Editbox *>( windowEventArgs.window )->getText().c_str();
511
Set_image_top_middle( pVideo->Get_Surface( str_text ) );
516
bool cMoving_Platform :: Editor_Image_Top_Right_Key( const EventArgs &event )
518
const WindowEventArgs &windowEventArgs = static_cast<const WindowEventArgs&>( event );
519
string str_text = static_cast<Editbox *>( windowEventArgs.window )->getText().c_str();
521
Set_image_top_right( pVideo->Get_Surface( str_text ) );
969
bool cMoving_Platform :: Editor_Image_Top_Left_Key( const CEGUI::EventArgs &event )
971
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
972
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
974
Set_Image_Top_Left( pVideo->Get_Surface( str_text ) );
979
bool cMoving_Platform :: Editor_Image_Top_Middle_Key( const CEGUI::EventArgs &event )
981
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
982
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
984
Set_Image_Top_Middle( pVideo->Get_Surface( str_text ) );
989
bool cMoving_Platform :: Editor_Image_Top_Right_Key( const CEGUI::EventArgs &event )
991
const CEGUI::WindowEventArgs &windowEventArgs = static_cast<const CEGUI::WindowEventArgs&>( event );
992
string str_text = static_cast<CEGUI::Editbox *>( windowEventArgs.window )->getText().c_str();
994
Set_Image_Top_Right( pVideo->Get_Surface( str_text ) );
526
999
void cMoving_Platform :: Create_Name( void )
528
name = "Moving Platform - " + Get_Direction_name( start_direction ) + " - " + Get_Massivetype_name( massivetype );
1005
name = _("Falling ");
1007
if( touch_move_time )
1009
name += _("Delayed ");
1013
name += _("Moving ");
1016
name += _("Platform - ") + Get_Direction_Name( start_direction ) + " - " + Get_Massive_Type_Name( massivetype );