1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-01 08:27:46 +00:00

Parse more action info from tooltips

This commit is contained in:
mordred 2019-04-29 15:53:03 +02:00
parent b4b5c59bfa
commit 80684a57f8

View file

@ -54,7 +54,9 @@ int main()
auto gld1 = g_exdData.get< Sapphire::Data::ActionTransient >( id ); auto gld1 = g_exdData.get< Sapphire::Data::ActionTransient >( id );
if( gld ) if( gld )
{ {
Logger::info( "got {0}", gld->name ); if( gld->classJob == -1 || gld->name.empty() )
continue;
Logger::info( "{0} - {1}", id, gld->name );
std::string desc = gld1->description; std::string desc = gld1->description;
stripUnicode( desc );; stripUnicode( desc );;
desc = std::regex_replace( desc, std::regex( "HI" ), "\n" ); desc = std::regex_replace( desc, std::regex( "HI" ), "\n" );
@ -126,6 +128,20 @@ int main()
} }
} }
std::smatch sm5;
std::regex r5(R"(Cure Potency: \d*)");
if( std::regex_search(desc, sm5, r5 ) )
{
std::string potStr = sm5.str();
auto pos = potStr.find_last_of( " " );
if( pos != std::string::npos )
{
potStr = potStr.substr( pos + 1 );
Logger::info( "Cure Potency: {}", potStr);
}
}
Logger::info( "-" );
} }
else else
Logger::warn( "failed to get classjob {}", 1 ); Logger::warn( "failed to get classjob {}", 1 );