2023-03-01 21:27:15 +00:00
|
|
|
#include "gta/joaat.hpp"
|
|
|
|
#include "gta_util.hpp"
|
2022-10-21 22:05:39 +02:00
|
|
|
#include "gui/components/components.hpp"
|
|
|
|
#include "natives.hpp"
|
2022-11-24 21:49:05 +00:00
|
|
|
#include "network/Network.hpp"
|
|
|
|
#include "script.hpp"
|
2022-12-06 16:12:02 +00:00
|
|
|
#include "script_global.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "util/misc.hpp"
|
|
|
|
#include "util/system.hpp"
|
|
|
|
#include "view_debug.hpp"
|
2023-04-05 19:54:29 +02:00
|
|
|
#include "util/ped.hpp"
|
|
|
|
#include "util/pathfind.hpp"
|
2022-10-21 22:05:39 +02:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void debug::misc()
|
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::BeginTabItem("DEBUG_TAB_MISC"_T.data()))
|
2022-10-21 22:05:39 +02:00
|
|
|
{
|
2023-03-09 12:23:01 +00:00
|
|
|
ImGui::Text("Fiber Pool Usage %d/%d", g_fiber_pool->get_used_fibers(), g_fiber_pool->get_total_fibers());
|
|
|
|
|
|
|
|
ImGui::SameLine();
|
2023-02-08 23:36:55 +01:00
|
|
|
|
2023-03-09 12:23:01 +00:00
|
|
|
if (components::button("Reset"))
|
2023-02-08 23:36:55 +01:00
|
|
|
{
|
2023-03-09 12:23:01 +00:00
|
|
|
g_fiber_pool->reset();
|
2023-02-08 23:36:55 +01:00
|
|
|
}
|
|
|
|
|
2022-10-21 22:05:39 +02:00
|
|
|
if (components::button("Dump entrypoints"))
|
|
|
|
{
|
|
|
|
system::dump_entry_points();
|
|
|
|
}
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("Network Bail", [] {
|
2022-10-21 22:05:39 +02:00
|
|
|
NETWORK::NETWORK_BAIL(16, 0, 0);
|
|
|
|
});
|
2022-12-06 16:12:02 +00:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("DEBUG_REMOVE_FROM_BAD_SPORT"_T, [] {
|
2023-04-27 02:16:41 +08:00
|
|
|
STATS::STAT_SET_INT(RAGE_JOAAT("MPPLY_BADSPORT_MESSAGE"), 0, 1);
|
|
|
|
STATS::STAT_SET_INT(RAGE_JOAAT("MPPLY_BECAME_BADSPORT_NUM"), 0, 1);
|
|
|
|
STATS::STAT_SET_FLOAT(RAGE_JOAAT("MPPLY_OVERALL_BADSPORT"), 0, true);
|
|
|
|
STATS::STAT_SET_BOOL(RAGE_JOAAT("MPPLY_CHAR_IS_BADSPORT"), false, true);
|
2022-12-06 16:12:02 +00:00
|
|
|
});
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("Load MP Map", [] {
|
|
|
|
DLC::ON_ENTER_MP();
|
|
|
|
});
|
2023-01-23 05:56:21 -05:00
|
|
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("Load SP Map", [] {
|
|
|
|
DLC::ON_ENTER_SP();
|
|
|
|
});
|
2023-01-23 05:56:21 -05:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("Skip Cutscene", [] {
|
|
|
|
CUTSCENE::STOP_CUTSCENE_IMMEDIATELY();
|
|
|
|
});
|
|
|
|
|
|
|
|
components::button("Refresh Interior", [] {
|
2023-01-23 05:56:21 -05:00
|
|
|
Interior interior = INTERIOR::GET_INTERIOR_AT_COORDS(self::pos.x, self::pos.y, self::pos.z);
|
|
|
|
INTERIOR::REFRESH_INTERIOR(interior);
|
2023-02-20 06:04:13 +08:00
|
|
|
});
|
2023-01-23 05:56:21 -05:00
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("Network Shutdown And Launch Single Player Game", [] {
|
2023-02-20 06:04:13 +08:00
|
|
|
NETWORK::SHUTDOWN_AND_LAUNCH_SINGLE_PLAYER_GAME();
|
|
|
|
});
|
|
|
|
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("Network Shutdown And Load Most Recent Save", [] {
|
2023-02-20 06:04:13 +08:00
|
|
|
NETWORK::SHUTDOWN_AND_LOAD_MOST_RECENT_SAVE();
|
|
|
|
});
|
|
|
|
|
2023-04-23 17:23:00 +02:00
|
|
|
components::button("Remove Black Screen", [] {
|
|
|
|
CAM::DO_SCREEN_FADE_IN(0);
|
|
|
|
});
|
|
|
|
|
2023-04-05 19:54:29 +02:00
|
|
|
components::button("Tp To Safe Pos", [] {
|
|
|
|
Vector3 safepos{};
|
|
|
|
float heading;
|
|
|
|
if (pathfind::find_closest_vehicle_node(self::pos, safepos, heading, 0))
|
|
|
|
ENTITY::SET_ENTITY_COORDS(self::ped, safepos.x, safepos.y, safepos.z, 0, 0, 0, false);
|
|
|
|
else
|
|
|
|
g_notification_service->push_error("Find safe pos", "Failed to find a safe position");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2023-02-01 19:48:50 +01:00
|
|
|
components::command_button<"fastquit">();
|
|
|
|
|
2023-02-04 16:35:18 +00:00
|
|
|
if (ImGui::TreeNode("Addresses"))
|
|
|
|
{
|
|
|
|
uint64_t local_cped = (uint64_t)g_local_player;
|
|
|
|
ImGui::InputScalar("Local CPed", ImGuiDataType_U64, &local_cped, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
|
|
|
|
if (g_local_player)
|
|
|
|
{
|
|
|
|
uint64_t local_playerinfo = (uint64_t)g_local_player->m_player_info;
|
|
|
|
ImGui::InputScalar("Local CPlayerInfo", ImGuiDataType_U64, &local_playerinfo, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
|
|
|
|
uint64_t local_vehicle = (uint64_t)g_local_player->m_vehicle;
|
|
|
|
ImGui::InputScalar("Local CAutomobile", ImGuiDataType_U64, &local_vehicle, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
}
|
|
|
|
|
2023-04-14 18:54:07 +02:00
|
|
|
if (auto mgr = *g_pointers->m_gta.m_network_player_mgr)
|
2023-02-04 16:35:18 +00:00
|
|
|
{
|
|
|
|
uint64_t local_netplayer = (uint64_t)mgr->m_local_net_player;
|
|
|
|
ImGui::InputScalar("Local CNetGamePlayer", ImGuiDataType_U64, &local_netplayer, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
|
|
|
|
if (mgr->m_local_net_player)
|
|
|
|
{
|
|
|
|
uint64_t local_netplayer = (uint64_t)mgr->m_local_net_player->get_net_data();
|
|
|
|
ImGui::InputScalar("Local netPlayerData", ImGuiDataType_U64, &local_netplayer, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-14 18:54:07 +02:00
|
|
|
if (auto network = *g_pointers->m_gta.m_network)
|
2023-02-04 16:35:18 +00:00
|
|
|
{
|
|
|
|
uint64_t nw = (uint64_t)network;
|
|
|
|
ImGui::InputScalar("Network", ImGuiDataType_U64, &nw, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
}
|
|
|
|
|
2023-04-14 18:54:07 +02:00
|
|
|
if (auto omgr = *g_pointers->m_gta.m_network_object_mgr)
|
2023-02-04 16:35:18 +00:00
|
|
|
{
|
|
|
|
uint64_t nw = (uint64_t)omgr;
|
|
|
|
ImGui::InputScalar("Network Object Mgr", ImGuiDataType_U64, &nw, NULL, NULL, "%p", ImGuiInputTextFlags_CharsHexadecimal);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
2023-04-05 19:54:29 +02:00
|
|
|
if (ImGui::TreeNode("Animation player"))
|
|
|
|
{
|
|
|
|
static char dict[100], anim[100];
|
|
|
|
|
|
|
|
ImGui::PushItemWidth(200);
|
|
|
|
components::input_text_with_hint("##dictionary", "Dict", dict, IM_ARRAYSIZE(dict));
|
|
|
|
components::input_text_with_hint("##animation", "Animation", anim, IM_ARRAYSIZE(anim));
|
|
|
|
if (ImGui::Button("Play animation"))
|
|
|
|
g_fiber_pool->queue_job([=] {
|
|
|
|
ped::ped_play_animation(self::ped, dict, anim);
|
|
|
|
});
|
|
|
|
ImGui::PopItemWidth();
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
2022-12-06 16:12:02 +00:00
|
|
|
ImGui::EndTabItem();
|
2022-10-21 22:05:39 +02:00
|
|
|
}
|
|
|
|
}
|
2023-04-27 02:16:41 +08:00
|
|
|
}
|