From e69a5d1cd4213368950c1bd4f7362a49478c1a6d Mon Sep 17 00:00:00 2001 From: Tahir Akhlaq Date: Sun, 17 Dec 2017 10:37:29 +0000 Subject: [PATCH] clean up generated script public/private members --- src/tools/pcb_reader/main.cpp | 2 +- src/tools/quest_parser/main.cpp | 38 ++++++++++++++++++--------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/tools/pcb_reader/main.cpp b/src/tools/pcb_reader/main.cpp index 08f92bed..91d36963 100644 --- a/src/tools/pcb_reader/main.cpp +++ b/src/tools/pcb_reader/main.cpp @@ -128,7 +128,7 @@ void readFileToBuffer( const std::string& path, std::vector< char >& buf ) if( inFile.good() ) { inFile.seekg( 0, inFile.end ); - int32_t fileSize = inFile.tellg(); + int32_t fileSize = (int32_t)inFile.tellg(); buf.resize( fileSize ); inFile.seekg( 0, inFile.beg ); inFile.read( &buf[0], fileSize ); diff --git a/src/tools/quest_parser/main.cpp b/src/tools/quest_parser/main.cpp index 2bee39df..6b3ef6c7 100644 --- a/src/tools/quest_parser/main.cpp +++ b/src/tools/quest_parser/main.cpp @@ -1,39 +1,42 @@ - -#include -#include -#include -#include -#include -#include +#include +#include #include +#include #include -#include -#include +#include + #include #include -#include -#include +#include +#include +#include +#include +#include +#include + +#include +#include Core::Logger g_log; Core::Data::ExdData g_exdData; const std::string onTalkStr( - " void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId )\n" + " void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override\n" " {\n" " auto actor = Core::Event::mapEventActorToRealActor( actorId );\n" " }\n\n" ); const std::string onWithinRangeStr( - " void onWithinRange( uint32_t eventId, Entity::Player& player, uint64_t eRangeId, float x, float y, float z )\n" + " void onWithinRange( uint32_t eventId, Entity::Player& player, uint64_t eRangeId, float x, float y, float z ) override\n" " {\n" " }\n\n" ); const std::string onEmoteStr( - " void onEmote( uint32_t eventId, Entity::Player& player, uint64_t actorId, uint32_t emoteId )\n" + " void onEmote( uint32_t eventId, Entity::Player& player, uint64_t actorId, uint32_t emoteId ) override\n" " {\n" " }\n\n" ); @@ -242,12 +245,12 @@ void createScript( boost::shared_ptr< Core::Data::QuestInfo >& pQuestData, std:: if( hasERange ) { - scriptEntry += onWithinRangeStr; + scriptEntry += onWithinRangeStr; } if( hasEmote ) { - scriptEntry += onEmoteStr; + scriptEntry += onEmoteStr; } for( auto enemy : enemy_ids ) @@ -276,8 +279,9 @@ void createScript( boost::shared_ptr< Core::Data::QuestInfo >& pQuestData, std:: "{\n" + constructor + "\n" + - sceneStr + scriptEntry + + " private:\n" + + sceneStr + "};\n\n" );