feat: Translation Service (#844)

Co-authored-by: mrwoowoo <github@hiqaq.com>
Co-authored-by: LiamD-Flop <40887493+LiamD-Flop@users.noreply.github.com>
This commit is contained in:
Yimura
2023-02-01 19:46:33 +01:00
committed by GitHub
parent ef3decba53
commit d4f2960c77
79 changed files with 1183 additions and 779 deletions

View File

@ -19,7 +19,7 @@ namespace big
static char search[64];
ImGui::SetNextItemWidth(300.f);
components::input_text_with_hint("Player", "Search", search, sizeof(search), ImGuiInputTextFlags_None);
components::input_text_with_hint("PLAYER"_T, "SEARCH"_T, search, sizeof(search), ImGuiInputTextFlags_None);
if (ImGui::ListBoxHeader("###players", { 180, static_cast<float>(*g_pointers->m_resolution_y - 400 - 38 * 4) }))
{
@ -53,7 +53,7 @@ namespace big
}
else
{
ImGui::Text("No stored players");
ImGui::Text("NO_STORED_PLAYERS"_T.data());
}
ImGui::ListBoxFooter();
@ -64,16 +64,16 @@ namespace big
ImGui::SameLine();
if (ImGui::BeginChild("###selected_player", { 500, static_cast<float>(*g_pointers->m_resolution_y - 388 - 38 * 4) }, false, ImGuiWindowFlags_NoBackground))
{
if (ImGui::InputText("Name", name_buf, sizeof(name_buf)))
if (ImGui::InputText("NAME"_T.data(), name_buf, sizeof(name_buf)))
{
current_player.name = name_buf;
}
ImGui::InputScalar("Rockstar ID", ImGuiDataType_S64, &current_player.rockstar_id);
ImGui::Checkbox("Is Modder", &current_player.is_modder);
ImGui::Checkbox("Block Join", &current_player.block_join);
ImGui::InputScalar("RID"_T.data(), ImGuiDataType_S64, &current_player.rockstar_id);
ImGui::Checkbox("IS_MODDER"_T.data(), &current_player.is_modder);
ImGui::Checkbox("BLOCK_JOIN"_T.data(), &current_player.block_join);
if (ImGui::BeginCombo("Block Join Alert", block_join_reasons[current_player.block_join_reason]))
if (ImGui::BeginCombo("BLOCK_JOIN_ALERT"_T.data(), block_join_reasons[current_player.block_join_reason]))
{
for (const auto& reason : block_join_reasons)
{
@ -92,10 +92,10 @@ namespace big
}
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Only works as host");
ImGui::SetTooltip("ONLY_AS_HOST"_T.data());
if (ImGui::BeginCombo("Chat Command Permissions", COMMAND_ACCESS_LEVELS[current_player.command_access_level.value_or(g.session.chat_command_default_access_level)]))
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(), COMMAND_ACCESS_LEVELS[current_player.command_access_level.value_or(g.session.chat_command_default_access_level)]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
@ -115,7 +115,7 @@ namespace big
if (!current_player.infractions.empty())
{
ImGui::Text("Infractions:");
ImGui::Text("INFRACTIONS"_T.data());
for (auto& infraction : current_player.infractions)
{
@ -123,32 +123,32 @@ namespace big
}
}
components::button("Kick", []
components::button("KICK"_T, []
{
session::kick_by_rockstar_id(current_player.rockstar_id);
});
components::button("Join Session", []
components::button("JOIN_SESSION"_T, []
{
session::join_by_rockstar_id(current_player.rockstar_id);
});
static char message[256];
components::input_text("Input Message", message, sizeof(message));
if (components::button("Send Message"))
components::input_text("INPUT_MSG"_T, message, sizeof(message));
if (components::button("SEND_MSG"_T))
{
g_thread_pool->push([selected]
{
if (g_api_service->send_socialclub_message(selected->rockstar_id, message))
{
g_notification_service->push("SCAPI", "Message successfully sent");
g_notification_service->push("SCAPI"_T.data(), "MSG_SENT_SUCCESS"_T.data());
return;
}
g_notification_service->push_error("SCAPI", "Message not sent. Are you connected to the internet?");
g_notification_service->push_error("SCAPI"_T.data(), "MSG_SENT_FAIL"_T.data());
});
};
if (ImGui::Button("Save"))
if (ImGui::Button("SAVE"_T.data()))
{
if (current_player.rockstar_id != selected->rockstar_id)
g_player_database_service->update_rockstar_id(selected->rockstar_id, current_player.rockstar_id);
@ -159,7 +159,7 @@ namespace big
ImGui::SameLine();
if (ImGui::Button("Remove"))
if (ImGui::Button("REMOVE"_T.data()))
{
g_player_database_service->remove_rockstar_id(selected->rockstar_id);
}
@ -167,7 +167,7 @@ namespace big
ImGui::EndChild();
}
if (ImGui::Button("Remove All"))
if (ImGui::Button("REMOVE_ALL"_T.data()))
{
g_player_database_service->set_selected(nullptr);
g_player_database_service->get_players().clear();
@ -175,15 +175,15 @@ namespace big
}
ImGui::Separator();
components::sub_title("New Entry");
components::sub_title("NEW_ENTRY"_T);
static char new_name[64];
static int64_t new_rockstar_id;
components::input_text("Name", new_name, sizeof(new_name));
ImGui::InputScalar("Rockstar ID", ImGuiDataType_S64, &new_rockstar_id);
components::input_text("NAME"_T, new_name, sizeof(new_name));
ImGui::InputScalar("RID"_T.data(), ImGuiDataType_S64, &new_rockstar_id);
if (ImGui::Button("Add"))
if (ImGui::Button("ADD"_T.data()))
{
g_player_database_service->get_players()[new_rockstar_id] = persistent_player(new_name, new_rockstar_id);
g_player_database_service->save();

View File

@ -19,46 +19,46 @@ namespace big
void view::session()
{
static uint64_t rid = 0;
ImGui::InputScalar("Input RID", ImGuiDataType_U64, &rid);
components::button("Join by RID", []
ImGui::InputScalar("INPUT_RID"_T.data(), ImGuiDataType_U64, &rid);
components::button("JOIN_BY_RID"_T, []
{
session::join_by_rockstar_id(rid);
});
ImGui::SameLine();
components::button("Kick by RID", []
components::button("KICK_BY_RID"_T, []
{
session::kick_by_rockstar_id(rid);
});
static char username[20];
components::input_text("Input Username", username, sizeof(username));
if (components::button("Join by Username"))
components::input_text("INPUT_USERNAME"_T, username, sizeof(username));
if (components::button("JOIN_BY_USERNAME"_T))
{
session::join_by_username(username);
};
ImGui::SameLine();
if (components::button("Kick by Username"))
if (components::button("KICK_BY_USERNAME"_T))
{
session::kick_by_username(username);
};
static char base64[500]{};
components::input_text("Session Info", base64, sizeof(base64));
components::button("Join Session Info", []
components::input_text("SESSION_INFO"_T, base64, sizeof(base64));
components::button("JOIN_SESSION_INFO"_T, []
{
rage::rlSessionInfo info;
g_pointers->m_decode_session_info(&info, base64, nullptr);
session::join_session(info);
});
ImGui::SameLine();
components::button("Copy Current Session Info", []
components::button("COPY_SESSION_INFO"_T, []
{
char buf[0x100];
g_pointers->m_encode_session_info(&gta_util::get_network()->m_game_session.m_rline_session.m_session_info, buf, 0x7D, nullptr);
ImGui::SetClipboardText(buf);
});
components::sub_title("Session Switcher");
components::sub_title("SESSION_SWITCHER"_T);
if (ImGui::ListBoxHeader("###session_switch"))
{
for (const auto& session_type : sessions)
@ -71,7 +71,7 @@ namespace big
ImGui::EndListBox();
}
components::sub_title("Region Switcher");
components::sub_title("REGION_SWITCHER"_T);
if (ImGui::ListBoxHeader("###region_switch"))
{
for (const auto& region_type : regions)
@ -84,30 +84,29 @@ namespace big
ImGui::EndListBox();
}
ImGui::Checkbox("Join in SCTV slots", &g.session.join_in_sctv_slots);
ImGui::Checkbox("JOIN_IN_SCTV"_T.data(), &g.session.join_in_sctv_slots);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Allows you to join full and solo sessions but can be detected by other modders");
ImGui::SetTooltip("JOIN_IN_SCTV_DESC"_T.data());
components::sub_title("Player Magnet");
ImGui::Checkbox("Enabled", &g.session.player_magnet_enabled);
components::sub_title("PLAYER_MAGNET"_T);
ImGui::Checkbox("ENABLED"_T.data(), &g.session.player_magnet_enabled);
if (g.session.player_magnet_enabled)
{
ImGui::InputInt("Player Count", &g.session.player_magnet_count);
ImGui::InputInt("PLAYER_COUNT"_T.data(), &g.session.player_magnet_count);
}
components::sub_title("Chat");
ImGui::Checkbox("Auto-kick Chat Spammers", &g.session.kick_chat_spammers);
ImGui::Checkbox("Force Clean", &g.session.chat_force_clean);
ImGui::Checkbox("AUTO_KICK_CHAT_SPAMMERS"_T.data(), &g.session.kick_chat_spammers);
ImGui::Checkbox("DISABLE_FILTER"_T.data(), &g.session.chat_force_clean);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers");
ImGui::Checkbox("Log Chat Messages", &g.session.log_chat_messages);
ImGui::Checkbox("Log Text Messages", &g.session.log_text_messages);
ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers"); // TODO: add translation
ImGui::Checkbox("LOG_CHAT_MSG"_T.data(), &g.session.log_chat_messages);
ImGui::Checkbox("LOG_TXT_MSG"_T.data(), &g.session.log_text_messages);
static char msg[256];
components::input_text("##message", msg, sizeof(msg));
ImGui::SameLine();
ImGui::Checkbox("Is Team", &g.session.is_team);
ImGui::Checkbox("IS_TEAM"_T.data(), &g.session.is_team);
ImGui::SameLine();
components::button("Send", []
components::button("SEND"_T, []
{
if (const auto net_game_player = gta_util::get_network_player_mgr()->m_local_net_player; net_game_player)
{
@ -116,10 +115,10 @@ namespace big
}
});
ImGui::Checkbox("Chat Commands", &g.session.chat_commands);
ImGui::Checkbox("CHAT_COMMANDS"_T.data(), &g.session.chat_commands);
if (g.session.chat_commands)
{
if (ImGui::BeginCombo("Default Command Permissions", COMMAND_ACCESS_LEVELS[g.session.chat_command_default_access_level]))
if (ImGui::BeginCombo("DEFAULT_CMD_PERMISSIONS"_T.data(), COMMAND_ACCESS_LEVELS[g.session.chat_command_default_access_level]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
@ -138,21 +137,21 @@ namespace big
}
}
components::sub_title("Decloak");
components::script_patch_checkbox("Reveal OTR Players", &g.session.decloak_players);
components::sub_title("DECLOAK"_T);
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players);
components::sub_title("Force Host");
ImGui::Checkbox("Force Session Host", &g.session.force_session_host);
components::sub_title("FORCE_HOST"_T);
ImGui::Checkbox("FORCE_SESSION_HOST"_T.data(), &g.session.force_session_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Join another session to apply changes. The original host of the session must leave or be kicked. This feature is easily detectable by other mod menus, use with caution");
ImGui::SetTooltip("FORCE_SESSION_HOST_DESC"_T.data());
ImGui::SameLine();
if (g.session.force_session_host)
{
ImGui::SameLine();
ImGui::Checkbox("Kick Host During Join", &g.session.kick_host_when_forcing_host);
ImGui::Checkbox("KICK_HOST_ON_JOIN"_T.data(), &g.session.kick_host_when_forcing_host);
}
if (ImGui::Checkbox("Force Script Host", &g.session.force_script_host))
if (ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host))
{
if (g.session.force_script_host)
g_fiber_pool->queue_job([]
@ -167,16 +166,16 @@ namespace big
});
}
components::sub_title("Remote Name Spoofing");
ImGui::Checkbox("Spoof Other Players' Names", &g.session.name_spoof_enabled);
components::sub_title("REMOTE_NAME_SPOOFING"_T);
ImGui::Checkbox("SPOOF_PLAYER_NAMES"_T.data(), &g.session.name_spoof_enabled);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Requires session host. Spoofed names will not visible locally nor to the player that had their name spoofed. Requires players to join after becoming host");
ImGui::SetTooltip("SPOOF_PLAYER_NAMES_DESC"_T.data());
if (g.session.name_spoof_enabled)
{
ImGui::Checkbox("Advertise YimMenu", &g.session.advertise_menu);
ImGui::Checkbox("ADVERTISE_YIMMENU"_T.data(), &g.session.advertise_menu);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Advertise YimMenu by spoofing player names to differently colored variants of 'YimMenu'. You will not be able to customize the name with this option enabled");
ImGui::SetTooltip("ADVERTISE_YIMMENU_DESC"_T.data());
if (!g.session.advertise_menu)
{
@ -184,7 +183,7 @@ namespace big
static char name[name_size];
strcpy_s(name, sizeof(name), g.session.spoofed_name.c_str());
ImGui::Text("Name: ");
ImGui::Text("PLAYER_SPOOFED_NAME"_T.data());
components::input_text("##username_input", name, sizeof(name));
if (name != g.session.spoofed_name)
@ -192,40 +191,40 @@ namespace big
}
}
components::sub_title("All Players");
ImGui::Checkbox("Off The Radar", &g.session.off_radar_all);
components::sub_title("ALL_PLAYERS"_T);
ImGui::Checkbox("OFF_THE_RADAR"_T.data(), &g.session.off_radar_all);
ImGui::SameLine();
ImGui::Checkbox("Never Wanted", &g.session.never_wanted_all);
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.session.never_wanted_all);
ImGui::SameLine();
ImGui::Checkbox("Semi Godmode", &g.session.semi_godmode_all);
ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g.session.semi_godmode_all);
ImGui::Checkbox("Explosion Karma", &g.session.explosion_karma);
ImGui::Checkbox("EXPLOSION_KARMA"_T.data(), &g.session.explosion_karma);
ImGui::SameLine();
ImGui::Checkbox("Damage Karma", &g.session.damage_karma);
ImGui::Checkbox("DAMAGE_KARMA"_T.data(), &g.session.damage_karma);
static int global_wanted_level = 0;
if (ImGui::SliderInt("Wanted Level", &global_wanted_level, 0, 5))
if (ImGui::SliderInt("WANTED_LVL"_T.data(), &global_wanted_level, 0, 5))
{
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("Force", &g.session.wanted_level_all))
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(212).as<Player*>() = __rdtsc() + 32;
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
}
components::command_button<"killall">({ }, "Kill Everyone");
components::command_button<"killall">({ }, "KILL_ALL"_T);
ImGui::SameLine();
components::command_button<"explodeall">({ }, "Explode Everyone");
components::command_button<"explodeall">({ }, "EXPLODE_ALL"_T);
ImGui::SameLine();
components::command_button<"beastall">({ });
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Including you");
ImGui::SetTooltip("INCLUDING_YOU"_T.data());
components::command_button<"giveweapsall">({ });
ImGui::SameLine();
@ -235,9 +234,10 @@ namespace big
ImGui::SameLine();
components::command_button<"vehkickall">({ });
components::command_button<"ragdollall">({ }, "Ragdoll Players");
components::command_button<"ragdollall">({ }, "RAGDOLL_PLAYERS"_T);
ImGui::SameLine();
components::command_button<"intkickall">({ }, "Kick Everyone From Interiors");
components::command_button<"intkickall">({ }, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"missionall">({ });
ImGui::SameLine();
@ -253,7 +253,7 @@ namespace big
ImGui::SameLine();
components::command_button<"fakebanall">({ }, "Send Fake Ban Messages");
components::small_text("Teleports");
components::small_text("TELEPORTS"_T);
if (ImGui::BeginCombo("##apartment", apartment_names[g.session.send_to_apartment_idx]))
{
@ -275,7 +275,7 @@ namespace big
ImGui::SameLine();
components::command_button<"apartmenttpall">({ (uint64_t)g.session.send_to_apartment_idx }, "TP All To Apartment");
components::command_button<"apartmenttpall">({ (uint64_t)g.session.send_to_apartment_idx }, "TP_ALL_TO_APARTMENT"_T);
if (ImGui::BeginCombo("##warehouse", warehouse_names[g.session.send_to_warehouse_idx]))
{
@ -297,37 +297,37 @@ namespace big
ImGui::SameLine();
components::command_button<"warehousetpall">({ (uint64_t)g.session.send_to_warehouse_idx }, "TP All To Warehouse");
components::command_button<"warehousetpall">({ (uint64_t)g.session.send_to_warehouse_idx }, "TP_ALL_TO_WAREHOUSE"_T);
components::button("TP All To Darts", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Darts); }); });
components::button("TP_ALL_TO_DARTS"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Darts); }); });
ImGui::SameLine();
components::button("TP All To Flight School", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::PilotSchool); }); });
components::button("TP_ALL_TO_FLIGHT_SCHOOL"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::PilotSchool); }); });
ImGui::SameLine();
components::button("TP All To Map Center", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::ArmWresling); }); });
components::button("TP_ALL_TO_MAP_CENTER"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::ArmWresling); }); });
components::button("TP All To Skydive", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Skydive); }); });
components::button("TP_ALL_TO_SKYDIVE"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Skydive); }); });
ImGui::SameLine();
components::command_button<"interiortpall">({ 81 }, "TP All To MOC");
components::command_button<"interiortpall">({ 81 }, "TP_ALL_TO_MOC"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 123 }, "TP All To Casino");
components::command_button<"interiortpall">({ 123 }, "TP_ALL_TO_CASINO"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 124 }, "TP All To Penthouse");
components::command_button<"interiortpall">({ 124 }, "TP_ALL_TO_PENTHOUSE"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 128 }, "TP All To Arcade");
components::command_button<"interiortpall">({ 128 }, "TP_ALL_TO_ARCADE"_T);
components::command_button<"interiortpall">({ 146 }, "TP All To Music Locker");
components::command_button<"interiortpall">({ 146 }, "TP_ALL_TO_MUSIC_LOCKER"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 148 }, "TP All To Record A Studios");
components::command_button<"interiortpall">({ 148 }, "TP_ALL_TO_RECORD_A_STUDIOS"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 149 }, "TP All To Custom Auto Shop");
components::command_button<"interiortpall">({ 149 }, "TP_ALL_TO_CUSTOM_AUTO_SHOP"_T);
components::command_button<"interiortpall">({ 155 }, "TP All To Agency");
components::command_button<"interiortpall">({ 155 }, "TP_ALL_TO_AGENCY"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 160 }, "TP All To Freakshop");
components::command_button<"interiortpall">({ 160 }, "TP_ALL_TO_FREAKSHOP"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 161 }, "TP All To Multi Floor Garage");
components::command_button<"interiortpall">({ 161 }, "TP_ALL_TO_MULTI_FLOOR_GARAGE"_T);
components::command_button<"tutorialall">();
ImGui::SameLine();
@ -347,34 +347,34 @@ namespace big
ImGui::SameLine();
components::command_button<"camhedzall">();
ImGui::Checkbox("Disable Pedestrians", &g.session.disable_peds);
ImGui::Checkbox("DISABLE_PEDS"_T.data(), &g.session.disable_peds);
ImGui::SameLine();
ImGui::Checkbox("Disable Traffic", &g.session.disable_traffic);
ImGui::Checkbox("DISABLE_TRAFFIC"_T.data(), &g.session.disable_traffic);
ImGui::SameLine();
ImGui::Checkbox("Force Thunder", &g.session.force_thunder);
ImGui::Checkbox("FORCE_THUNDER"_T.data(), &g.session.force_thunder);
components::small_text("Warp Time (requires session host)");
components::small_text("WARP_TIME"_T.data());
components::button("+1 Minute", [] { toxic::warp_time_forward_all(60 * 1000); });
components::button("PLUS_1_MINUTE"_T, [] { toxic::warp_time_forward_all(60 * 1000); });
ImGui::SameLine();
components::button("+5 Minutes", [] { toxic::warp_time_forward_all(5 * 60 * 1000); });
components::button("PLUS_5_MINUTES"_T, [] { toxic::warp_time_forward_all(5 * 60 * 1000); });
ImGui::SameLine();
components::button("+48 Minutes", [] { toxic::warp_time_forward_all(48 * 60 * 1000); });
components::button("PLUS_48_MINUTES"_T, [] { toxic::warp_time_forward_all(48 * 60 * 1000); });
ImGui::SameLine();
components::button("+96 Minutes", [] { toxic::warp_time_forward_all(96 * 60 * 1000); });
components::button("PLUS_96_MINUTES"_T, [] { toxic::warp_time_forward_all(96 * 60 * 1000); });
ImGui::SameLine();
components::button("+200 Minutes", [] { toxic::warp_time_forward_all(200 * 60 * 1000); });
components::button("PLUS_200_MINUTES"_T, [] { toxic::warp_time_forward_all(200 * 60 * 1000); });
ImGui::SameLine();
components::button("Stop Time", [] { toxic::set_time_all(INT_MAX - 3000); });
components::button("STOP_TIME"_T, [] { toxic::set_time_all(INT_MAX - 3000); });
if (ImGui::IsItemHovered())
ImGui::SetTooltip("This cannot be reversed. Use with caution");
ImGui::SetTooltip("STOP_TIME_DESC"_T.data());
components::sub_title("Script Host Features");
ImGui::Checkbox("Disable CEO Money", &g.session.block_ceo_money);
components::sub_title("SCRIPT_HOST_FEATURES"_T);
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Blocks CEO money drops across the entire session. This can also break other stuff, use with caution");
ImGui::SetTooltip("DISABLE_CEO_MONEY_DESC"_T.data());
ImGui::SameLine();
ImGui::Checkbox("Randomize CEO Colors", &g.session.randomize_ceo_colors);
ImGui::Checkbox("RANDOMIZE_CEO_COLORS"_T.data(), &g.session.randomize_ceo_colors);
ImGui::Checkbox("Block Jobs", &g.session.block_jobs);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Prevents remote players from starting jobs while in your session");

