mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-07-01 12:02:55 +08:00
Converted all static strings to translation keys. (#2284)
This commit is contained in:
@ -19,7 +19,7 @@ namespace big
|
||||
script_events();
|
||||
scripts();
|
||||
threads();
|
||||
if (ImGui::BeginTabItem("Animations"))
|
||||
if (ImGui::BeginTabItem("GUI_TAB_ANIMATIONS"_T.data()))
|
||||
{
|
||||
animations();
|
||||
ImGui::EndTabItem();
|
||||
|
@ -25,15 +25,17 @@ namespace big
|
||||
}
|
||||
};
|
||||
|
||||
if(animations::has_anim_list_been_populated())
|
||||
ImGui::Text(std::format("There are {} dictionaries with {} animations in memory", animations::anim_dict_count(), animations::total_anim_count()).data());
|
||||
if (animations::has_anim_list_been_populated())
|
||||
{
|
||||
ImGui::Text("VIEW_DEBUG_ANIMATIONS_ANIMATIONS_IN_MEMORY"_T.data(), animations::anim_dict_count(), animations::total_anim_count());
|
||||
}
|
||||
|
||||
components::button("Fetch All Anims", [] {
|
||||
components::button("VIEW_DEBUG_ANIMATIONS_FETCH_ALL_ANIMS"_T, [] {
|
||||
animations::fetch_all_anims();
|
||||
});
|
||||
|
||||
ImGui::SetNextItemWidth(400);
|
||||
components::input_text_with_hint("##dictionaryfilter", "Dictionary", current_dict);
|
||||
components::input_text_with_hint("##dictionaryfilter", "DICT"_T, current_dict);
|
||||
|
||||
if (animations::has_anim_list_been_populated() && ImGui::BeginListBox("##dictionaries", ImVec2(400, 200)))
|
||||
{
|
||||
@ -66,12 +68,12 @@ namespace big
|
||||
ImGui::EndListBox();
|
||||
}
|
||||
|
||||
components::button("Play", [] {
|
||||
components::button("VIEW_DEBUG_ANIMATIONS_PLAY"_T, [] {
|
||||
TASK::CLEAR_PED_TASKS_IMMEDIATELY(self::ped);
|
||||
ped::ped_play_animation(self::ped, current_dict, current_anim, 4.f, -4.f, -1, 0, 0, false);
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("Stop", [] {
|
||||
components::button("VIEW_DEBUG_ANIMATIONS_STOP"_T, [] {
|
||||
TASK::CLEAR_PED_TASKS(self::ped);
|
||||
});
|
||||
}
|
||||
|
@ -137,62 +137,56 @@ namespace big
|
||||
static global_debug global_test{};
|
||||
static script_global glo_bal_sunday = script_global(global_test.global_index);
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
if (ImGui::InputScalar("Global", ImGuiDataType_U64, &global_test.global_index))
|
||||
if (ImGui::InputScalar("VIEW_DEBUG_GLOBAL"_T.data(), ImGuiDataType_U64, &global_test.global_index))
|
||||
glo_bal_sunday = script_global(global_test.global_index);
|
||||
|
||||
for (int i = 0; i < global_test.global_appendages.size(); i++)
|
||||
{
|
||||
auto item = global_test.global_appendages[i];
|
||||
ImGui::PushID(i + item.type);
|
||||
switch (item.type)
|
||||
{
|
||||
case GlobalAppendageType_At:
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar(std::format("At##{}{}", i, (int)item.type).c_str(),
|
||||
ImGuiDataType_S64,
|
||||
&global_test.global_appendages[i].index);
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar(std::format("Size##{}{}", i, (int)item.type).c_str(),
|
||||
ImGuiDataType_S64,
|
||||
&global_test.global_appendages[i].size);
|
||||
break;
|
||||
case GlobalAppendageType_ReadGlobal:
|
||||
ImGui::Text(std::format("Read Global {}", item.global_name).c_str());
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar(std::format("Size##{}{}", i, (int)item.type).c_str(),
|
||||
ImGuiDataType_S64,
|
||||
&global_test.global_appendages[i].size);
|
||||
break;
|
||||
case GlobalAppendageType_PlayerId:
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar(std::format("Read Player ID Size##{}{}", i, (int)item.type).c_str(),
|
||||
ImGuiDataType_S64,
|
||||
&global_test.global_appendages[i].size);
|
||||
break;
|
||||
case GlobalAppendageType_At:
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar("VIEW_DEBUG_GLOBAL_AT"_T.data(), ImGuiDataType_S64, &global_test.global_appendages[i].index);
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar("VIEW_DEBUG_GLOBAL_SIZE"_T.data(), ImGuiDataType_S64, &global_test.global_appendages[i].size);
|
||||
break;
|
||||
case GlobalAppendageType_ReadGlobal:
|
||||
ImGui::Text(std::format("{} {}", "VIEW_DEBUG_GLOBAL_READ_GLOBAL"_T, item.global_name).c_str());
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar("VIEW_DEBUG_GLOBAL_SIZE"_T.data(), ImGuiDataType_S64, &global_test.global_appendages[i].size);
|
||||
break;
|
||||
case GlobalAppendageType_PlayerId:
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar("VIEW_DEBUG_GLOBAL_READ_PLAYER_ID_SIZE"_T.data(), ImGuiDataType_S64, &global_test.global_appendages[i].size);
|
||||
break;
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
if (ImGui::Button("Add Offset"))
|
||||
if (ImGui::Button("VIEW_DEBUG_GLOBAL_ADD_OFFSET"_T.data()))
|
||||
global_test.global_appendages.push_back({GlobalAppendageType_At, 0LL, 0ULL});
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Add Read Player Id"))
|
||||
if (ImGui::Button("VIEW_DEBUG_GLOBAL_ADD_READ_PLAYER_ID"_T.data()))
|
||||
global_test.global_appendages.push_back({GlobalAppendageType_PlayerId, 0LL, 0ULL});
|
||||
|
||||
if (global_test.global_appendages.size() > 0 && ImGui::Button("Remove Offset"))
|
||||
if (global_test.global_appendages.size() > 0 && ImGui::Button("VIEW_DEBUG_GLOBAL_REMOVE_OFFSET"_T.data()))
|
||||
global_test.global_appendages.pop_back();
|
||||
|
||||
if (auto ptr = get_global_ptr(global_test))
|
||||
{
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
ImGui::InputScalar("Value", ImGuiDataType_S32, ptr);
|
||||
ImGui::InputScalar("VIEW_DEBUG_GLOBAL_VALUE"_T.data(), ImGuiDataType_S32, ptr);
|
||||
}
|
||||
else
|
||||
ImGui::Text("INVALID_GLOBAL_READ");
|
||||
ImGui::Text("VIEW_DEBUG_GLOBAL_INVALID_GLOBAL_READ"_T.data());
|
||||
|
||||
auto globals = list_globals();
|
||||
static std::string selected_global;
|
||||
ImGui::Text("Saved Globals");
|
||||
ImGui::Text("VIEW_DEBUG_GLOBAL_SAVED_GLOBALS"_T.data());
|
||||
if (ImGui::BeginListBox("##savedglobals", ImVec2(200, 200)))
|
||||
{
|
||||
for (auto pair : globals)
|
||||
@ -210,7 +204,7 @@ namespace big
|
||||
if (auto ptr = get_global_ptr(pair.second))
|
||||
ImGui::Selectable(std::format("{}", (std::int32_t)*ptr).c_str(), false, ImGuiSelectableFlags_Disabled);
|
||||
else
|
||||
ImGui::Selectable("INVALID_GLOBAL_READ", false, ImGuiSelectableFlags_Disabled);
|
||||
ImGui::Selectable("VIEW_DEBUG_GLOBAL_INVALID_GLOBAL_READ"_T.data(), false, ImGuiSelectableFlags_Disabled);
|
||||
}
|
||||
ImGui::EndListBox();
|
||||
}
|
||||
@ -226,12 +220,12 @@ namespace big
|
||||
save_global(global_name, global_test);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Load Global"))
|
||||
if (ImGui::Button("VIEW_DEBUG_GLOBAL_LOAD_GLOBAL"_T.data()))
|
||||
{
|
||||
load_global_menu(selected_global, global_test);
|
||||
}
|
||||
|
||||
if (ImGui::Button("Delete Global"))
|
||||
if (ImGui::Button("VIEW_DEBUG_GLOBAL_DELETE_GLOBAL"_T.data()))
|
||||
{
|
||||
if (!selected_global.empty())
|
||||
{
|
||||
@ -240,12 +234,12 @@ namespace big
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Add Read Global"))
|
||||
if (ImGui::Button("VIEW_DEBUG_GLOBAL_ADD_READ_GLOBAL"_T.data()))
|
||||
{
|
||||
global_test.global_appendages.push_back({GlobalAppendageType_ReadGlobal, 0LL, 0ULL, selected_global});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Clear"))
|
||||
if (ImGui::Button("VIEW_DEBUG_GLOBAL_CLEAR"_T.data()))
|
||||
{
|
||||
global_test.global_index = 0;
|
||||
global_test.global_appendages.clear();
|
||||
|
@ -15,11 +15,11 @@ namespace big
|
||||
static int offsets[10][2] = {};
|
||||
static int offset_count = 0;
|
||||
static int previous_offset_count = 0;
|
||||
components::input_text("Name", name, sizeof(name));
|
||||
components::input_text("Script Name", script_thread_name, sizeof(script_thread_name));
|
||||
ImGui::Text("Base address");
|
||||
components::input_text("NAME"_T, name, sizeof(name));
|
||||
components::input_text("VIEW_DEBUG_LOCALS_SCRIPT_NAME"_T, script_thread_name, sizeof(script_thread_name));
|
||||
ImGui::Text("VIEW_DEBUG_LOCALS_BASE_ADDRESS"_T.data());
|
||||
ImGui::InputInt("##local_base_address", &base_address);
|
||||
ImGui::Text("Offsetcount");
|
||||
ImGui::Text("VIEW_DEBUG_LOCALS_OFFSET_COUNT"_T.data());
|
||||
ImGui::InputInt("##modal_offset_count", &offset_count);
|
||||
|
||||
offset_count = std::clamp(offset_count, 0, 10);
|
||||
@ -71,7 +71,7 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
g_notification_service->push_error("Locals editor", "Script does not exist");
|
||||
g_notification_service->push_error("DEBUG_TAB_LOCALS"_T.data(), "VIEW_DEBUG_LOCALS_SCRIPT_DOES_NOT_EXIST"_T.data());
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace big
|
||||
if (components::button("SAVE"_T))
|
||||
g_locals_service.save();
|
||||
|
||||
if (components::button("Add Local"))
|
||||
if (components::button("VIEW_DEBUG_LOCALS_ADD_LOCAL"_T))
|
||||
{
|
||||
ImGui::OpenPopup("##addlocal");
|
||||
}
|
||||
@ -136,7 +136,7 @@ namespace big
|
||||
local_.m_edit_mode = 3;
|
||||
|
||||
|
||||
ImGui::LabelText(local_.get_local_chain_text(), "Value");
|
||||
ImGui::LabelText(local_.get_local_chain_text(), "VIEW_DEBUG_GLOBAL_VALUE"_T.data());
|
||||
|
||||
ImGui::SetNextItemWidth(200);
|
||||
|
||||
@ -198,7 +198,7 @@ namespace big
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Freeze", &local_.m_freeze))
|
||||
if (ImGui::Checkbox("VIEW_DEBUG_LOCALS_FREEZE"_T.data(), &local_.m_freeze))
|
||||
{
|
||||
local_.m_freeze_value_int = *local_.m_internal_address;
|
||||
local_.m_freeze_value_float = *reinterpret_cast<float*>(local_.m_internal_address);
|
||||
@ -207,7 +207,7 @@ namespace big
|
||||
}
|
||||
else
|
||||
{
|
||||
if (components::button("Fetch"))
|
||||
if (components::button("VIEW_DEBUG_LOCALS_FETCH"_T))
|
||||
{
|
||||
local_.fetch_local_pointer();
|
||||
}
|
||||
@ -216,10 +216,10 @@ namespace big
|
||||
else
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f));
|
||||
ImGui::Text("%s isn't running", local_.m_script_thread_name);
|
||||
ImGui::Text(std::format("{} {}", local_.m_script_thread_name, "VIEW_DEBUG_LOCALS_SCRIPT_IS_NOT_RUNNING"_T).c_str());
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
if (components::button("Delete"))
|
||||
if (components::button("DELETE"_T))
|
||||
std::erase_if(g_locals_service.m_locals, [local_](local l) {
|
||||
return l.get_id() == local_.get_id();
|
||||
});
|
||||
|
@ -18,28 +18,28 @@ namespace big
|
||||
{
|
||||
if (ImGui::BeginTabItem("DEBUG_TAB_MISC"_T.data()))
|
||||
{
|
||||
components::command_checkbox<"windowhook">("Disable GTA Window Hook");
|
||||
components::command_checkbox<"windowhook">("VIEW_DEBUG_MISC_DISABLE_GTA_WINDOW_HOOK"_T);
|
||||
|
||||
ImGui::Text("Fiber Pool Usage %d/%d", g_fiber_pool->get_used_fibers(), g_fiber_pool->get_total_fibers());
|
||||
ImGui::Text(std::format("{}: {}/{}", "VIEW_DEBUG_MISC_FIBER_POOL_USAGE"_T, g_fiber_pool->get_used_fibers(), g_fiber_pool->get_total_fibers()).c_str());
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (components::button("RESET"_T.data()))
|
||||
if (components::button("RESET"_T))
|
||||
{
|
||||
g_fiber_pool->reset();
|
||||
}
|
||||
|
||||
if (components::button("Trigger GTA Error Message Box"))
|
||||
if (components::button("VIEW_DEBUG_MISC_TRIGGER_GTA_ERROR_BOX"_T))
|
||||
{
|
||||
hooks::log_error_message_box(0xBAFD530B, 1);
|
||||
}
|
||||
|
||||
if (components::button("DUMP_ENTRYPOINTS"_T.data()))
|
||||
if (components::button("DUMP_ENTRYPOINTS"_T))
|
||||
{
|
||||
system::dump_entry_points();
|
||||
}
|
||||
|
||||
components::button("NETWORK_BAIL"_T.data(), [] {
|
||||
components::button("NETWORK_BAIL"_T, [] {
|
||||
NETWORK::NETWORK_BAIL(16, 0, 0);
|
||||
});
|
||||
|
||||
@ -50,53 +50,53 @@ namespace big
|
||||
STATS::STAT_SET_BOOL(RAGE_JOAAT("MPPLY_CHAR_IS_BADSPORT"), false, true);
|
||||
});
|
||||
|
||||
components::button("LOAD_MP_MAP"_T.data(), [] {
|
||||
components::button("LOAD_MP_MAP"_T, [] {
|
||||
DLC::ON_ENTER_MP();
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("LOAD_SP_MAP"_T.data(), [] {
|
||||
components::button("LOAD_SP_MAP"_T, [] {
|
||||
DLC::ON_ENTER_SP();
|
||||
});
|
||||
|
||||
components::button("SKIP_CUTSCENE"_T.data(), [] {
|
||||
components::button("SKIP_CUTSCENE"_T, [] {
|
||||
CUTSCENE::STOP_CUTSCENE_IMMEDIATELY();
|
||||
});
|
||||
|
||||
components::button("REFRESH_INTERIOR"_T.data(), [] {
|
||||
components::button("REFRESH_INTERIOR"_T, [] {
|
||||
Interior interior = INTERIOR::GET_INTERIOR_AT_COORDS(self::pos.x, self::pos.y, self::pos.z);
|
||||
INTERIOR::REFRESH_INTERIOR(interior);
|
||||
});
|
||||
|
||||
components::button("NET_SHUTDOWN_AND_LOAD_SP"_T.data(), [] {
|
||||
components::button("NET_SHUTDOWN_AND_LOAD_SP"_T, [] {
|
||||
NETWORK::SHUTDOWN_AND_LAUNCH_SINGLE_PLAYER_GAME();
|
||||
});
|
||||
|
||||
components::button("NET_SHUTDOWN_AND_LOAD_SAVE"_T.data(), [] {
|
||||
components::button("NET_SHUTDOWN_AND_LOAD_SAVE"_T, [] {
|
||||
NETWORK::SHUTDOWN_AND_LOAD_MOST_RECENT_SAVE();
|
||||
});
|
||||
|
||||
components::button("REMOVE_BLACKSCREEN"_T.data(), [] {
|
||||
components::button("REMOVE_BLACKSCREEN"_T, [] {
|
||||
CAM::DO_SCREEN_FADE_IN(0);
|
||||
});
|
||||
|
||||
components::button("TP_TO_SAFE_POS"_T.data(), [] {
|
||||
components::button("TP_TO_SAFE_POS"_T, [] {
|
||||
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");
|
||||
g_notification_service->push_error("DEBUG_TAB_MISC"_T.data(), "VIEW_DEBUG_MISC_TP_TO_SAFE_POS_FAILED"_T.data());
|
||||
});
|
||||
|
||||
ImGui::Checkbox("ImGui Demo", &g.window.demo);
|
||||
ImGui::Checkbox("VIEW_DEBUG_MISC_IMGUI_DEMO"_T.data(), &g.window.demo);
|
||||
|
||||
components::command_button<"fastquit">();
|
||||
|
||||
if (ImGui::TreeNode("Fuzzer"))
|
||||
if (ImGui::TreeNode("VIEW_DEBUG_MISC_FUZZER"_T.data()))
|
||||
{
|
||||
ImGui::Checkbox("Enabled", &g.debug.fuzzer.enabled);
|
||||
ImGui::Checkbox("ENABLED"_T.data(), &g.debug.fuzzer.enabled);
|
||||
|
||||
for (int i = 0; i < net_object_type_strs.size(); i++)
|
||||
{
|
||||
@ -152,8 +152,8 @@ namespace big
|
||||
static char dict[100], anim[100];
|
||||
|
||||
ImGui::PushItemWidth(200);
|
||||
components::input_text_with_hint("##dictionary", "DICT"_T.data(), dict, IM_ARRAYSIZE(dict));
|
||||
components::input_text_with_hint("##animation", "ANIMATION"_T.data(), anim, IM_ARRAYSIZE(anim));
|
||||
components::input_text_with_hint("##dictionary", "DICT"_T, dict, IM_ARRAYSIZE(dict));
|
||||
components::input_text_with_hint("##animation", "ANIMATION"_T, anim, IM_ARRAYSIZE(anim));
|
||||
if (ImGui::Button("PLAY_ANIMATION"_T.data()))
|
||||
g_fiber_pool->queue_job([=] {
|
||||
ped::ped_play_animation(self::ped, dict, anim);
|
||||
|
@ -16,7 +16,7 @@ namespace big
|
||||
{
|
||||
if (ImGui::Checkbox(script->name(), script->toggle_ptr()))
|
||||
{
|
||||
g_notification_service->push(std::string(script->name()).append(" script"), script->is_enabled() ? "Resumed" : "Halted");
|
||||
g_notification_service->push(std::string(script->name()).append("VIEW_DEBUG_SCRIPTS_SCRIPT"_T.data()), script->is_enabled() ? "VIEW_DEBUG_SCRIPTS_RESUMED"_T.data() : "VIEW_DEBUG_SCRIPTS_HALTED"_T.data());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -34,7 +34,7 @@ namespace big
|
||||
{
|
||||
void debug::threads()
|
||||
{
|
||||
if (ImGui::BeginTabItem("Threads"))
|
||||
if (ImGui::BeginTabItem("VIEW_DEBUG_THREADS"_T.data()))
|
||||
{
|
||||
if (!g_pointers->m_gta.m_script_threads)
|
||||
{
|
||||
@ -43,9 +43,9 @@ namespace big
|
||||
return;
|
||||
}
|
||||
|
||||
components::small_text("Threads");
|
||||
components::small_text("VIEW_DEBUG_THREADS"_T);
|
||||
|
||||
if (ImGui::BeginCombo("Thread", selected_thread ? selected_thread->m_name : "NONE"))
|
||||
if (ImGui::BeginCombo("VIEW_DEBUG_THREADS_THREAD"_T.data(), selected_thread ? selected_thread->m_name : "VIEW_DEBUG_THREADS_SELECTED_NONE"_T.data()))
|
||||
{
|
||||
for (auto script : *g_pointers->m_gta.m_script_threads)
|
||||
{
|
||||
@ -85,11 +85,11 @@ namespace big
|
||||
auto host = net_handler->get_host();
|
||||
if (host)
|
||||
{
|
||||
ImGui::Text("Script Host: %s", host->get_name());
|
||||
ImGui::Text(std::format("{}: {}", "VIEW_DEBUG_THREADS_SCRIPT_HOST"_T, host->get_name()).c_str());
|
||||
|
||||
if (!net_handler->is_local_player_host())
|
||||
{
|
||||
components::button("Take Control", [net_handler] {
|
||||
components::button("VIEW_DEBUG_THREADS_TAKE_CONTROL"_T, [net_handler] {
|
||||
net_handler->send_host_migration_event(g_player_service->get_self()->get_net_game_player());
|
||||
script::get_current()->yield(10ms);
|
||||
if (selected_thread->m_stack && selected_thread->m_net_component)
|
||||
@ -101,29 +101,37 @@ namespace big
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ImGui::Combo("State", (int*)&selected_thread->m_context.m_state, "RUNNING\0WAITING\0KILLED\0PAUSED\0STATE_4");
|
||||
static const std::string thread_states = std::string("VIEW_DEBUG_THREADS_STATE_0"_T.data()) + '\0'
|
||||
+ std::string("VIEW_DEBUG_THREADS_STATE_1"_T.data()) + '\0'
|
||||
+ std::string("VIEW_DEBUG_THREADS_STATE_2"_T.data()) + '\0'
|
||||
+ std::string("VIEW_DEBUG_THREADS_STATE_3"_T.data()) + '\0'
|
||||
+ std::string("VIEW_DEBUG_THREADS_STATE_4"_T.data());
|
||||
ImGui::Combo("VIEW_DEBUG_THREADS_STATE"_T.data(), (int*)&selected_thread->m_context.m_state, thread_states.c_str());
|
||||
//Script Pointer
|
||||
ImGui::Text("Script Pointer: ");
|
||||
ImGui::Text(std::format("{}: ", "VIEW_DEBUG_THREADS_SCRIPT_POINTER"_T).c_str());
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(std::format("0x{:X}", (DWORD64)selected_thread).c_str()))
|
||||
ImGui::SetClipboardText(std::format("0x{:X}", (DWORD64)selected_thread).c_str());
|
||||
//Stack Pointer
|
||||
ImGui::Text("Stack Pointer: ");
|
||||
ImGui::Text(std::format("{}: ", "VIEW_DEBUG_THREADS_STACK_POINTER"_T).c_str());
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(std::format("0x{:X}", (DWORD64)selected_thread->m_stack).c_str()))
|
||||
ImGui::SetClipboardText(std::format("0x{:X}", (DWORD64)selected_thread->m_stack).c_str());
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("Internal Stack Pointer: %d Stack Size: %d",
|
||||
selected_thread->m_context.m_stack_pointer, selected_thread->m_context.m_stack_size);
|
||||
ImGui::Text(std::format("{}: {} {}: {}",
|
||||
"VIEW_DEBUG_THREADS_INTERNAL_STACK_POINTER"_T, selected_thread->m_context.m_stack_pointer,
|
||||
"VIEW_DEBUG_THREADS_STACK_SIZE"_T, selected_thread->m_context.m_stack_size)
|
||||
.c_str());
|
||||
//Instruction Pointer
|
||||
ImGui::Text("Instruction Pointer: %X", selected_thread->m_context.m_instruction_pointer);
|
||||
ImGui::Text(std::format("{}: 0x{:X}","VIEW_DEBUG_THREADS_INSTRUCTION_POINTER"_T, selected_thread->m_context.m_instruction_pointer).c_str());
|
||||
|
||||
if (selected_thread->m_context.m_state == rage::eThreadState::killed)
|
||||
ImGui::Text("Exit Reason: %s", selected_thread->m_exit_message);
|
||||
{
|
||||
ImGui::Text(std::format("{}: {}","VIEW_DEBUG_THREADS_EXIT_REASON"_T, selected_thread->m_exit_message).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ImGui::Button("Kill"))
|
||||
if (ImGui::Button("VIEW_DEBUG_THREADS_KILL"_T.data()))
|
||||
{
|
||||
if (selected_thread->m_context.m_stack_size != 0)
|
||||
selected_thread->kill();
|
||||
@ -133,9 +141,9 @@ namespace big
|
||||
}
|
||||
}
|
||||
|
||||
components::small_text("New");
|
||||
components::small_text("VIEW_DEBUG_THREADS_NEW"_T);
|
||||
|
||||
if (ImGui::BeginCombo("Script", selected_script))
|
||||
if (ImGui::BeginCombo("VIEW_DEBUG_THREADS_SCRIPT"_T.data(), selected_script))
|
||||
{
|
||||
for (auto script : all_script_names)
|
||||
{
|
||||
@ -150,7 +158,7 @@ namespace big
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
if (ImGui::BeginCombo("Stack Size", selected_stack_size_str))
|
||||
if (ImGui::BeginCombo("VIEW_DEBUG_THREADS_STACK_SIZE"_T.data(), selected_stack_size_str))
|
||||
{
|
||||
for (auto& p : stack_sizes)
|
||||
{
|
||||
@ -170,9 +178,9 @@ namespace big
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
ImGui::Text("Free Stacks: %d", free_stacks);
|
||||
ImGui::Text(std::format("{}: {}", "VIEW_DEBUG_THREADS_FREE_STACKS"_T, free_stacks).c_str());
|
||||
|
||||
components::button("Start", [] {
|
||||
components::button("SETTINGS_NOTIFY_GTA_THREADS_START"_T, [] {
|
||||
auto hash = rage::joaat(selected_script);
|
||||
|
||||
if (!SCRIPT::DOES_SCRIPT_WITH_NAME_HASH_EXIST(hash))
|
||||
@ -182,7 +190,7 @@ namespace big
|
||||
|
||||
if (MISC::GET_NUMBER_OF_FREE_STACKS_OF_THIS_SIZE(selected_stack_size) == 0)
|
||||
{
|
||||
g_notification_service->push_warning("Script Launcher", "No free stacks for this stack size");
|
||||
g_notification_service->push_warning("VIEW_DEBUG_THREADS"_T.data(), "VIEW_DEBUG_THREADS_NO_FREE_STACKS"_T.data());
|
||||
}
|
||||
|
||||
while (!SCRIPT::HAS_SCRIPT_WITH_NAME_HASH_LOADED(hash))
|
||||
@ -200,13 +208,13 @@ namespace big
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("Start With Launcher", [] {
|
||||
components::button("VIEW_DEBUG_THREADS_START_WITH_LAUNCHER"_T, [] {
|
||||
auto hash = rage::joaat(selected_script);
|
||||
auto idx = scripts::launcher_index_from_hash(hash);
|
||||
|
||||
if (idx == -1)
|
||||
{
|
||||
g_notification_service->push_warning("Script Launcher", "This script cannot be started using am_launcher");
|
||||
g_notification_service->push_warning("VIEW_DEBUG_THREADS"_T.data(), "VIEW_DEBUG_THREADS_FAILED_WITH_LAUNCHER"_T.data());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace big
|
||||
if (ImGui::BeginTabItem("DEBUG_TABS_LOGS"_T.data()))
|
||||
{
|
||||
ImGui::Checkbox("DEBUG_LOG_METRICS"_T.data(), &g.debug.logs.metric_logs);
|
||||
ImGui::Checkbox("Log Packets", &g.debug.logs.packet_logs);// TODO: translate
|
||||
ImGui::Checkbox("VIEW_DEBUG_LOGS_LOG_PACKETS"_T.data(), &g.debug.logs.packet_logs);
|
||||
ImGui::Checkbox("DEBUG_LOG_NATIVE_SCRIPT_HOOKS"_T.data(), &g.debug.logs.script_hook_logs);
|
||||
|
||||
if (ImGui::TreeNode("DEBUG_LOG_TREE_SCRIPT_EVENT"_T.data()))
|
||||
@ -32,7 +32,7 @@ namespace big
|
||||
ImGui::EndListBox();
|
||||
}
|
||||
|
||||
ImGui::Checkbox("Block All", &g.debug.logs.script_event.block_all);
|
||||
ImGui::Checkbox("VIEW_DEBUG_LOGS_BLOCK_ALL"_T.data(), &g.debug.logs.script_event.block_all);
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
Reference in New Issue
Block a user