2018-04-21 21:19:48 +00:00
# include <assert.h>
2018-08-19 00:59:12 +00:00
# include "IconsFontAwesome5.h"
2018-04-21 21:19:48 +00:00
# include "TracyBadVersion.hpp"
# include "TracyImGui.hpp"
namespace tracy
{
namespace detail
{
void BadVersionImpl ( int & badVer )
{
assert ( badVer ! = 0 ) ;
if ( badVer > 0 )
{
ImGui : : OpenPopup ( " Unsupported file version " ) ;
}
else
{
ImGui : : OpenPopup ( " Bad file " ) ;
}
if ( ImGui : : BeginPopupModal ( " Unsupported file version " , nullptr , ImGuiWindowFlags_AlwaysAutoResize ) )
{
2018-08-19 00:59:12 +00:00
# ifdef TRACY_EXTENDED_FONT
TextCentered ( ICON_FA_CLOUD_DOWNLOAD_ALT ) ;
# endif
2018-04-21 21:19:48 +00:00
ImGui : : Text ( " The file you are trying to open is unsupported. \n You should update to tracy %i.%i.%i or newer and try again. " , badVer > > 16 , ( badVer > > 8 ) & 0xFF , badVer & 0xFF ) ;
ImGui : : Separator ( ) ;
if ( ImGui : : Button ( " I understand " ) )
{
ImGui : : CloseCurrentPopup ( ) ;
badVer = 0 ;
}
ImGui : : EndPopup ( ) ;
}
if ( ImGui : : BeginPopupModal ( " Bad file " , nullptr , ImGuiWindowFlags_AlwaysAutoResize ) )
{
2018-08-19 00:59:12 +00:00
# ifdef TRACY_EXTENDED_FONT
TextCentered ( ICON_FA_EXCLAMATION_TRIANGLE ) ;
# endif
2018-04-21 21:19:48 +00:00
ImGui : : Text ( " The file you are trying to open is not a tracy dump. " ) ;
ImGui : : Separator ( ) ;
if ( ImGui : : Button ( " Oops " ) )
{
ImGui : : CloseCurrentPopup ( ) ;
badVer = 0 ;
}
ImGui : : EndPopup ( ) ;
}
}
}
}