Add spawn with id for vehicles
This commit is contained in:
parent
e96ec7bee3
commit
0d9314b8ce
@ -115,19 +115,25 @@
|
||||
"CheckUpdate": "Check update",
|
||||
"Commands": "Commands",
|
||||
"Config": "Config",
|
||||
"Coords": "Coords: %.2f, %.2f, %.2f",
|
||||
"CopyrightDisclaimer": "Copyright Grinch_ 2019-2022. All rights reserved.",
|
||||
"CPUUsage": "CPU usage: %.2f%%",
|
||||
"Credits": "Credits",
|
||||
"DiscordRPC": "Discord rich presence",
|
||||
"DiscordServer": "Discord server",
|
||||
"FixVehKey": "Fix current vehicle",
|
||||
"FlipVehKey": "Flip current vehicle",
|
||||
"Frames": "Frames: %d",
|
||||
"FreecamKey": "Toggle freecam",
|
||||
"GitHubRepo": "GitHub repo",
|
||||
"GodModeKey": "Toggle god mode",
|
||||
"Hotkeys": "Hotkeys",
|
||||
"InvalidComamnd": "Invalid Command",
|
||||
"InvalidLocation": "Invalid location",
|
||||
"InvalidValue": "Invalid value",
|
||||
"Language": "Language",
|
||||
"LanguageChangeFailed": "Failed to change language!",
|
||||
"Location": "Location: %s",
|
||||
"Name": "Name",
|
||||
"NoBG": "No background",
|
||||
"OpenCMDKey": "Open/ close command window",
|
||||
@ -141,6 +147,7 @@
|
||||
"QuickVehSpawnerCMDText": "Spawn vehicles by typing their model names.\nExample: veh (veh_name)",
|
||||
"QuickWepSpawnerCMD": "Quick weapon spawner",
|
||||
"QuickWepSpawnerCMDText": "Spawn weapons by typing their model names.\nExample: wep (wep_name)",
|
||||
"RAMUsage": "RAM usage: %.2f%%",
|
||||
"ResetConfig": "Reset config",
|
||||
"ResetConfigMSG": "Config has been reset. Restart the game for it to take effect.",
|
||||
"ResetSize": "Reset size",
|
||||
@ -163,9 +170,13 @@
|
||||
"Usage": "Usage",
|
||||
"UsageText": "Left-click selects hotkey.\nLeft clicking outside deselects.\nRight click disables hotkey.",
|
||||
"VehEngineKey": "Toggle vehicle engine",
|
||||
"VehHealth": "Veh Health: %.f",
|
||||
"VehicleSpawned": "Vehicle spawned",
|
||||
"VehSpeed": "Veh Health: %d",
|
||||
"VehStartKey": "Vehicle instant start",
|
||||
"VehStopKey": "Vehicle instant start",
|
||||
"Version": "Version"
|
||||
"Version": "Version",
|
||||
"WeaponSpawned": "Weapon spawned"
|
||||
},
|
||||
"Ped": {
|
||||
"Accuracy": "Accuracy",
|
||||
@ -234,7 +245,7 @@
|
||||
"Fat": "Fat",
|
||||
"FireProof": "Fire proof",
|
||||
"FreeHealthcare": "Free healthcare",
|
||||
"FreezeWL" : "Freeze wanted level",
|
||||
"FreezeWL": "Freeze wanted level",
|
||||
"GodDisabled": "God mode disabled",
|
||||
"GodEnabled": "God mode enabled",
|
||||
"GodMode": "God mode",
|
||||
@ -306,6 +317,11 @@
|
||||
"TeleportMarker": "Teleport to marker",
|
||||
"TeleportToCoord": "Teleport to coordinates"
|
||||
},
|
||||
"Updater": {
|
||||
"Failed": "Failed to check for updates",
|
||||
"Found": "Update found",
|
||||
"NotFound": "No update found"
|
||||
},
|
||||
"Vehicle": {
|
||||
"Abs": "Abs",
|
||||
"ADM": "Anti dive multiplier",
|
||||
@ -372,9 +388,11 @@
|
||||
"HighSpeedDamping": "High speed damping",
|
||||
"HSTarget": "HS targetable",
|
||||
"HSTargetTip": "Heat Seaker missile can target this",
|
||||
"IDSpawnText": "Spawn with ID (Enter)",
|
||||
"InfNitro": "Unlimited nitro",
|
||||
"InfNitroTip": "Nitro will activate when left clicked\n\n\nEnabling this would disable\nAll cars have nitro\nAll taxis have nitro",
|
||||
"InstantStop": "Instant stop",
|
||||
"InvalidID": "Invalid model ID",
|
||||
"InvisCar": "Invisible car",
|
||||
"LessDmg": "Take less damage",
|
||||
"LessTraffic": "Decreased traffic",
|
||||
@ -461,12 +479,6 @@
|
||||
"Watertight": "Watertight car",
|
||||
"WatertightTip": "Peds inside won't drown if the vehicle\nis submerged in water"
|
||||
},
|
||||
"Updater":
|
||||
{
|
||||
"Failed" : "Failed to check for updates",
|
||||
"Found" : "Update found",
|
||||
"NotFound" : "No update found"
|
||||
},
|
||||
"Visual": {
|
||||
"Ambient": "Ambient",
|
||||
"AmbientBl": "Ambient bl",
|
||||
|
@ -796,7 +796,7 @@ void Game::ShowPage()
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5);
|
||||
ImGui::PushItemWidth((ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ItemSpacing.x)/2);
|
||||
Ui::ListBoxStr("##Categories", m_StatData.m_Categories, m_StatData.m_Selected);
|
||||
ImGui::SameLine();
|
||||
Ui::FilterWithHint("##Filter", m_StatData.m_Filter, TEXT("Window.Search"));
|
||||
|
26
src/menu.cpp
26
src/menu.cpp
@ -163,40 +163,40 @@ void Menu::DrawOverlay()
|
||||
|
||||
if (m_Overlay::bCoord)
|
||||
{
|
||||
ImGui::Text("Coord: %.2f, %.2f, %.2f", pos.x, pos.y, pos.z);
|
||||
ImGui::Text(TEXT("Menu.Coords"), pos.x, pos.y, pos.z);
|
||||
}
|
||||
|
||||
if (m_Overlay::bCpuUsage)
|
||||
{
|
||||
ImGui::Text("CPU usage: %.2f%%", m_Overlay::fCpuUsage);
|
||||
ImGui::Text(TEXT("Menu.CPUUsage"), m_Overlay::fCpuUsage);
|
||||
}
|
||||
|
||||
if (m_Overlay::bFPS)
|
||||
{
|
||||
ImGui::Text("Frames: %d", m_Overlay::mFPS);
|
||||
ImGui::Text(TEXT("Menu.Frames"), m_Overlay::mFPS);
|
||||
}
|
||||
|
||||
if (m_Overlay::bLocName)
|
||||
{
|
||||
ImGui::Text("Location: %s", Util::GetLocationName(&pos).c_str());
|
||||
ImGui::Text(TEXT("Menu.Location"), Util::GetLocationName(&pos).c_str());
|
||||
}
|
||||
|
||||
if (m_Overlay::bMemUsage)
|
||||
{
|
||||
ImGui::Text("RAM usage: %.2f%%", m_Overlay::fMemUsage);
|
||||
ImGui::Text(TEXT("Menu.RAMUsage"), m_Overlay::fMemUsage);
|
||||
}
|
||||
|
||||
if (pPlayer->m_pVehicle && pPlayer->m_pVehicle->m_pDriver == pPlayer)
|
||||
{
|
||||
if (m_Overlay::bVehHealth)
|
||||
{
|
||||
ImGui::Text("Veh Health: %.f", pPlayer->m_pVehicle->m_fHealth);
|
||||
ImGui::Text(TEXT("Menu.VehHealth"), pPlayer->m_pVehicle->m_fHealth);
|
||||
}
|
||||
|
||||
if (m_Overlay::bVehSpeed)
|
||||
{
|
||||
int speed = pPlayer->m_pVehicle->m_vecMoveSpeed.Magnitude() * 50.0f; // 02E3 - GET_CAR_SPEED
|
||||
ImGui::Text("Veh Speed: %d", speed);
|
||||
ImGui::Text(TEXT("Menu.VehSpeed"), speed);
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,7 +304,7 @@ void Menu::ProcessCommands()
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
SetHelpMessage("Invalid location");
|
||||
SetHelpMessage(TEXT("Menu.InvalidLocation"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ void Menu::ProcessCommands()
|
||||
{
|
||||
std::string weapon = "-1";
|
||||
Weapon::GiveWeaponToPlayer(weapon);
|
||||
SetHelpMessage("Weapon given");
|
||||
SetHelpMessage(TEXT("Menu.WeaponSpawned"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -328,10 +328,10 @@ void Menu::ProcessCommands()
|
||||
if (wep_name != "" && pweaponinfo->m_nModelId1 != -1)
|
||||
{
|
||||
Weapon::GiveWeaponToPlayer(weapon_name);
|
||||
SetHelpMessage("Weapon given");
|
||||
SetHelpMessage(TEXT("Menu.WeaponSpawned"));
|
||||
}
|
||||
else
|
||||
SetHelpMessage("Invalid command");
|
||||
SetHelpMessage(TEXT("Menu.InvalidComamnd"));
|
||||
}
|
||||
|
||||
return;
|
||||
@ -346,10 +346,10 @@ void Menu::ProcessCommands()
|
||||
{
|
||||
std::string smodel = std::to_string(model);
|
||||
Vehicle::SpawnVehicle(smodel);
|
||||
SetHelpMessage("Vehicle spawned");
|
||||
SetHelpMessage(TEXT("Menu.VehicleSpawned"));
|
||||
}
|
||||
else
|
||||
SetHelpMessage("Invalid command");
|
||||
SetHelpMessage(TEXT("Menu.InvalidComamnd"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ void Ui::DrawJSON(ResourceStore& data,
|
||||
std::function<void(std::string&, std::string&, std::string&)> func_left_click,
|
||||
std::function<void(std::string&, std::string&, std::string&)> func_right_click)
|
||||
{
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5);
|
||||
ImGui::PushItemWidth((ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ItemSpacing.x)/2);
|
||||
ListBoxStr("##Categories", data.m_Categories, data.m_Selected);
|
||||
ImGui::SameLine();
|
||||
|
||||
@ -573,7 +573,7 @@ void Ui::DrawImages(ResourceStore &store, std::function<void(std::string&)> onLe
|
||||
imgPopup.function = nullptr;
|
||||
}
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvailWidth() / 2 - 5);
|
||||
ImGui::PushItemWidth((ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ItemSpacing.x)/2);
|
||||
if (customNames)
|
||||
{
|
||||
ListBoxCustomNames("##Categories", store.m_Categories, store.m_Selected, customNames, length);
|
||||
|
@ -998,10 +998,36 @@ void Vehicle::ShowPage()
|
||||
Ui::CheckboxWithHint(TEXT("Vehicle.SpawnInAir"), &m_Spawner::m_bSpawnInAir);
|
||||
ImGui::Columns(1);
|
||||
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
#ifdef GTASA
|
||||
ImGui::SetNextItemWidth(ImGui::GetWindowContentRegionWidth() - 2.5);
|
||||
int width = (ImGui::GetWindowContentRegionWidth() - ImGui::GetStyle().ItemSpacing.x)/2;
|
||||
ImGui::SetNextItemWidth(width);
|
||||
#endif
|
||||
static char smodel[8];
|
||||
if (ImGui::InputTextWithHint("##SpawnID", TEXT("Vehicle.IDSpawnText"), smodel, 8, ImGuiInputTextFlags_EnterReturnsTrue))
|
||||
{
|
||||
try{
|
||||
int model = std::stoi(smodel);
|
||||
|
||||
if (CModelInfo::IsCarModel(model))
|
||||
{
|
||||
std::string str = std::string(smodel);
|
||||
SpawnVehicle(str);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetHelpMessage(TEXT("Vehicle.InvalidID"));
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
SetHelpMessage(TEXT("Vehicle.InvalidID"));
|
||||
}
|
||||
}
|
||||
#ifdef GTASA
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(width);
|
||||
ImGui::InputTextWithHint("##LicenseText", TEXT("Vehicle.PlateText"), m_Spawner::m_nLicenseText, 9);
|
||||
|
||||
Ui::DrawImages(m_Spawner::m_VehData, SpawnVehicle, nullptr,
|
||||
|
@ -9,4 +9,4 @@ set "III_DIR="E:\GTA3""
|
||||
cd tools
|
||||
premake5.exe vs2022
|
||||
cd ../build
|
||||
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat"
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\VsDevCmd.bat"
|
||||
|
Loading…
Reference in New Issue
Block a user