View File

@ -49,7 +49,7 @@ namespace big
}
else
{
ImGui::Text("No sessions");
ImGui::Text("NO_SESSIONS"_T.data());
}
ImGui::ListBoxFooter();
@ -62,25 +62,25 @@ namespace big
{
auto& session = g_matchmaking_service->get_found_sessions()[selected_session_idx];
ImGui::Text("Num Players: %d", session.attributes.player_count);
ImGui::Text("Discriminator: 0x%X", session.attributes.discriminator);
ImGui::Text("Region: %s", regions[session.attributes.region].name);
ImGui::Text("Language: %s", languages[session.attributes.language].name);
ImGui::Text("SESSION_BROWSER_NUM_PLAYERS"_T.data(), session.attributes.player_count);
ImGui::Text("SESSION_BROWSER_DISCRIMINATOR"_T.data(), session.attributes.discriminator);
ImGui::Text("SESSION_BROWSER_REGION"_T.data(), regions[session.attributes.region].name);
ImGui::Text("SESSION_BROWSER_LANGUAGE"_T.data(), languages[session.attributes.language].name);
auto& data = session.info.m_net_player_data;
ImGui::Text("Host Rockstar ID: %d", data.m_gamer_handle.m_rockstar_id);
ImGui::Text("SESSION_BROWSER_HOST_RID"_T.data(), data.m_gamer_handle.m_rockstar_id);
components::button("Copy Session Info", []
components::button("COPY_SESSION_INFO"_T, []
{
ImGui::SetClipboardText(session_info);
});
ImGui::SameLine();
components::button("Join", [session]
components::button("JOIN"_T, [session]
{
if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) != 0 ||
STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS())
{
g_notification_service->push_error("Join Session", "Player switch in progress, wait a bit.");
g_notification_service->push_error("JOIN_SESSION"_T.data(), "PLAYER_SWITCH_IN_PROGRESS"_T.data());
return;
}
@ -96,12 +96,12 @@ namespace big
ImGui::EndChild();
}
if (ImGui::TreeNode("Filters"))
if (ImGui::TreeNode("FILTERS"_T.data()))
{
ImGui::Checkbox("Region", &g.session_browser.region_filter_enabled);
ImGui::Checkbox("REGION"_T.data(), &g.session_browser.region_filter_enabled);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("It is highly recommended to keep this filter enabled");
ImGui::SetTooltip("REGION_FILTER_DESC"_T.data());
if (g.session_browser.region_filter_enabled)
{
@ -121,10 +121,10 @@ namespace big
}
ImGui::Checkbox("Language", &g.session_browser.language_filter_enabled);
ImGui::Checkbox("LANGUAGE"_T.data(), &g.session_browser.language_filter_enabled);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Setting a correct region filter for the language will help tremendously");
ImGui::SetTooltip("LANGUAGE_FILTER_DESC"_T.data());
if (g.session_browser.language_filter_enabled)
{
@ -143,15 +143,15 @@ namespace big
}
}
ImGui::Checkbox("Players", &g.session_browser.player_count_filter_enabled);
ImGui::Checkbox("PLAYERS"_T.data(), &g.session_browser.player_count_filter_enabled);
if (g.session_browser.player_count_filter_enabled)
{
ImGui::InputInt("Minimum", &g.session_browser.player_count_filter_minimum);
ImGui::InputInt("Maximum", &g.session_browser.player_count_filter_maximum);
ImGui::InputInt("MIN"_T.data(), &g.session_browser.player_count_filter_minimum);
ImGui::InputInt("MAX"_T.data(), &g.session_browser.player_count_filter_maximum);
}
ImGui::Checkbox("Pool Type", &g.session_browser.pool_filter_enabled);
ImGui::Checkbox("POOL_TYPE"_T.data(), &g.session_browser.pool_filter_enabled);
if (g.session_browser.pool_filter_enabled)
{
ImGui::SameLine();
@ -161,25 +161,25 @@ namespace big
ImGui::TreePop();
}
if (ImGui::TreeNode("Sorting"))
if (ImGui::TreeNode("SORTING"_T.data()))
{
ImGui::Combo("Sort By", &g.session_browser.sort_method, "Off\0Player Count");
ImGui::Combo("SORT_BY"_T.data(), &g.session_browser.sort_method, "Off\0Player Count");
if (g.session_browser.sort_method != 0)
ImGui::Combo("Direction", &g.session_browser.sort_direction, "Ascending\0Descending");
ImGui::Combo("DIRECTION"_T.data(), &g.session_browser.sort_direction, "Ascending\0Descending");
ImGui::TreePop();
}
if (ImGui::Checkbox("Replace Game Matchmaking", &g.session_browser.replace_game_matchmaking));
if (ImGui::Checkbox("REPLACE_GAME_MATCHMAKING"_T.data(), &g.session_browser.replace_game_matchmaking));
if (ImGui::IsItemHovered())
ImGui::SetTooltip("This will replace the default game matchmaking with a custom one that will use the filters and sorting set here");
ImGui::SetTooltip("REPLACE_GAME_MATCHMAKING_DESC"_T.data());
components::button("Refresh", []
components::button("REFRESH"_T, []
{
selected_session_idx = -1;
if (!g_matchmaking_service->matchmake())
g_notification_service->push_error("Matchmaking", "Matchmaking failed");
g_notification_service->push_error("MATCHMAKING"_T.data(), "MATCHMAKING_FAIL"_T.data());
});
}
}

View File

@ -9,22 +9,22 @@ namespace big
{
void view::spoofing()
{
components::small_text("To spoof any of the below credentials you need to reconnect with the lobby.\nAll spoofed details will be only visible by other players, your game will still show your actual name, ip, rid...");
components::small_text("SPOOFING_DESCRIPTION"_T);
components::sub_title("Username");
components::sub_title("USERNAME"_T);
ImGui::Checkbox("Spoof Username", &g.spoofing.spoof_username);
ImGui::Checkbox("SPOOFING_USERNAME"_T.data(), &g.spoofing.spoof_username);
if (g.spoofing.spoof_username)
{
ImGui::SameLine();
ImGui::Checkbox("Spoof Username Locally", &g.spoofing.spoof_local_username);
ImGui::Checkbox("SPOOFING_USERNAME_LOCAL"_T.data(), &g.spoofing.spoof_local_username);
}
constexpr size_t name_size = RTL_FIELD_SIZE(rage::rlGamerInfo, m_name);
static char name[name_size];
strcpy_s(name, sizeof(name), g.spoofing.username.c_str());
ImGui::Text("Username:");
ImGui::Text("USERNAME_COLON"_T.data());
components::input_text("##username_input", name, sizeof(name));
if (name != g.spoofing.username)
@ -32,56 +32,56 @@ namespace big
ImGui::Separator();
components::sub_title("IP Address");
components::sub_title("IP_ADDRESS"_T);
ImGui::Checkbox("Spoof IP", &g.spoofing.spoof_ip);
ImGui::Checkbox("SPOOFING_IP"_T.data(), &g.spoofing.spoof_ip);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Disable this feature if you're having trouble joining sessions.");
ImGui::SetTooltip("SPOOFING_IP_DESCRIPTION"_T.data());
ImGui::Text("IP Address:");
ImGui::Text("IP_ADDRESS_COLON"_T.data());
ImGui::DragInt4("##ip_fields", g.spoofing.ip_address.data(), 0, 255);
ImGui::Separator();
components::sub_title("Rockstar ID");
components::sub_title("ROCKSTAR_ID"_T);
ImGui::Checkbox("Spoof Rockstar ID", &g.spoofing.spoof_rockstar_id);
ImGui::Checkbox("SPOOFING_ROCKSTAR_ID"_T.data(), &g.spoofing.spoof_rockstar_id);
ImGui::Text("Rockstar ID:");
ImGui::Text("ROCKSTAR_ID_COLON"_T.data());
ImGui::InputScalar("##rockstar_id_input", ImGuiDataType_U64, &g.spoofing.rockstar_id);
components::sub_title("Hide Features");
ImGui::Checkbox("Hide God Mode", &g.spoofing.spoof_hide_god);
ImGui::Checkbox("Hide Spectate", &g.spoofing.spoof_hide_spectate);
components::sub_title("SPOOFING_HIDE_FEATURES"_T);
ImGui::Checkbox("SPOOFING_HIDE_GOD_MODE"_T.data(), &g.spoofing.spoof_hide_god);
ImGui::Checkbox("SPOOFING_HIDE_SPECTATE"_T.data(), &g.spoofing.spoof_hide_spectate);
components::sub_title("Crew");
components::sub_title("CREW"_T);
ImGui::Checkbox("Spoof Crew", &g.spoofing.spoof_crew_data);
ImGui::Checkbox("SPOOFING_CREW"_T.data(), &g.spoofing.spoof_crew_data);
constexpr size_t crew_tag_size = RTL_FIELD_SIZE(ClanData, m_clan_tag);
static char crew_tag[crew_tag_size];
strcpy_s(crew_tag, sizeof(crew_tag), g.spoofing.crew_tag.c_str());
ImGui::Text("Crew Tag:");
ImGui::Text("SPOOFING_CREW_TAG"_T.data());
components::input_text("##crew_tag_input", crew_tag, sizeof(crew_tag));
if (crew_tag != g.spoofing.crew_tag)
g.spoofing.crew_tag = std::string(crew_tag);
ImGui::Checkbox("Is Rockstar Crew", &g.spoofing.rockstar_crew);
ImGui::Checkbox("SPOOFING_CREW_ROCKSTAR"_T.data(), &g.spoofing.rockstar_crew);
ImGui::Checkbox("Square Crew Tag", &g.spoofing.square_crew_tag);
ImGui::Checkbox("SPOOFING_CREW_SQUARE_TAG"_T.data(), &g.spoofing.square_crew_tag);
components::sub_title("Extra - Only work when Spoofed RID");
components::sub_title("SPOOFING_EXTRA"_T);
ImGui::Checkbox("Is Cheater", &g.spoofing.spoof_cheater);
ImGui::Checkbox("Is Rockstar Dev", &g.spoofing.spoof_rockstar_dev);
ImGui::Checkbox("Is Rockstar QA", &g.spoofing.spoof_rockstar_qa);
ImGui::Checkbox("SPOOFING_IS_CHEATER"_T.data(), &g.spoofing.spoof_cheater);
ImGui::Checkbox("SPOOFING_IS_DEV"_T.data(), &g.spoofing.spoof_rockstar_dev);
ImGui::Checkbox("SPOOFING_IS_QA"_T.data(), &g.spoofing.spoof_rockstar_qa);
components::sub_title("Session Attributes");
components::small_text("Only works when session host");
components::sub_title("SPOOFING_SESSION_ATTRIBUTES"_T);
components::small_text("SPOOFING_ONLY_WORKS_AS_HOST"_T);
ImGui::Checkbox("Region", &g.spoofing.spoof_session_region_type);
ImGui::Checkbox("SPOOFING_ATTRIBUTE_REGION"_T.data(), &g.spoofing.spoof_session_region_type);
if (g.spoofing.spoof_session_region_type)
{
ImGui::SameLine();
@ -97,7 +97,7 @@ namespace big
ImGui::EndCombo();
}
}
ImGui::Checkbox("Language", &g.spoofing.spoof_session_language);
ImGui::Checkbox("SPOOFING_ATTRIBUTE_LANGUAGE"_T.data(), &g.spoofing.spoof_session_language);
if (g.spoofing.spoof_session_language)
{
ImGui::SameLine();
@ -115,7 +115,7 @@ namespace big
}
}
ImGui::Checkbox("Player Count", &g.spoofing.spoof_session_player_count);
ImGui::Checkbox("SPOOFING_ATTRIBUTE_PLAYER_COUNT"_T.data(), &g.spoofing.spoof_session_player_count);
if (g.spoofing.spoof_session_player_count)
{
ImGui::SameLine();