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:
maybegreat48
2023-03-01 21:27:15 +00:00
committed by GitHub
parent 6a2cd866c0
commit 9ccb77e8eb
467 changed files with 55742 additions and 36204 deletions

View File

@ -1,5 +1,5 @@
#include "views/view.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "views/view.hpp"
namespace big
{
@ -10,13 +10,21 @@ namespace big
if (g.context_menu.enabled)
{
ImGui::Text("SETTINGS_CONTEXT_MENU_ENTITY_TYPES"_T.data());
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_OBJECT"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::OBJECT));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_OBJECT"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::OBJECT));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PED"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::PED));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PED"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::PED));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PLAYER"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::PLAYER));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PLAYER"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::PLAYER));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_VEHICLE"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::VEHICLE));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_VEHICLE"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::VEHICLE));
static ImVec4 selected_option_color = ImGui::ColorConvertU32ToFloat4(g.context_menu.selected_option_color);
ImGui::Text("SETTINGS_CONTEXT_MENU_COLOR"_T.data());

View File

@ -14,17 +14,25 @@ namespace big
ImGui::SliderFloat2("###Global Render Distance", g.esp.global_render_distance, 0.f, 1500.f);
ImGui::Checkbox("SETTINGS_ESP_TRACER"_T.data(), &g.esp.tracer);
if (g.esp.tracer) {
if (g.esp.tracer)
{
ImGui::Text("SETTINGS_ESP_TRACER_POSITION"_T.data());
ImGui::SliderFloat2("###Draw Position", g.esp.tracer_draw_position, 0.f, 1.f);
ImGui::Text("SETTINGS_ESP_TRACER_RENDER_DISTANCE"_T.data());
ImGui::SliderFloat2("###Tracer Render Distance", g.esp.tracer_render_distance, g.esp.global_render_distance[0], g.esp.global_render_distance[1]);
ImGui::SliderFloat2("###Tracer Render Distance",
g.esp.tracer_render_distance,
g.esp.global_render_distance[0],
g.esp.global_render_distance[1]);
}
ImGui::Checkbox("SETTINGS_ESP_BOX"_T.data(), &g.esp.box);
if (g.esp.box) {
if (g.esp.box)
{
ImGui::Text("SETTINGS_ESP_BOX_RENDER_DISTANCE"_T.data());
ImGui::SliderFloat2("###Box Render Distance", g.esp.box_render_distance, g.esp.global_render_distance[0], g.esp.global_render_distance[1]);
ImGui::SliderFloat2("###Box Render Distance",
g.esp.box_render_distance,
g.esp.global_render_distance[0],
g.esp.global_render_distance[1]);
}
ImGui::Checkbox("SETTINGS_ESP_PLAYER_NAME"_T.data(), &g.esp.name);
@ -40,17 +48,21 @@ namespace big
if (g.esp.armor)
ImGui::Checkbox("SETTINGS_ESP_SCALE_ARMOR"_T.data(), &g.esp.scale_armor_from_dist);
static ImVec4 col_enemy = ImGui::ColorConvertU32ToFloat4(g.esp.enemy_color);
static ImVec4 col_enemy = ImGui::ColorConvertU32ToFloat4(g.esp.enemy_color);
static ImVec4 col_enemy_near = ImGui::ColorConvertU32ToFloat4(g.esp.enemy_near_color);
static ImVec4 col_default = ImGui::ColorConvertU32ToFloat4(g.esp.default_color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g.esp.friend_color);
static ImVec4 col_default = ImGui::ColorConvertU32ToFloat4(g.esp.default_color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g.esp.friend_color);
ImGui::Text("SETTINGS_ESP_DISTANCE_THRESHOLD"_T.data());
ImGui::SliderFloat2("###Distance threshold", g.esp.distance_threshold, g.esp.global_render_distance[0], g.esp.global_render_distance[1]);
ImGui::SliderFloat2("###Distance threshold",
g.esp.distance_threshold,
g.esp.global_render_distance[0],
g.esp.global_render_distance[1]);
if (ImGui::TreeNode("SETTINGS_ESP_COLORS"_T.data()))
{
if (g.esp.change_esp_color_from_dist) {
if (g.esp.change_esp_color_from_dist)
{
ImGui::Text("SETTINGS_ESP_ENEMY_CLOSE_COLOR"_T.data());
if (ImGui::ColorEdit4("###Enemy ESP Color##esp_picker", (float*)&col_enemy, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{

View File

@ -1,17 +1,13 @@
#include "views/view.hpp"
#include "renderer.hpp"
#include "views/view.hpp"
namespace big
{
void view::gui_settings()
{
components::sub_title("SETTINGS_UI_SCALE"_T);
ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 1.f, 1.5f, "%.2f");
ImGui::SameLine();
if (ImGui::Button("APPLY"_T.data()))
if (ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 1.f, 1.5f, "%.2f"))
g_renderer->rescale(g.window.gui_scale);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("SETTINGS_UI_SCALE_DESCRIPTION"_T.data());
components::sub_title("SETTINGS_UI_COLOR"_T);
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g.window.color);

View File

@ -1,6 +1,6 @@
#include "services/hotkey/hotkey_service.hpp"
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
#include "services/hotkey/hotkey_service.hpp"
namespace big
{
@ -9,7 +9,7 @@ namespace big
ImGui::PushItemWidth(350.f);
if (ImGui::Hotkey("Menu Toggle", &g.settings.hotkeys.menu_toggle))
g.settings.hotkeys.editing_menu_toggle = true; // make our menu reappear
g.settings.hotkeys.editing_menu_toggle = true;// make our menu reappear
if (ImGui::Hotkey("Teleport to waypoint", &g.settings.hotkeys.teleport_waypoint))
g_hotkey_service->update_hotkey("waypoint", g.settings.hotkeys.teleport_waypoint);

View File

@ -1,6 +1,6 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "views/view.hpp"
namespace big::helper
{
@ -31,44 +31,44 @@ namespace big
static int year, month, day, hour, minute, second, millisecond;
static char stat_int_read_result[256] = {};
static char stat_int_text[256] = {};
static char stat_int_value[256] = {};
static char stat_int_text[256] = {};
static char stat_int_value[256] = {};
static char stat_bool_read_result[256] = {};
static char stat_bool_text[256] = {};
static char stat_bool_value[256] = {};
static char stat_bool_text[256] = {};
static char stat_bool_value[256] = {};
static char stat_float_read_result[256] = {};
static char stat_float_text[256] = {};
static char stat_float_value[256] = {};
static char stat_float_text[256] = {};
static char stat_float_value[256] = {};
static char stat_increment_text[256] = {};
static char stat_increment_text[256] = {};
static char stat_increment_value[256] = {};
static char stat_date_read_result[256] = {};
static char stat_date_text[256] = {};
static char stat_date_value[256] = {};
static char stat_date_text[256] = {};
static char stat_date_value[256] = {};
static char stat_string_read_result[256] = {};
static char stat_string_text[256] = {};
static char stat_string_value[256] = {};
static char stat_string_text[256] = {};
static char stat_string_value[256] = {};
static char stat_label_text[256] = {};
static char stat_label_text[256] = {};
static char stat_label_value[256] = {};
static char stat_user_id_read_result[256] = {};
static char stat_user_id_text[256] = {};
static char stat_user_id_value[256] = {};
static char stat_user_id_text[256] = {};
static char stat_user_id_value[256] = {};
static char packed_stat_int_read_result[256] = {};
static char packed_stat_int_text[256] = {};
static char packed_stat_int_value[256] = {};
static char packed_stat_int_text[256] = {};
static char packed_stat_int_value[256] = {};
static char packed_stat_bool_read_result[256] = {};
static char packed_stat_bool_text[256] = {};
static char packed_stat_bool_value[256] = {};
static char packed_stat_bool_text[256] = {};
static char packed_stat_bool_value[256] = {};
template <typename T>
template<typename T>
static std::enable_if_t<std::is_same_v<T, std::string>, T> get_text_value(std::string text)
{
return text;
@ -125,97 +125,160 @@ namespace big
IMPORT
};
ImGui::RadioButton("Int", &g.stat_editor.stat.radio_button_index, INT); ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.stat.radio_button_index, BOOLEAN); ImGui::SameLine();
ImGui::RadioButton("Float", &g.stat_editor.stat.radio_button_index, FLOAT); ImGui::SameLine();
ImGui::RadioButton("Increment", &g.stat_editor.stat.radio_button_index, INCREMENT); ImGui::SameLine();
ImGui::RadioButton("Date", &g.stat_editor.stat.radio_button_index, DATE); ImGui::SameLine();
ImGui::RadioButton("String", &g.stat_editor.stat.radio_button_index, STRING); ImGui::SameLine();
ImGui::RadioButton("Label", &g.stat_editor.stat.radio_button_index, LABEL); ImGui::SameLine();
ImGui::RadioButton("User Id", &g.stat_editor.stat.radio_button_index, USER_ID); ImGui::SameLine();
ImGui::RadioButton("Int", &g.stat_editor.stat.radio_button_index, INT);
ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.stat.radio_button_index, BOOLEAN);
ImGui::SameLine();
ImGui::RadioButton("Float", &g.stat_editor.stat.radio_button_index, FLOAT);
ImGui::SameLine();
ImGui::RadioButton("Increment", &g.stat_editor.stat.radio_button_index, INCREMENT);
ImGui::SameLine();
ImGui::RadioButton("Date", &g.stat_editor.stat.radio_button_index, DATE);
ImGui::SameLine();
ImGui::RadioButton("String", &g.stat_editor.stat.radio_button_index, STRING);
ImGui::SameLine();
ImGui::RadioButton("Label", &g.stat_editor.stat.radio_button_index, LABEL);
ImGui::SameLine();
ImGui::RadioButton("User Id", &g.stat_editor.stat.radio_button_index, USER_ID);
ImGui::SameLine();
ImGui::RadioButton("Import", &g.stat_editor.stat.radio_button_index, IMPORT);
switch (g.stat_editor.stat.radio_button_index)
{
case INT:
{
components::input_text("Stat", stat_int_text, sizeof(stat_int_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.int_text = stat_int_text; });
components::input_text("Value", stat_int_value, sizeof(stat_int_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.int_value = stat_int_value; });
components::button("Apply", [] { helper::stat_set_int(stat_int_text, stat_int_value); }); ImGui::SameLine();
components::input_text("Stat", stat_int_text, sizeof(stat_int_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.int_text = stat_int_text;
});
components::input_text("Value", stat_int_value, sizeof(stat_int_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.int_value = stat_int_value;
});
components::button("Apply", [] {
helper::stat_set_int(stat_int_text, stat_int_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.int_read);
components::input_text("##read_result", stat_int_read_result, sizeof(stat_int_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case BOOLEAN:
{
components::input_text("Stat", stat_bool_text, sizeof(stat_bool_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.bool_text = stat_bool_text; });
components::input_text("Value", stat_bool_value, sizeof(stat_bool_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.bool_value = stat_bool_value; });
components::button("Apply", [] { helper::stat_set_bool(stat_bool_text, stat_bool_value); }); ImGui::SameLine();
components::input_text("Stat", stat_bool_text, sizeof(stat_bool_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.bool_text = stat_bool_text;
});
components::input_text("Value", stat_bool_value, sizeof(stat_bool_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.bool_value = stat_bool_value;
});
components::button("Apply", [] {
helper::stat_set_bool(stat_bool_text, stat_bool_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.bool_read);
components::input_text("##read_result", stat_bool_read_result, sizeof(stat_bool_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case FLOAT:
{
components::input_text("Stat", stat_float_text, sizeof(stat_float_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.float_text = stat_float_text; });
components::input_text("Value", stat_float_value, sizeof(stat_float_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.float_value = stat_float_value; });
components::button("Apply", [] { helper::stat_set_float(stat_float_text, stat_float_value); }); ImGui::SameLine();
components::input_text("Stat", stat_float_text, sizeof(stat_float_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.float_text = stat_float_text;
});
components::input_text("Value", stat_float_value, sizeof(stat_float_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.float_value = stat_float_value;
});
components::button("Apply", [] {
helper::stat_set_float(stat_float_text, stat_float_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.float_read);
components::input_text("##read_result", stat_float_read_result, sizeof(stat_float_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case INCREMENT:
{
components::input_text("Stat", stat_increment_text, sizeof(stat_increment_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.increment_text = stat_increment_text; });
components::input_text("Value", stat_increment_value, sizeof(stat_increment_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.increment_value = stat_increment_value; });
components::button("Apply", [] { helper::stat_increment(stat_increment_text, stat_increment_value); }); ImGui::SameLine();
components::input_text("Stat", stat_increment_text, sizeof(stat_increment_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.increment_text = stat_increment_text;
});
components::input_text("Value", stat_increment_value, sizeof(stat_increment_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.increment_value = stat_increment_value;
});
components::button("Apply", [] {
helper::stat_increment(stat_increment_text, stat_increment_value);
});
ImGui::SameLine();
ImGui::SameLine();
ImGui::Checkbox("Loop Write", &g.stat_editor.stat.increment_loop_write);
}
break;
break;
case DATE:
{
components::input_text("Stat", stat_date_text, sizeof(stat_date_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.date_text = stat_date_text; });
components::input_text("Value", stat_date_value, sizeof(stat_date_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.date_value = stat_date_value; });
components::input_text("Stat", stat_date_text, sizeof(stat_date_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.date_text = stat_date_text;
});
components::input_text("Value", stat_date_value, sizeof(stat_date_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.date_value = stat_date_value;
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("year month day hour minute second millisecond\nexample: 2022 1 17 21 34 55");
components::button("Apply", [] { helper::stat_set_date(stat_date_text, stat_date_value); }); ImGui::SameLine();
components::button("Apply", [] {
helper::stat_set_date(stat_date_text, stat_date_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.date_read);
components::input_text("##read_result", stat_date_read_result, sizeof(stat_date_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case STRING:
{
components::input_text("Stat", stat_string_text, sizeof(stat_string_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.string_text = stat_string_text; });
components::input_text("Value", stat_string_value, sizeof(stat_string_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.string_value = stat_string_value; });
components::button("Apply", [] { helper::stat_set_string(stat_string_text, stat_string_value); }); ImGui::SameLine();
components::input_text("Stat", stat_string_text, sizeof(stat_string_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.string_text = stat_string_text;
});
components::input_text("Value", stat_string_value, sizeof(stat_string_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.string_value = stat_string_value;
});
components::button("Apply", [] {
helper::stat_set_string(stat_string_text, stat_string_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.string_read);
components::input_text("##read_result", stat_string_read_result, sizeof(stat_string_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case LABEL:
{
components::input_text("Stat", stat_label_text, sizeof(stat_label_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.label_text = stat_label_text; });
components::input_text("Value", stat_label_value, sizeof(stat_label_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.label_value = stat_label_value; });
components::button("Apply", [] { helper::stat_set_label(stat_label_text, stat_label_value); }); ImGui::SameLine();
components::input_text("Stat", stat_label_text, sizeof(stat_label_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.label_text = stat_label_text;
});
components::input_text("Value", stat_label_value, sizeof(stat_label_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.label_value = stat_label_value;
});
components::button("Apply", [] {
helper::stat_set_label(stat_label_text, stat_label_value);
});
ImGui::SameLine();
}
break;
break;
case USER_ID:
{
components::input_text("Stat", stat_user_id_text, sizeof(stat_user_id_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.user_id_text = stat_user_id_text; });
components::input_text("Value", stat_user_id_value, sizeof(stat_user_id_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.user_id_value = stat_user_id_value; });
components::button("Apply", [] { helper::stat_set_user_id(stat_user_id_text, stat_user_id_value); }); ImGui::SameLine();
components::input_text("Stat", stat_user_id_text, sizeof(stat_user_id_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.user_id_text = stat_user_id_text;
});
components::input_text("Value", stat_user_id_value, sizeof(stat_user_id_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.user_id_value = stat_user_id_value;
});
components::button("Apply", [] {
helper::stat_set_user_id(stat_user_id_text, stat_user_id_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.user_id_read);
components::input_text("##read_result", stat_user_id_read_result, sizeof(stat_user_id_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case IMPORT:
{
ImGui::Text("0:Int\n1:Bool\n2:Float\n3:Increment\n4:Date\n5:String\n6:Label\n7:User Id");
ImGui::Text("Example:\n$MPX_CHAR_NAME\n5:name\n$MPX_DEFAULT_STATS_SET\n1:0");
components::button("Import From Clipboard", []
{
std::string clipboard_text = ImGui::GetClipboardText();
components::button("Import From Clipboard", [] {
std::string clipboard_text = ImGui::GetClipboardText();
std::vector<std::string> lines = split(clipboard_text, '\n');
if (!lines.size() || lines.size() % 2)
return;
@ -225,43 +288,25 @@ namespace big
continue;
std::vector<std::string> strs = split(lines[i + 1], ':');
if (strs.size() == 1)
strs.push_back(""); //In case the string is to set a ""
strs.push_back("");//In case the string is to set a ""
int type = get_text_value<int>(strs[0]);
switch (type)
{
case INT:
helper::stat_set_int(lines[i], strs[1]);
break;
case BOOLEAN:
helper::stat_set_bool(lines[i], strs[1]);
break;
case FLOAT:
helper::stat_set_float(lines[i], strs[1]);
break;
case INCREMENT:
helper::stat_increment(lines[i], strs[1]);
break;
case DATE:
helper::stat_set_date(lines[i], strs[1]);
break;
case STRING:
helper::stat_set_string(lines[i], strs[1]);
break;
case LABEL:
helper::stat_set_label(lines[i], strs[1]);
break;
case USER_ID:
helper::stat_set_user_id(lines[i], strs[1]);
break;
default:
break;
case INT: helper::stat_set_int(lines[i], strs[1]); break;
case BOOLEAN: helper::stat_set_bool(lines[i], strs[1]); break;
case FLOAT: helper::stat_set_float(lines[i], strs[1]); break;
case INCREMENT: helper::stat_increment(lines[i], strs[1]); break;
case DATE: helper::stat_set_date(lines[i], strs[1]); break;
case STRING: helper::stat_set_string(lines[i], strs[1]); break;
case LABEL: helper::stat_set_label(lines[i], strs[1]); break;
case USER_ID: helper::stat_set_user_id(lines[i], strs[1]); break;
default: break;
}
}
});
}
break;
default:
break;
break;
default: break;
}
ImGui::EndTabItem();
@ -281,37 +326,52 @@ namespace big
IMPORT
};
ImGui::RadioButton("Int", &g.stat_editor.packed_stat.radio_button_index, INT); ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.packed_stat.radio_button_index, BOOLEAN); ImGui::SameLine();
ImGui::RadioButton("Int", &g.stat_editor.packed_stat.radio_button_index, INT);
ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.packed_stat.radio_button_index, BOOLEAN);
ImGui::SameLine();
ImGui::RadioButton("Import", &g.stat_editor.packed_stat.radio_button_index, IMPORT);
switch (g.stat_editor.packed_stat.radio_button_index)
{
case INT:
{
components::input_text("Index", packed_stat_int_text, sizeof(packed_stat_int_text), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.int_text = packed_stat_int_text; });
components::input_text("Value", packed_stat_int_value, sizeof(packed_stat_int_value), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.int_value = packed_stat_int_value; });
components::button("Apply", [] { helper::packed_stat_set_int(packed_stat_int_text, packed_stat_int_value); }); ImGui::SameLine();
components::input_text("Index", packed_stat_int_text, sizeof(packed_stat_int_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.int_text = packed_stat_int_text;
});
components::input_text("Value", packed_stat_int_value, sizeof(packed_stat_int_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.int_value = packed_stat_int_value;
});
components::button("Apply", [] {
helper::packed_stat_set_int(packed_stat_int_text, packed_stat_int_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.packed_stat.int_read);
components::input_text("##read_result", packed_stat_int_read_result, sizeof(packed_stat_int_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case BOOLEAN:
{
components::input_text("Index", packed_stat_bool_text, sizeof(packed_stat_bool_text), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.bool_text = packed_stat_bool_text; });
components::input_text("Value", packed_stat_bool_value, sizeof(packed_stat_bool_value), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.bool_value = packed_stat_bool_value; });
components::button("Apply", [] { helper::packed_stat_set_bool(packed_stat_bool_text, packed_stat_bool_value); }); ImGui::SameLine();
components::input_text("Index", packed_stat_bool_text, sizeof(packed_stat_bool_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.bool_text = packed_stat_bool_text;
});
components::input_text("Value", packed_stat_bool_value, sizeof(packed_stat_bool_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.bool_value = packed_stat_bool_value;
});
components::button("Apply", [] {
helper::packed_stat_set_bool(packed_stat_bool_text, packed_stat_bool_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.packed_stat.bool_read);
components::input_text("##read_result", packed_stat_bool_read_result, sizeof(packed_stat_bool_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case IMPORT:
{
ImGui::Text("0:Int\n1:Bool");
ImGui::Text("Example:\n31786\n0:123\n31786 32786\n1:1");
components::button("Import From Clipboard", []
{
std::string clipboard_text = ImGui::GetClipboardText();
components::button("Import From Clipboard", [] {
std::string clipboard_text = ImGui::GetClipboardText();
std::vector<std::string> lines = split(clipboard_text, '\n');
if (!lines.size() || lines.size() % 2)
return;
@ -325,21 +385,15 @@ namespace big
int type = get_text_value<int>(strs[0]);
switch (type)
{
case INT:
helper::packed_stat_set_int(lines[i], strs[1]);
break;
case BOOLEAN:
helper::packed_stat_set_bool(lines[i], strs[1]);
break;
default:
break;
case INT: helper::packed_stat_set_int(lines[i], strs[1]); break;
case BOOLEAN: helper::packed_stat_set_bool(lines[i], strs[1]); break;
default: break;
}
}
});
}
break;
default:
break;
break;
default: break;
}
ImGui::EndTabItem();
@ -373,8 +427,7 @@ namespace big
strcpy_s(packed_stat_bool_value, sizeof(packed_stat_bool_value), g.stat_editor.packed_stat.bool_value.c_str());
}(), true);
g_fiber_pool->queue_job([]
{
g_fiber_pool->queue_job([] {
STATS::STAT_GET_INT(RAGE_JOAAT("MPPLY_LAST_MP_CHAR"), &character_index, -1);
CLOCK::GET_POSIX_TIME(&year, &month, &day, &hour, &minute, &second);
if (g.stat_editor.stat.int_read)
@ -388,13 +441,21 @@ namespace big
if (g.stat_editor.stat.date_read)
strcpy_s(stat_date_read_result, sizeof(stat_date_read_result), helper::stat_get_date(stat_date_text).c_str());
if (g.stat_editor.stat.string_read)
strcpy_s(stat_string_read_result, sizeof(stat_string_read_result), helper::stat_get_string(stat_string_text).c_str());
strcpy_s(stat_string_read_result,
sizeof(stat_string_read_result),
helper::stat_get_string(stat_string_text).c_str());
if (g.stat_editor.stat.user_id_read)
strcpy_s(stat_user_id_read_result, sizeof(stat_user_id_read_result), helper::stat_get_user_id(stat_user_id_text).c_str());
if(g.stat_editor.packed_stat.int_read)
strcpy_s(packed_stat_int_read_result, sizeof(packed_stat_int_read_result), helper::packed_stat_get_int(packed_stat_int_text).c_str());
strcpy_s(stat_user_id_read_result,
sizeof(stat_user_id_read_result),
helper::stat_get_user_id(stat_user_id_text).c_str());
if (g.stat_editor.packed_stat.int_read)
strcpy_s(packed_stat_int_read_result,
sizeof(packed_stat_int_read_result),
helper::packed_stat_get_int(packed_stat_int_text).c_str());
if (g.stat_editor.packed_stat.bool_read)
strcpy_s(packed_stat_bool_read_result, sizeof(packed_stat_bool_read_result), helper::packed_stat_get_bool(packed_stat_bool_text).c_str());
strcpy_s(packed_stat_bool_read_result,
sizeof(packed_stat_bool_read_result),
helper::packed_stat_get_bool(packed_stat_bool_text).c_str());
});
components::sub_title(std::format("Posix Time: {}-{}-{} {}:{}:{}", year, month, day, hour, minute, second));
@ -447,7 +508,7 @@ namespace big::helper
std::vector<int64_t> strs = split<int64_t>(value, ' ');
int64_t dates[7]{};
STATS::STAT_GET_DATE(get_text_stat_hash(stat), (Any*)dates, 7, -1);
while (strs.size() < 7) //Writing will succeed only when size is greater than or equal to 7
while (strs.size() < 7)//Writing will succeed only when size is greater than or equal to 7
strs.push_back(dates[strs.size()]);
STATS::STAT_SET_DATE(get_text_stat_hash(stat), (Any*)strs.data(), strs.size(), TRUE);
}
@ -526,8 +587,8 @@ namespace big::helper
if (index == "" || value == "")
return;
std::vector<int> index_v = split<int>(index, ' ');
int index_min = index_v[0];
int index_max = index_min;
int index_min = index_v[0];
int index_max = index_min;
if (index_v.size() >= 2)
index_max = index_v[1];
int value_n = get_text_value<int>(value);
@ -540,8 +601,8 @@ namespace big::helper
if (index == "" || value == "")
return;
std::vector<int> index_v = split<int>(index, ' ');
int index_min = index_v[0];
int index_max = index_min;
int index_min = index_v[0];
int index_max = index_min;
if (index_v.size() >= 2)
index_max = index_v[1];
int value_b = get_text_value<bool>(value);

View File

@ -5,7 +5,7 @@ namespace big
void view::translation_settings()
{
const auto& language_entries = g_translation_service.available_translations();
const auto current_pack = g_translation_service.current_language_pack();
const auto current_pack = g_translation_service.current_language_pack();
ImGui::Text("SETTINGS_LANGUAGES"_T.data());
if (ImGui::BeginCombo("##combo-languages", language_entries.at(current_pack).name.c_str()))