mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Move bad version dialogs to a separate file.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#include <assert.h>
|
||||
|
||||
#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 ) )
|
||||
{
|
||||
ImGui::Text( "The file you are trying to open is unsupported.\nYou 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 ) )
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user