@@ -1874,8 +1874,14 @@ namespace RC::GUI
18741874 {
18751875 address_to_search_by = std::stoull (LiveView::s_name_to_search_by, nullptr , 16 );
18761876 }
1877- catch (std::invalid_argument) {} // query isn't a valid hex number; can't be an address
1878- catch (std::out_of_range) {} // is a hex number, but too big, or negative; can't be address
1877+ catch (std::invalid_argument)
1878+ {
1879+ m_modal_search_by_address_error_not_hex = true ;
1880+ }
1881+ catch (std::out_of_range)
1882+ {
1883+ m_modal_search_by_address_error_out_of_range = true ;
1884+ }
18791885 }
18801886
18811887 UObjectGlobals::ForEachUObject ([&](UObject* object, ...) {
@@ -3592,6 +3598,33 @@ namespace RC::GUI
35923598 ImGui::BeginDisabled ();
35933599 }
35943600
3601+ // Render search by address error modals
3602+ if (m_modal_search_by_address_error_not_hex)
3603+ {
3604+ ImGui::OpenPopup (" UnableToSearchByAddressNotHexError" );
3605+ }
3606+
3607+ if (ImGui::BeginPopupModal (" UnableToSearchByAddressNotHexError" ,
3608+ &m_modal_search_by_address_error_not_hex,
3609+ ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize))
3610+ {
3611+ ImGui::Text (" Query isn't a valid hex number." );
3612+ ImGui::EndPopup ();
3613+ }
3614+
3615+ if (m_modal_search_by_address_error_out_of_range)
3616+ {
3617+ ImGui::OpenPopup (" UnableToSearchByAddressOutOfRangeError" );
3618+ }
3619+
3620+ if (ImGui::BeginPopupModal (" UnableToSearchByAddressOutOfRangeError" ,
3621+ &m_modal_search_by_address_error_out_of_range,
3622+ ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize))
3623+ {
3624+ ImGui::Text (" Query is a hex number, but is either too big or negative." );
3625+ ImGui::EndPopup ();
3626+ }
3627+
35953628 // Update this text if corresponding button's text changes. Textinput width = Spacing + Window margin + Button padding + Button text width
35963629 ImGui::PushItemWidth (-(8 .0f + 16 .0f + ImGui::GetStyle ().FramePadding .x * 2 .0f + ImGui::CalcTextSize (ICON_FA_COPY " Copy search result" ).x ));
35973630 bool push_inactive_text_color = !m_search_field_cleared;
0 commit comments