Advertisement
spacechase0

FISHINGMENU.LAYOUT Code

Oct 18th, 2012
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.57 KB | None | 0 0
  1.             auto& objects = layout.getObjects();
  2.             for ( std::size_t io = 0; io < objects.size(); ++io )
  3.             {
  4.                 if ( objects[ io ]->getId() == 6056734911002716897 )
  5.                 {
  6.                     auto& children = objects[ io ]->getChildren();
  7.                     for ( std::size_t ic = 0; ic < children.size(); ++ic )
  8.                     {
  9.                         if ( children[ ic ]->getId() == 7034412522072308113 )
  10.                         {
  11.                             auto& props = children[ ic ]->getProperties();
  12.                             for ( std::size_t ip = 0; ip < props.size(); ++ip )
  13.                             {
  14.                                 if ( props[ ip ]->getType() == 35 )
  15.                                 {
  16.                                     props[ ip ]->setAsString( "Can't use dynamite here!" );
  17.                                 }
  18.                                 else if ( props[ ip ]->getType() == 62 )
  19.                                 {
  20.                                     props[ ip ]->setAs< float >( 0.25 );
  21.                                 }
  22.                             }
  23.                         }
  24.                         else if ( children[ ic ]->getId() == 883064458290249073 )
  25.                         {
  26.                             auto& props = children[ ic ]->getProperties();
  27.                             for ( std::size_t ip = 0; ip < props.size(); ++ip )
  28.                             {
  29.                                 if ( props[ ip ]->getType() == 35 )
  30.                                 {
  31.                                     props[ ip ]->setAsString( "Use some dynamite!" );
  32.                                 }
  33.                                 else if ( props[ ip ]->getType() == 62 )
  34.                                 {
  35.                                     props[ ip ]->setAs< float >( 0.25 );
  36.                                 }
  37.                             }
  38.                         }
  39.                     }
  40.                 }
  41.             }
  42.            
  43.             file.open( "mods/move_dynamite/MEDIA/UI/MENUS/MESSAGEBOXES/FISHINGMENU.LAYOUT", std::fstream::out | std::fstream::trunc | std::fstream::binary );
  44.             if ( !file )
  45.             {
  46.                 throw std::runtime_error( "Failed to open file: " + std::string("") +"mods/move_dynamite/MEDIA/UI/MENUS/MESSAGEBOXES/" + FILE );
  47.             }
  48.             layout.write( file );
  49.             file.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement