Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- auto& objects = layout.getObjects();
- for ( std::size_t io = 0; io < objects.size(); ++io )
- {
- if ( objects[ io ]->getId() == 6056734911002716897 )
- {
- auto& children = objects[ io ]->getChildren();
- for ( std::size_t ic = 0; ic < children.size(); ++ic )
- {
- if ( children[ ic ]->getId() == 7034412522072308113 )
- {
- auto& props = children[ ic ]->getProperties();
- for ( std::size_t ip = 0; ip < props.size(); ++ip )
- {
- if ( props[ ip ]->getType() == 35 )
- {
- props[ ip ]->setAsString( "Can't use dynamite here!" );
- }
- else if ( props[ ip ]->getType() == 62 )
- {
- props[ ip ]->setAs< float >( 0.25 );
- }
- }
- }
- else if ( children[ ic ]->getId() == 883064458290249073 )
- {
- auto& props = children[ ic ]->getProperties();
- for ( std::size_t ip = 0; ip < props.size(); ++ip )
- {
- if ( props[ ip ]->getType() == 35 )
- {
- props[ ip ]->setAsString( "Use some dynamite!" );
- }
- else if ( props[ ip ]->getType() == 62 )
- {
- props[ ip ]->setAs< float >( 0.25 );
- }
- }
- }
- }
- }
- }
- file.open( "mods/move_dynamite/MEDIA/UI/MENUS/MESSAGEBOXES/FISHINGMENU.LAYOUT", std::fstream::out | std::fstream::trunc | std::fstream::binary );
- if ( !file )
- {
- throw std::runtime_error( "Failed to open file: " + std::string("") +"mods/move_dynamite/MEDIA/UI/MENUS/MESSAGEBOXES/" + FILE );
- }
- layout.write( file );
- file.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement