mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-07-15 23:07:59 +08:00
Add more spoofing options and added clang-format (#1020)
* feat(Spoofing): add spoofing * feat(Spoofing): prepare code for player attach * remove(PlayerAttach): isn't going to work due to netsync architecture * fix(GUI): fix scaling * feat(Project): add clang-format file * feat(Classes): update classes * fix(BlackHole): remove unnecessary cleanup * fix(Formatting): fix formatting for initializer lists * feat(clang-format): Set tab width and 1 space before comment Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
@ -1,17 +1,21 @@
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include "pointers.hpp"
|
||||
#include "services/gui/gui_service.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::active_view() {
|
||||
if (g_gui_service->get_selected()->func == nullptr) return;
|
||||
void view::active_view()
|
||||
{
|
||||
if (g_gui_service->get_selected()->func == nullptr)
|
||||
return;
|
||||
|
||||
static float alpha = 1.f;
|
||||
|
||||
ImGui::SetNextWindowPos({ 300.f + 20.f, 100.f }, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize({ 0.f, 0.f });
|
||||
ImGui::SetNextWindowSizeConstraints({ 300.f, 100.f }, { (float)*g_pointers->m_resolution_x - 270.f, (float)*g_pointers->m_resolution_y - 110.f });
|
||||
ImGui::SetNextWindowPos({(300.f + 20.f) * g.window.gui_scale, 100.f * g.window.gui_scale}, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize({0.f, 0.f});
|
||||
ImGui::SetNextWindowSizeConstraints({300.f, 100.f},
|
||||
{(float)*g_pointers->m_resolution_x - 270.f, (float)*g_pointers->m_resolution_y - 110.f});
|
||||
if (ImGui::Begin("main", nullptr, window_flags))
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
|
||||
|
@ -1,27 +1,30 @@
|
||||
#include "views/view.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::heading()
|
||||
{
|
||||
ImGui::SetNextWindowSize({ 300.f, 80.f });
|
||||
ImGui::SetNextWindowPos({ 10.f, 10.f });
|
||||
ImGui::SetNextWindowSize({300.f * g.window.gui_scale, 80.f * g.window.gui_scale});
|
||||
ImGui::SetNextWindowPos({10.f, 10.f});
|
||||
if (ImGui::Begin("menu_heading", nullptr, window_flags | ImGuiWindowFlags_NoScrollbar))
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
ImGui::Text("HEADING_WELCOME"_T.data());
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.172f, 0.380f, 0.909f, 1.f));
|
||||
ImGui::Text(g_local_player == nullptr || g_local_player->m_player_info == nullptr ? "UNKNOWN_USERNAME"_T.data() : g_local_player->m_player_info->m_net_player_data.m_name);
|
||||
ImGui::Text(g_local_player == nullptr || g_local_player->m_player_info == nullptr ?
|
||||
"UNKNOWN_USERNAME"_T.data() :
|
||||
g_local_player->m_player_info->m_net_player_data.m_name);
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::SetCursorPos({ 300.f - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x, ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2) });
|
||||
ImGui::SetCursorPos(
|
||||
{(300.f * g.window.gui_scale) - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x,
|
||||
ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2)});
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.69f, 0.29f, 0.29f, 1.00f));
|
||||
if (components::nav_button("UNLOAD"_T))
|
||||
{
|
||||
g_fiber_pool->queue_job([]
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
for (auto& command : g_looped_commands)
|
||||
if (command->is_enabled())
|
||||
command->on_disable();
|
||||
|
@ -3,9 +3,10 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::navigation() {
|
||||
ImGui::SetNextWindowPos({ 10.f, 100.f }, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize({ 300.f, 0.f }, ImGuiCond_Always);
|
||||
void view::navigation()
|
||||
{
|
||||
ImGui::SetNextWindowPos({10.f, 100.f * g.window.gui_scale}, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize({300.f * g.window.gui_scale, 0.f}, ImGuiCond_Always);
|
||||
|
||||
if (ImGui::Begin("navigation", 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav))
|
||||
{
|
||||
@ -15,14 +16,11 @@ namespace big
|
||||
switch (navItem.first)
|
||||
{
|
||||
case tabs::PLAYER:
|
||||
case tabs::DEBUG:
|
||||
continue;
|
||||
default:
|
||||
components::nav_item(navItem, 0);
|
||||
case tabs::DEBUG: continue;
|
||||
default: components::nav_item(navItem, 0);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
@ -5,19 +5,19 @@ namespace big
|
||||
{
|
||||
float draw_notification(float start_pos, ImDrawList* dl, std::string title, std::string message, ImVec4 color)
|
||||
{
|
||||
ImColor textCol = ImGui::ColorConvertFloat4ToU32({ 1.f, 1.f, 1.f, 1.f });
|
||||
color.w = 0.5f;
|
||||
ImColor textCol = ImGui::ColorConvertFloat4ToU32({1.f, 1.f, 1.f, 1.f});
|
||||
color.w = 0.5f;
|
||||
ImColor fadeBegin = ImGui::ColorConvertFloat4ToU32(color);
|
||||
color.w = 0.f;
|
||||
ImColor fadeEnd = ImGui::ColorConvertFloat4ToU32(color);
|
||||
color.w = 0.f;
|
||||
ImColor fadeEnd = ImGui::ColorConvertFloat4ToU32(color);
|
||||
|
||||
int j = 0;
|
||||
int prevSpace = 0;
|
||||
int j = 0;
|
||||
int prevSpace = 0;
|
||||
float total_size = 0.f;
|
||||
std::vector<std::string> split_points;
|
||||
for (int i = 0; i <= message.size(); i++)
|
||||
{
|
||||
std::string current_message = message.substr(j, i - j);
|
||||
std::string current_message = message.substr(j, i - j);
|
||||
|
||||
if (message.substr(i, 1) == " ")
|
||||
{
|
||||
@ -40,14 +40,20 @@ namespace big
|
||||
}
|
||||
}
|
||||
|
||||
dl->AddRectFilled({ (float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos }, { (float)*g_pointers->m_resolution_x - 10.f, start_pos + 45.f + total_size }, g.window.color);
|
||||
dl->AddRectFilledMultiColor({ (float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos }, { (float)*g_pointers->m_resolution_x - 255.f, start_pos + 45.f + total_size }, fadeBegin, fadeEnd, fadeEnd, fadeBegin);
|
||||
dl->AddRectFilled({(float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos},
|
||||
{(float)*g_pointers->m_resolution_x - 10.f, start_pos + 45.f + total_size},
|
||||
g.window.color);
|
||||
dl->AddRectFilledMultiColor({(float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos}, {(float)*g_pointers->m_resolution_x - 255.f, start_pos + 45.f + total_size}, fadeBegin, fadeEnd, fadeEnd, fadeBegin);
|
||||
|
||||
dl->AddText(g.window.font_sub_title, 22.f, { (float)*g_pointers->m_resolution_x - 350.f, 15.f + start_pos }, textCol, title.c_str());
|
||||
dl->AddText(g.window.font_sub_title,
|
||||
22.f,
|
||||
{(float)*g_pointers->m_resolution_x - 350.f, 15.f + start_pos},
|
||||
textCol,
|
||||
title.c_str());
|
||||
int i = 0;
|
||||
for (std::string txt : split_points)
|
||||
{
|
||||
dl->AddText({ (float)*g_pointers->m_resolution_x - 350.f, 40.f + (i * 20.f) + start_pos}, textCol, txt.c_str());
|
||||
dl->AddText({(float)*g_pointers->m_resolution_x - 350.f, 40.f + (i * 20.f) + start_pos}, textCol, txt.c_str());
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -65,7 +71,8 @@ namespace big
|
||||
{
|
||||
notification& n = notifications[i];
|
||||
|
||||
prev_pos = draw_notification(prev_pos, draw_list, n.title, n.message, g_notification_service->notification_colors.at(n.type));
|
||||
prev_pos =
|
||||
draw_notification(prev_pos, draw_list, n.title, n.message, g_notification_service->notification_colors.at(n.type));
|
||||
}
|
||||
|
||||
/*ImGui::SetNextWindowSize({ (float)g.window.x * 0.2f, (float)g.window.y });
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "views/view.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "gta_util.hpp"
|
||||
#include "gui.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void view::overlay()
|
||||
{
|
||||
if (!g.window.ingame_overlay.opened || (g_gui->is_open() && !g.window.ingame_overlay.show_with_menu_opened))
|
||||
return;
|
||||
return;
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(10.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f));
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
@ -22,8 +22,9 @@ namespace big
|
||||
if (g.window.ingame_overlay.show_fps)
|
||||
ImGui::Text("%.0f FPS", ImGui::GetIO().Framerate / 2);
|
||||
|
||||
if (CNetworkPlayerMgr *network_player_mgr = gta_util::get_network_player_mgr(); g.window.ingame_overlay.show_players)
|
||||
ImGui::Text(std::format("Players: {}/{}", network_player_mgr->m_player_count, network_player_mgr->m_player_limit).c_str());
|
||||
if (CNetworkPlayerMgr* network_player_mgr = gta_util::get_network_player_mgr(); g.window.ingame_overlay.show_players)
|
||||
ImGui::Text(std::format("Players: {}/{}", network_player_mgr->m_player_count, network_player_mgr->m_player_limit)
|
||||
.c_str());
|
||||
|
||||
//if (g.window.ingame_overlay.show_time)
|
||||
// ImGui::Text(std::format("Time: {:%d-%m-%Y %H:%M:%OS}", std::chrono::current_zone()->to_local(std::chrono::system_clock::now())).c_str());
|
||||
@ -32,16 +33,25 @@ namespace big
|
||||
{
|
||||
ImGui::Separator();
|
||||
|
||||
if(replay_interface->m_ped_interface)
|
||||
ImGui::Text(std::format("Ped Pool: {}/{}", replay_interface->m_ped_interface->m_cur_peds, replay_interface->m_ped_interface->m_max_peds).c_str());
|
||||
if (replay_interface->m_ped_interface)
|
||||
ImGui::Text(std::format("Ped Pool: {}/{}",
|
||||
replay_interface->m_ped_interface->m_cur_peds,
|
||||
replay_interface->m_ped_interface->m_max_peds)
|
||||
.c_str());
|
||||
|
||||
if(replay_interface->m_vehicle_interface)
|
||||
ImGui::Text(std::format("Vehicle Pool: {}/{}", replay_interface->m_vehicle_interface->m_cur_vehicles, replay_interface->m_vehicle_interface->m_max_vehicles).c_str());
|
||||
|
||||
if(replay_interface->m_object_interface)
|
||||
ImGui::Text(std::format("Object Pool: {}/{}", replay_interface->m_object_interface->m_cur_objects, replay_interface->m_object_interface->m_max_objects).c_str());
|
||||
if (replay_interface->m_vehicle_interface)
|
||||
ImGui::Text(std::format("Vehicle Pool: {}/{}",
|
||||
replay_interface->m_vehicle_interface->m_cur_vehicles,
|
||||
replay_interface->m_vehicle_interface->m_max_vehicles)
|
||||
.c_str());
|
||||
|
||||
if (replay_interface->m_object_interface)
|
||||
ImGui::Text(std::format("Object Pool: {}/{}",
|
||||
replay_interface->m_object_interface->m_cur_objects,
|
||||
replay_interface->m_object_interface->m_max_objects)
|
||||
.c_str());
|
||||
}
|
||||
|
||||
|
||||
if (g.window.ingame_overlay.show_game_versions)
|
||||
{
|
||||
ImGui::Separator();
|
||||
|
Reference in New Issue
Block a user