mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 09:02:38 +08:00
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:
@ -37,7 +37,7 @@ namespace big
|
||||
player_vehicle = 0;
|
||||
|
||||
selected_slot = -1;
|
||||
ImGui::Text("Please enter a vehicle.");
|
||||
ImGui::Text("PLEASE_ENTER_A_VEHICLE"_T.data());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -67,9 +67,9 @@ namespace big
|
||||
std::map<std::string, std::vector<int>> tmp_front_wheel_map;
|
||||
std::map<std::string, std::vector<int>> tmp_rear_wheel_map;
|
||||
|
||||
tmp_slot_display_names[MOD_PLATE_STYLE] = "Plate Style";
|
||||
tmp_slot_display_names[MOD_WINDOW_TINT] = "Window Tint";
|
||||
tmp_slot_display_names[MOD_WHEEL_TYPE] = "Wheel Type";
|
||||
tmp_slot_display_names[MOD_PLATE_STYLE] = "PLATE_STYLE"_T.data();
|
||||
tmp_slot_display_names[MOD_WINDOW_TINT] = "WINDOW_TINT"_T.data();
|
||||
tmp_slot_display_names[MOD_WHEEL_TYPE] = "WHEEL_TYPE"_T.data();
|
||||
|
||||
tmp_mod_display_names[MOD_PLATE_STYLE].insert(lsc_plate_styles.begin(), lsc_plate_styles.end());
|
||||
tmp_mod_display_names[MOD_WINDOW_TINT].insert(lsc_window_tint_types.begin(), lsc_window_tint_types.end());
|
||||
@ -117,7 +117,7 @@ namespace big
|
||||
{
|
||||
if (is_bennys)
|
||||
{
|
||||
if (mod_name.rfind("Chrome ", 0) == 0)
|
||||
if (mod_name.rfind("LSC_CHROME"_T.data(), 0) == 0)
|
||||
{
|
||||
std::string new_mod_name = mod_name.substr(7);
|
||||
|
||||
@ -145,7 +145,7 @@ namespace big
|
||||
{
|
||||
if (is_bennys)
|
||||
{
|
||||
if (mod_name.rfind("Chrome ", 0) == 0)
|
||||
if (mod_name.rfind("LSC_CHROME"_T.data(), 0) == 0)
|
||||
{
|
||||
std::string new_mod_name = mod_name.substr(7);
|
||||
|
||||
@ -194,11 +194,11 @@ namespace big
|
||||
});
|
||||
}
|
||||
|
||||
components::button("Start LS Customs", [] {
|
||||
components::button("START_LS_CUSTOMS"_T, [] {
|
||||
g.vehicle.ls_customs = true;
|
||||
});
|
||||
ImGui::SameLine();
|
||||
if (components::button("Max Vehicle"))
|
||||
if (components::button("MAX_VEHICLE"_T))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
vehicle::max_vehicle(self::veh);
|
||||
@ -213,9 +213,9 @@ namespace big
|
||||
static char plate[9];
|
||||
|
||||
ImGui::SetNextItemWidth(200.f);
|
||||
components::input_text_with_hint("##plate", "Plate Number", plate, sizeof(plate), ImGuiInputTextFlags_None);
|
||||
components::input_text_with_hint("##plate", "PLATE_NUMBER"_T, plate, sizeof(plate), ImGuiInputTextFlags_None);
|
||||
ImGui::SameLine();
|
||||
if (components::button("Change Plate Number"))
|
||||
if (components::button("CHANGE_PLATE_NUMBER"_T))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
vehicle::set_plate(self::veh, plate);
|
||||
@ -223,10 +223,10 @@ namespace big
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Mod Options");
|
||||
components::sub_title("MOD_OPTIONS"_T);
|
||||
|
||||
bool is_bulletproof_tires = !owned_mods[MOD_TIRE_CAN_BURST];
|
||||
if (ImGui::Checkbox("Bulletproof Tires", (bool*)&is_bulletproof_tires))
|
||||
if (ImGui::Checkbox("BULLETPROOF_TIRES"_T.data(), (bool*)&is_bulletproof_tires))
|
||||
{
|
||||
g_fiber_pool->queue_job([is_bulletproof_tires] {
|
||||
owned_mods[MOD_TIRE_CAN_BURST] = (int32_t)!is_bulletproof_tires;
|
||||
@ -235,7 +235,7 @@ namespace big
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Low Grip Tires", (bool*)&owned_mods[MOD_DRIFT_TIRE]))
|
||||
if (ImGui::Checkbox("LOW_GRIP_TIRES"_T.data(), (bool*)&owned_mods[MOD_DRIFT_TIRE]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_DRIFT_TYRES(player_vehicle, owned_mods[MOD_DRIFT_TIRE]);
|
||||
@ -243,14 +243,14 @@ namespace big
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Turbo", (bool*)&owned_mods[MOD_TURBO]))
|
||||
if (ImGui::Checkbox("TURBO"_T.data(), (bool*)&owned_mods[MOD_TURBO]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TURBO, owned_mods[MOD_TURBO]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Tiresmoke", (bool*)&owned_mods[MOD_TYRE_SMOKE]))
|
||||
if (ImGui::Checkbox("TIRESMOKE"_T.data(), (bool*)&owned_mods[MOD_TYRE_SMOKE]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TYRE_SMOKE, owned_mods[MOD_TYRE_SMOKE]);
|
||||
@ -261,7 +261,7 @@ namespace big
|
||||
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::sub_title("Slot");
|
||||
components::sub_title("SLOT"_T);
|
||||
if (ImGui::ListBoxHeader("##slot", ImVec2(200, 200)))
|
||||
{
|
||||
for (const auto& [slot, name] : slot_display_names)
|
||||
@ -300,7 +300,7 @@ namespace big
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::sub_title("Mod");
|
||||
components::sub_title("MOD"_T);
|
||||
if (ImGui::ListBoxHeader("##mod", ImVec2(240, 200)))
|
||||
{
|
||||
for (const auto& it : mod_display_names[selected_slot])
|
||||
@ -369,7 +369,7 @@ namespace big
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
components::sub_title("Style");
|
||||
components::sub_title("STYLE"_T);
|
||||
if (ImGui::ListBoxHeader("##style", ImVec2(200, 200)))
|
||||
{
|
||||
std::string mod_name = mod_display_names[selected_slot][*wheel_stock_mod];
|
||||
@ -386,7 +386,7 @@ namespace big
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
if (ImGui::Selectable("Stock", mod == owned_mods[selected_slot] && *wheel_custom == false))
|
||||
if (ImGui::Selectable("STOCK"_T.data(), mod == owned_mods[selected_slot] && *wheel_custom == false))
|
||||
{
|
||||
g_fiber_pool->queue_job([&mod] {
|
||||
VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, mod, false);
|
||||
@ -398,7 +398,7 @@ namespace big
|
||||
should_custom = true;
|
||||
}
|
||||
|
||||
std::string label = "Style " + std::to_string(mod);
|
||||
std::string label = "LSC_STYLE"_T.data() + std::to_string(mod);
|
||||
if (ImGui::Selectable(label.c_str(), mod == owned_mods[selected_slot] && *wheel_custom == should_custom))
|
||||
{
|
||||
g_fiber_pool->queue_job([&mod, should_custom] {
|
||||
@ -417,44 +417,47 @@ namespace big
|
||||
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Neon Light Options");
|
||||
components::sub_title("NEON_LIGHT_OPTIONS"_T);
|
||||
|
||||
if (ImGui::Checkbox("Headlight##headlight_en", (bool*)&owned_mods[MOD_XENON_LIGHTS]))
|
||||
ImGui::PushID("##headlight_en");
|
||||
if (ImGui::Checkbox("HEADLIGHT"_T.data(), (bool*)&owned_mods[MOD_XENON_LIGHTS]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
|
||||
});
|
||||
}
|
||||
ImGui::PopID();
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Left", (bool*)&owned_mods[MOD_NEON_LEFT_ON]))
|
||||
if (ImGui::Checkbox("LEFT"_T.data(), (bool*)&owned_mods[MOD_NEON_LEFT_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Right", (bool*)&owned_mods[MOD_NEON_RIGHT_ON]))
|
||||
if (ImGui::Checkbox("RIGHT"_T.data(), (bool*)&owned_mods[MOD_NEON_RIGHT_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_RIGHT, owned_mods[MOD_NEON_RIGHT_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Front", (bool*)&owned_mods[MOD_NEON_FRONT_ON]))
|
||||
if (ImGui::Checkbox("FRONT"_T.data(), (bool*)&owned_mods[MOD_NEON_FRONT_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Checkbox("Back", (bool*)&owned_mods[MOD_NEON_BACK_ON]))
|
||||
if (ImGui::Checkbox("BACK"_T.data(), (bool*)&owned_mods[MOD_NEON_BACK_ON]))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
||||
});
|
||||
}
|
||||
ImGui::SameLine();
|
||||
components::button("Check All##neon_check_all", [] {
|
||||
ImGui::PushID("##neon_check_all");
|
||||
components::button("CHECK_ALL"_T, [] {
|
||||
owned_mods[MOD_XENON_LIGHTS] = true;
|
||||
owned_mods[MOD_NEON_LEFT_ON] = true;
|
||||
owned_mods[MOD_NEON_RIGHT_ON] = true;
|
||||
@ -467,8 +470,10 @@ namespace big
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
||||
});
|
||||
ImGui::PopID();
|
||||
ImGui::SameLine();
|
||||
components::button("Uncheck All##neon_uncheck_all", [] {
|
||||
ImGui::PushID("##neon_uncheck_all");
|
||||
components::button("UNCHECK_ALL"_T, [] {
|
||||
owned_mods[MOD_XENON_LIGHTS] = false;
|
||||
owned_mods[MOD_NEON_LEFT_ON] = false;
|
||||
owned_mods[MOD_NEON_RIGHT_ON] = false;
|
||||
@ -481,9 +486,10 @@ namespace big
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_FRONT, owned_mods[MOD_NEON_FRONT_ON]);
|
||||
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_BACK, owned_mods[MOD_NEON_BACK_ON]);
|
||||
});
|
||||
ImGui::PopID();
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Color Options");
|
||||
components::sub_title("COLOR_OPTIONS"_T);
|
||||
|
||||
static int color_to_change = 0;
|
||||
static int color_type = 8;
|
||||
@ -498,29 +504,29 @@ namespace big
|
||||
|
||||
if (ImGui::ListBoxHeader("##color_options", ImVec2(120, 254)))
|
||||
{
|
||||
if (ImGui::Selectable("Primary", color_to_change == 0, ImGuiSelectableFlags_SelectOnClick))
|
||||
if (ImGui::Selectable("PRIMARY"_T.data(), color_to_change == 0, ImGuiSelectableFlags_SelectOnClick))
|
||||
{
|
||||
color_to_change = 0;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Secondary", color_to_change == 1))
|
||||
if (ImGui::Selectable("SECONDARY"_T.data(), color_to_change == 1))
|
||||
{
|
||||
color_to_change = 1;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Pearlescent", color_to_change == 2))
|
||||
if (ImGui::Selectable("PEARLESCENT"_T.data(), color_to_change == 2))
|
||||
{
|
||||
color_to_change = 2;
|
||||
color_type = 4;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Interior", color_to_change == 3))
|
||||
if (ImGui::Selectable("INTERIOR"_T.data(), color_to_change == 3))
|
||||
{
|
||||
color_to_change = 3;
|
||||
color_type = 6;
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Dashboard", color_to_change == 4))
|
||||
if (ImGui::Selectable("DASHBOARD"_T.data(), color_to_change == 4))
|
||||
{
|
||||
color_to_change = 4;
|
||||
color_type = 7;
|
||||
@ -530,7 +536,7 @@ namespace big
|
||||
{
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
if (ImGui::Selectable("Tire Smoke", color_to_change == 5))
|
||||
if (ImGui::Selectable("TIRE_SMOKE"_T.data(), color_to_change == 5))
|
||||
{
|
||||
color_to_change = 5;
|
||||
color_type = 8;
|
||||
@ -540,7 +546,7 @@ namespace big
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Wheel Color", color_to_change == 6))
|
||||
if (ImGui::Selectable("WHEEL_COLOR"_T.data(), color_to_change == 6))
|
||||
{
|
||||
color_to_change = 6;
|
||||
color_type = 5;
|
||||
@ -550,17 +556,19 @@ namespace big
|
||||
{
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
if (ImGui::Selectable("Headlight##headlight_col", color_to_change == 7))
|
||||
ImGui::PushID("##headlight_col");
|
||||
if (ImGui::Selectable("HEADLIGHT"_T.data(), color_to_change == 7))
|
||||
{
|
||||
color_to_change = 7;
|
||||
color_type = 9;
|
||||
}
|
||||
ImGui::PopID();
|
||||
if (!owned_mods[MOD_XENON_LIGHTS])
|
||||
{
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Neon", color_to_change == 8))
|
||||
if (ImGui::Selectable("NEON"_T.data(), color_to_change == 8))
|
||||
{
|
||||
color_to_change = 8;
|
||||
color_type = 8;
|
||||
@ -582,11 +590,11 @@ namespace big
|
||||
ImGui::SameLine();
|
||||
if (ImGui::ListBoxHeader("##colors", ImVec2(140, 254)))
|
||||
{
|
||||
if (ImGui::Selectable("Custom", color_type == 8, ImGuiSelectableFlags_SelectOnClick))
|
||||
if (ImGui::Selectable("CUSTOM"_T.data(), color_type == 8, ImGuiSelectableFlags_SelectOnClick))
|
||||
{
|
||||
color_type = 8;
|
||||
}
|
||||
if (ImGui::Selectable("Remove Custom", false))
|
||||
if (ImGui::Selectable("REMOVE_CUSTOM"_T.data(), false))
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
if (color_to_change == 0)
|
||||
@ -601,19 +609,19 @@ namespace big
|
||||
});
|
||||
}
|
||||
|
||||
if (ImGui::Selectable("Chrome", color_type == 0))
|
||||
if (ImGui::Selectable("CHROME"_T.data(), color_type == 0))
|
||||
{
|
||||
color_type = 0;
|
||||
}
|
||||
if (ImGui::Selectable("Classic", color_type == 1))
|
||||
if (ImGui::Selectable("CLASSIC"_T.data(), color_type == 1))
|
||||
{
|
||||
color_type = 1;
|
||||
}
|
||||
if (ImGui::Selectable("Matte", color_type == 2))
|
||||
if (ImGui::Selectable("MATTE"_T.data(), color_type == 2))
|
||||
{
|
||||
color_type = 2;
|
||||
}
|
||||
if (ImGui::Selectable("Metals", color_type == 3))
|
||||
if (ImGui::Selectable("METALS"_T.data(), color_type == 3))
|
||||
{
|
||||
color_type = 3;
|
||||
}
|
||||
@ -710,7 +718,7 @@ namespace big
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(214);
|
||||
if (ImGui::ColorPicker3("Custom VehColor", color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex))
|
||||
if (ImGui::ColorPicker3("CUSTOM_VEHCOLOR"_T.data(), color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex))
|
||||
{
|
||||
*color_r = (int)(color[0] * 255);
|
||||
*color_g = (int)(color[1] * 255);
|
||||
@ -772,7 +780,7 @@ namespace big
|
||||
{
|
||||
case 0: //Chrome
|
||||
{
|
||||
if (ImGui::Selectable("Chrome", selected_color == COLOR_CHROME))
|
||||
if (ImGui::Selectable("CHROME"_T.data(), selected_color == COLOR_CHROME))
|
||||
{
|
||||
if (color_to_change == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user