diff --git a/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp b/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp index db14dd58..fc27dabe 100644 --- a/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp +++ b/BigBaseV2/src/backend/looped/vehicle/ls_customs.cpp @@ -2,7 +2,6 @@ #include "gta_util.hpp" #include "script_local.hpp" #include "util/math.hpp" -#include "util/notify.hpp" #include "util/scripts.hpp" namespace big @@ -38,7 +37,7 @@ namespace big busy = false; g->vehicle.ls_customs = false; - notify::above_map("You aren't in a vehicle."); + g_notification_service->push_warning("LS Customs", "You aren't in a vehicle."); return; } diff --git a/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp b/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp index e934b78d..13287539 100644 --- a/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/cage_gun.cpp @@ -1,7 +1,6 @@ #include "backend/looped/looped.hpp" #include "core/enums.hpp" #include "util/entity.hpp" -#include "util/notify.hpp" namespace big { @@ -30,7 +29,7 @@ namespace big entity::cage_ped(entity); } } - else notify::above_map("No entity found."); + else g_notification_service->push_error("Weapons", "No entity found."); } } } diff --git a/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp b/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp index 6d517cff..ac724183 100644 --- a/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/delete_gun.cpp @@ -2,7 +2,6 @@ #include "core/enums.hpp" #include "util/entity.hpp" #include "util/math.hpp" -#include "util/notify.hpp" namespace big { @@ -28,7 +27,7 @@ namespace big { if (ENTITY::IS_ENTITY_A_PED(entity) && PED::IS_PED_A_PLAYER(entity)) { - notify::above_map("You can't delete player entities!"); + g_notification_service->push_error("Weapons", "You can't delete player entities!"); } else { @@ -38,7 +37,7 @@ namespace big if (dist > 500) { - notify::above_map("Entity is too far."); + g_notification_service->push_error("Weapons", "Entity is too far."); } else { @@ -46,11 +45,11 @@ namespace big { entity::delete_entity(entity); } - else notify::above_map("~r~Failed to take control of entity."); + else g_notification_service->push_error("Weapons", "Failed to take control of entity."); } } } - else notify::above_map("No entity found."); + else g_notification_service->push_error("Weapons", "No entity found."); } } } diff --git a/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp b/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp index 4a4de403..02ce0a49 100644 --- a/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp @@ -2,7 +2,6 @@ #include "core/enums.hpp" #include "util/entity.hpp" #include "util/math.hpp" -#include "util/notify.hpp" namespace big { @@ -37,7 +36,7 @@ namespace big { ent = 0; - notify::above_map("You can't move player entities!"); + g_notification_service->push_warning("Weapons", "You can't move player entities!"); } else { @@ -48,7 +47,7 @@ namespace big { ent = 0; - notify::above_map("Entity is too far."); + g_notification_service->push_warning("Weapons", "Entity is too far."); } else { @@ -56,7 +55,7 @@ namespace big { TASK::SET_HIGH_FALL_TASK(ent, 0, 0, 0); - notify::above_map("Selected entity at crosshair."); + g_notification_service->push_warning("Weapons", "Selected entity at crosshair."); } } } @@ -65,7 +64,7 @@ namespace big { ent = 0; - notify::above_map("No entity found."); + g_notification_service->push_warning("Weapons", "No entity found."); } } @@ -80,7 +79,7 @@ namespace big { ent = 0; - return notify::above_map("Failed to take control of entity."); + return g_notification_service->push_warning("Weapons", "Failed to take control of entity."); } ENTITY::SET_ENTITY_COLLISION(ent, false, false); @@ -109,7 +108,7 @@ namespace big ent = 0; - notify::above_map("Released entity."); + g_notification_service->push("Weapons", "Released entity."); } } } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp b/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp index 3d12f36d..e98758a1 100644 --- a/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/repair_gun.cpp @@ -2,7 +2,6 @@ #include "core/enums.hpp" #include "util/entity.hpp" #include "util/vehicle.hpp" -#include "util/notify.hpp" namespace big { @@ -32,10 +31,10 @@ namespace big } else { - notify::above_map("Entity is not a vehicle."); + g_notification_service->push_warning("Weapons", "Entity is not a vehicle."); } } - else notify::above_map("No entity found."); + else g_notification_service->push_warning("Weapons", "No entity found."); } } } diff --git a/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp b/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp index dc9b8ee7..0c15234c 100644 --- a/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/steal_vehicle_gun.cpp @@ -1,7 +1,6 @@ #include "backend/looped/looped.hpp" #include "core/enums.hpp" #include "util/entity.hpp" -#include "util/notify.hpp" namespace big { @@ -38,9 +37,9 @@ namespace big PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), ent, -1); } - else notify::above_map("Entity is not a vehicle."); + else g_notification_service->push_warning("Weapons", "Entity is not a vehicle."); } - else notify::above_map("No entity found."); + else g_notification_service->push_warning("Weapons", "No entity found."); } } } diff --git a/BigBaseV2/src/common.hpp b/BigBaseV2/src/common.hpp index c372a96c..3ebdf09e 100644 --- a/BigBaseV2/src/common.hpp +++ b/BigBaseV2/src/common.hpp @@ -54,6 +54,8 @@ #include "gta/natives.hpp" #include "CPed.hpp" +#include "services/notification_service.hpp" + namespace big { using namespace std::chrono_literals; diff --git a/BigBaseV2/src/gui.cpp b/BigBaseV2/src/gui.cpp index e3630f1f..040d10c3 100644 --- a/BigBaseV2/src/gui.cpp +++ b/BigBaseV2/src/gui.cpp @@ -14,7 +14,7 @@ #include #include "views/view.hpp" -#include "util/notify.hpp" +#include "services/notification_service.hpp" namespace big { @@ -87,9 +87,18 @@ namespace big EXCEPT_CLAUSE } + void gui::always_draw() + { + TRY_CLAUSE + { + view::always(); + } + EXCEPT_CLAUSE + } + void gui::script_init() { - notify::display_help_text("Press INSERT on your keyboard to open Yim's Mod Menu."); + g_notification_service->push("Welcome", "Loaded YimMenu. Press INSERT to open"); } void gui::script_on_tick() diff --git a/BigBaseV2/src/gui.hpp b/BigBaseV2/src/gui.hpp index 98bd3fed..50d02cdd 100644 --- a/BigBaseV2/src/gui.hpp +++ b/BigBaseV2/src/gui.hpp @@ -8,6 +8,7 @@ namespace big public: void dx_init(); void dx_on_tick(); + void always_draw(); void script_init(); void script_on_tick(); diff --git a/BigBaseV2/src/hooks/increment_stat_event.cpp b/BigBaseV2/src/hooks/increment_stat_event.cpp index 34136e5b..cd46b21b 100644 --- a/BigBaseV2/src/hooks/increment_stat_event.cpp +++ b/BigBaseV2/src/hooks/increment_stat_event.cpp @@ -1,6 +1,5 @@ #include "hooking.hpp" #include "natives.hpp" -#include "util/notify.hpp" namespace big { @@ -13,9 +12,9 @@ namespace big case RAGE_JOAAT("MPPLY_EXPLOITS"): case RAGE_JOAAT("MPPLY_TC_ANNOYINGME"): case RAGE_JOAAT("MPPLY_TC_HATE"): - std::string report = fmt::format("~g~BLOCKED REPORT~s~\nFrom: {}", sender->get_name()); + std::string report = fmt::format("From: {}", sender->get_name()); - notify::above_map(report); + g_notification_service->push_warning("BLOCKED REPORT", report); return true; } diff --git a/BigBaseV2/src/hooks/received_event.cpp b/BigBaseV2/src/hooks/received_event.cpp index ca8d5c35..8fa5ef47 100644 --- a/BigBaseV2/src/hooks/received_event.cpp +++ b/BigBaseV2/src/hooks/received_event.cpp @@ -2,7 +2,6 @@ #include "gta/net_game_event.hpp" #include "hooking.hpp" #include "natives.hpp" -#include "util/notify.hpp" namespace big { @@ -36,8 +35,8 @@ namespace big { g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset); - notify::above_map( - fmt::format("{} possible attempt at freezing entity.", source_player->get_name()) + g_notification_service->push_warning("Protection", + fmt::format("{} possible attempt at freezing entity.", source_player->get_name()) ); return false; @@ -57,8 +56,8 @@ namespace big if (money >= 2000) { - notify::above_map( - fmt::format("{} is spawning cash.", source_player->get_name()) + g_notification_service->push_warning("Protection", + fmt::format("{} is spawning cash.", source_player->get_name()) ); } @@ -68,8 +67,8 @@ namespace big case RockstarEvent::NETWORK_CHECK_CODE_CRCS_EVENT: case RockstarEvent::REPORT_MYSELF_EVENT: { - notify::above_map( - fmt::format("Detected {} as cheating.", source_player->get_name()) + g_notification_service->push_warning("Protection", + fmt::format("Detected {} as cheating.", source_player->get_name()) ); break; @@ -78,8 +77,8 @@ namespace big { g_pointers->m_send_event_ack(event_manager, source_player, target_player, event_index, event_handled_bitset); - notify::above_map( - fmt::format("Denied player control request from {}", source_player->get_name()) + g_notification_service->push_warning("Protection", + fmt::format("Denied player control request from {}", source_player->get_name()) ); return false; diff --git a/BigBaseV2/src/hooks/script_event_handler.cpp b/BigBaseV2/src/hooks/script_event_handler.cpp index 77bde15e..a692cd15 100644 --- a/BigBaseV2/src/hooks/script_event_handler.cpp +++ b/BigBaseV2/src/hooks/script_event_handler.cpp @@ -1,6 +1,5 @@ #include "hooking.hpp" #include "gta/enums.hpp" -#include "util/notify.hpp" namespace big { @@ -114,8 +113,8 @@ namespace big if (strlen(type) != 0) { - notify::above_map( - fmt::format("~g~BLOCKED SCRIPT EVENT~s~\nFrom: {}\nEvent Type: ~b~{}", player->get_name(), type) + g_notification_service->push_warning("Protection", + fmt::format("BLOCKED SCRIPT EVENT\nFrom: {}\nEvent Type: {}", player->get_name(), type) ); return true; diff --git a/BigBaseV2/src/main.cpp b/BigBaseV2/src/main.cpp index 255ff49e..041957db 100644 --- a/BigBaseV2/src/main.cpp +++ b/BigBaseV2/src/main.cpp @@ -14,6 +14,7 @@ #include "services/globals_service.hpp" #include "services/player_service.hpp" #include "services/mobile_service.hpp" +#include "services/notification_service.hpp" #include "services/vehicle_service.hpp" BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID) @@ -64,6 +65,7 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID) auto globals_service_instace = std::make_unique(); auto mobile_service_instance = std::make_unique(); + auto notification_service_instance = std::make_unique(); auto player_service_instance = std::make_unique(); auto vehicle_service_instance = std::make_unique(); LOG(INFO) << "Registered service instances..."; diff --git a/BigBaseV2/src/renderer.cpp b/BigBaseV2/src/renderer.cpp index 1d17b644..7389b5e4 100644 --- a/BigBaseV2/src/renderer.cpp +++ b/BigBaseV2/src/renderer.cpp @@ -83,6 +83,7 @@ namespace big { g_gui.dx_on_tick(); } + g_gui.always_draw(); ImGui::Render(); ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData()); diff --git a/BigBaseV2/src/services/notification_service.cpp b/BigBaseV2/src/services/notification_service.cpp new file mode 100644 index 00000000..a4c908c3 --- /dev/null +++ b/BigBaseV2/src/services/notification_service.cpp @@ -0,0 +1,58 @@ +#include "notification_service.hpp" + +namespace big +{ + notification_service::notification_service() + { + g_notification_service = this; + } + + notification_service::~notification_service() + { + g_notification_service = nullptr; + } + + void notification_service::push(notification n) + { + this->notifications.emplace(std::hash{}(n.message), n); + } + + void notification_service::push(std::string title, std::string message) + { + this->push({ NotificationType::INFO, title, message, std::chrono::system_clock::now(), 3000.f , 1.f}); + } + + void notification_service::push_warning(std::string title, std::string message) + { + this->push({ NotificationType::WARNING, title, message, std::chrono::system_clock::now(), 3000.f , 1.f }); + } + + void notification_service::push_error(std::string title, std::string message) + { + this->push({ NotificationType::DANGER, title, message, std::chrono::system_clock::now(), 3000.f , 1.f }); + } + + std::vector notification_service::get() + { + std::vector notifications_to_sent; + std::vector to_remove; + for (auto& n : this->notifications) { + std::chrono::time_point curTime = std::chrono::system_clock::now(); + const float time_diff = (float)std::chrono::duration_cast(curTime - n.second.created_on).count(); + n.second.alpha = 1; + if (n.second.destroy_in <= time_diff) { + n.second.alpha = 1.f - ((time_diff - n.second.destroy_in) / 600); + n.second.alpha = n.second.alpha < 0.f ? 0.f : n.second.alpha; + } + + if (n.second.alpha > 0.f) + notifications_to_sent.push_back(n.second); + else to_remove.push_back(n.first); + } + for (std::size_t k : to_remove) + this->notifications.erase(k); + + return notifications_to_sent; + } + +} \ No newline at end of file diff --git a/BigBaseV2/src/services/notification_service.hpp b/BigBaseV2/src/services/notification_service.hpp new file mode 100644 index 00000000..d4fd5c8b --- /dev/null +++ b/BigBaseV2/src/services/notification_service.hpp @@ -0,0 +1,45 @@ +#pragma once +namespace big +{ + enum class NotificationType { + INFO, + SUCCESS, + WARNING, + DANGER, + }; + + struct notification + { + NotificationType type; + const std::string title; + const std::string message; + const std::chrono::time_point created_on; + const float destroy_in; + float alpha; + }; + + class notification_service final + { + std::unordered_map notifications; + + public: + notification_service(); + virtual ~notification_service(); + + void push(notification); + void push(std::string, std::string); + void push_warning(std::string, std::string); + void push_error(std::string, std::string); + std::vector get(); + + std::map notification_colors = { + {NotificationType::INFO, ImVec4(0.80f, 0.80f, 0.83f, 1.00f)}, + {NotificationType::SUCCESS, ImVec4(0.29f, 0.69f, 0.34f, 1.00f)}, + {NotificationType::WARNING, ImVec4(0.69f ,0.49f, 0.29f, 1.00f) }, + {NotificationType::DANGER, ImVec4(0.69f, 0.29f , 0.29f, 1.00f)}, + }; + + }; + + inline notification_service* g_notification_service{}; +} \ No newline at end of file diff --git a/BigBaseV2/src/util/mobile.hpp b/BigBaseV2/src/util/mobile.hpp index 93fef344..c4da57e1 100644 --- a/BigBaseV2/src/util/mobile.hpp +++ b/BigBaseV2/src/util/mobile.hpp @@ -87,7 +87,7 @@ namespace big::mobile inline void summon_vehicle_by_index(int veh_idx) { if (*mechanic_global.at(958).as() != -1) - return notify::display_help_text("Mechanic is not ready to deliver a vehicle right now."); + return g_notification_service->push_warning("Vehicle", "Mechanic is not ready to deliver a vehicle right now."); TASK::CLEAR_PED_TASKS_IMMEDIATELY(PLAYER::PLAYER_PED_ID()); diff --git a/BigBaseV2/src/util/teleport.hpp b/BigBaseV2/src/util/teleport.hpp index d39926c2..f6c5d83a 100644 --- a/BigBaseV2/src/util/teleport.hpp +++ b/BigBaseV2/src/util/teleport.hpp @@ -1,7 +1,6 @@ #pragma once #include "blip.hpp" #include "entity.hpp" -#include "notify.hpp" namespace big::teleport { @@ -11,14 +10,14 @@ namespace big::teleport if (ENTITY::IS_ENTITY_DEAD(ent, true)) { - notify::display_help_text("Target player is dead."); + g_notification_service->push_warning("Teleport", "Target player is dead."); return false; } if (!PED::IS_PED_IN_ANY_VEHICLE(ent, true)) { - notify::display_help_text("Target player is not in a vehicle."); + g_notification_service->push_warning("Teleport", "Target player is not in a vehicle."); return false; } @@ -30,7 +29,7 @@ namespace big::teleport if (entity::take_control_of(ent)) ENTITY::SET_ENTITY_COORDS(ent, location.x, location.y, location.z, 0, 0, 0, 0); else - notify::display_help_text("Failed to take control of player vehicle."); + g_notification_service->push_warning("Teleport", "Failed to take control of player vehicle."); return true; } @@ -69,7 +68,7 @@ namespace big::teleport { if (!veh) { - notify::display_help_text("Player is not in a vehicle."); + g_notification_service->push_warning("Teleport", "Player is not in a vehicle."); return false; } @@ -82,7 +81,7 @@ namespace big::teleport if (seat_index == 255) { - notify::display_help_text("No seats are free in the player vehicle."); + g_notification_service->push_warning("Teleport", "No seats are free in the player vehicle."); return false; } @@ -136,7 +135,7 @@ namespace big::teleport { if (!to_blip((int)BlipIcons::Waypoint)) { - notify::above_map("Failed to find waypoint position"); + g_notification_service->push_warning("Teleport", "Failed to find waypoint position"); return false; } diff --git a/BigBaseV2/src/util/vehicle.hpp b/BigBaseV2/src/util/vehicle.hpp index 82ea44f7..04728545 100644 --- a/BigBaseV2/src/util/vehicle.hpp +++ b/BigBaseV2/src/util/vehicle.hpp @@ -3,7 +3,6 @@ #include "gta/joaat.hpp" #include "math.hpp" #include "natives.hpp" -#include "notify.hpp" #include "pointers.hpp" #include "script.hpp" #include "teleport.hpp" @@ -16,7 +15,7 @@ namespace big::vehicle teleport::load_ground_at_3dcoord(vecVehicleLocation); if (!entity::take_control_of(veh)) - return notify::above_map("Failed to take control of remote vehicle."); + return g_notification_service->push_warning("Vehicle", "Failed to take control of remote vehicle."); ENTITY::SET_ENTITY_COORDS(veh, location.x, location.y, location.z + 1.f, 0, 0, 0, 0); ENTITY::SET_ENTITY_HEADING(veh, ENTITY::GET_ENTITY_HEADING(PLAYER::PLAYER_PED_ID())); @@ -59,7 +58,7 @@ namespace big::vehicle } if (!STREAMING::HAS_MODEL_LOADED(hash)) { - notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); + g_notification_service->push_warning("Spawn", "Failed to spawn model, did you give an incorrect model?"); return -1; } diff --git a/BigBaseV2/src/views/view.hpp b/BigBaseV2/src/views/view.hpp index 0002b68f..134da1fd 100644 --- a/BigBaseV2/src/views/view.hpp +++ b/BigBaseV2/src/views/view.hpp @@ -40,6 +40,7 @@ namespace big static void settings(); static void spoofing(); static void navigation(); + static void notifications(); static void active_view(); inline static animator window_animator = animator(); @@ -67,5 +68,10 @@ namespace big active_view(); navigation(); } + + static void always() + { + notifications(); + } }; } \ No newline at end of file diff --git a/BigBaseV2/src/views/view_active_view.cpp b/BigBaseV2/src/views/view_active_view.cpp index 72de1d29..ff792561 100644 --- a/BigBaseV2/src/views/view_active_view.cpp +++ b/BigBaseV2/src/views/view_active_view.cpp @@ -30,7 +30,7 @@ namespace big ImGui::SetNextWindowPos({ tabs_open_animation, 0.f }, ImGuiCond_Always); ImGui::SetNextWindowSize({ (float)g->window.x * 0.3f, (float)g->window.y }, ImGuiCond_Always); ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f)); - if (ImGui::Begin("main", 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav)) + if (ImGui::Begin("main", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav)) { ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha); if (current_tab->tab != tabs::NONE) diff --git a/BigBaseV2/src/views/view_mobile.cpp b/BigBaseV2/src/views/view_mobile.cpp index c870bfb2..40e33eb1 100644 --- a/BigBaseV2/src/views/view_mobile.cpp +++ b/BigBaseV2/src/views/view_mobile.cpp @@ -2,7 +2,6 @@ #include "fiber_pool.hpp" #include "script.hpp" #include "util/mobile.hpp" -#include "util/notify.hpp" #include "services/mobile_service.hpp" namespace big @@ -10,8 +9,8 @@ namespace big void view::mobile() { components::button("Mors Mutual Fix All Vehicles", [] { int amount_fixed = mobile::mors_mutual::fix_all(); - notify::above_map( - fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") + g_notification_service->push("Mobile", + fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") ); }); diff --git a/BigBaseV2/src/views/view_notifications.cpp b/BigBaseV2/src/views/view_notifications.cpp new file mode 100644 index 00000000..d13da986 --- /dev/null +++ b/BigBaseV2/src/views/view_notifications.cpp @@ -0,0 +1,32 @@ +#include "view.hpp" +#include "services/notification_service.hpp" + +namespace big +{ + void view::notifications() + { + ImGui::SetNextWindowSize({ (float)g->window.x * 0.2f, (float)g->window.y }); + ImGui::SetNextWindowPos({ (float)g->window.x - (float)g->window.x * 0.2f, 0 }); + if (ImGui::Begin("notifications", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBackground)) + { + std::vector notifications = g_notification_service->get(); + + for (int i = 0; i < notifications.size(); i++) + { + notification& n = notifications[i]; + ImGui::PushStyleVar(ImGuiStyleVar_Alpha, n.alpha); + ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f)); + ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.10f, 0.09f, 0.12f, 1.00f)); + ImGui::SetNextWindowBgAlpha(n.alpha); + ImGui::BeginChild(i, ImVec2(0, 75.f + (float)(20 * (int)(n.message.size() / 28) + 20 * (float)std::count(n.message.begin(), n.message.end(), '\n'))), true, ImGuiWindowFlags_NoScrollbar); + ImGui::Text(n.title.c_str()); + ImGui::PushStyleColor(ImGuiCol_Text, g_notification_service->notification_colors.at(n.type)); + ImGui::TextWrapped(n.message.c_str()); + ImGui::PopStyleColor(); + ImGui::EndChild(); + ImGui::PopStyleVar(); + ImGui::PopStyleColor(2); + } + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/views/view_self.cpp b/BigBaseV2/src/views/view_self.cpp index 960577eb..62d76ab6 100644 --- a/BigBaseV2/src/views/view_self.cpp +++ b/BigBaseV2/src/views/view_self.cpp @@ -4,7 +4,6 @@ #include "script_global.hpp" #include "util/entity.hpp" #include "util/player.hpp" -#include "util/notify.hpp" #include "util/session.hpp" namespace big @@ -79,7 +78,7 @@ namespace big } if (!STREAMING::HAS_MODEL_LOADED(hash)) { - notify::above_map("~r~Failed to spawn model, did you give an incorrect model?"); + g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? "); return; } diff --git a/BigBaseV2/src/views/view_teleport.cpp b/BigBaseV2/src/views/view_teleport.cpp index a61dd47a..525392fa 100644 --- a/BigBaseV2/src/views/view_teleport.cpp +++ b/BigBaseV2/src/views/view_teleport.cpp @@ -28,7 +28,7 @@ namespace big components::button("Bring Personal Vehicle", [] { Vehicle veh = globals::get_personal_vehicle(); - if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle..."); + if (ENTITY::IS_ENTITY_DEAD(veh, false)) return g_notification_service->push_error("Teleport", "Invalid vehicle handle..."); Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); @@ -37,7 +37,7 @@ namespace big components::button("Teleport to Personal Vehicle", [] { Vehicle veh = globals::get_personal_vehicle(); - if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle..."); + if (ENTITY::IS_ENTITY_DEAD(veh, false)) return g_notification_service->push_error("Teleport", "Invalid vehicle handle..."); teleport::to_coords( ENTITY::GET_ENTITY_COORDS(veh, true)